Posts

Showing posts with the label Inline Declaration in ABAP (Keyword: DATA)

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

Inline Declaration in ABAP (Keyword: DATA)

 The new declaration operator DATA allows inline declarations of variables with declaration expressions in declaration positions. Declaration positions are write positions where the operand type can be determined from the context statically. lets look at below examples on how to use this in real world programming. Example:  while use loop:       Loop at itab into DATA(wa_itab).       ...........  Endloop.     Call transformation .... result XML  DATA(xml).   The work area can now be dynamically defined and used via inline declaration. While importing data in methods, the target variables can now be dynamically defined and used by inline declaration. using in select query also:      SELECT  a ~ prueflos ,  a ~ plnty ,  a ~ plnnr ,  a ~ plnal ,  b ~ vorglfnr ,  b ~ merknr ,  b ~ verwmerkm ,  b ~ formelsl      FROM ...