"WITHOUT MEMBERS "Optional-Restricts access to group members "DESCENDING "Optional-Default is Ascending. Index = GROUP INDEX " Stores the group index Size = GROUP SIZE "Stores the number of members in the group Ready? DATA : lt_spfli TYPE STANDARD TABLE OF spfli. These are SIZE, INDEX, ASCENDING/DESCENDING and WITHOUT MEMBERS. Also we can use optional keywords to further enhance GROUP BY potential. From ABAP 740 and above we can now use GROUP BY in order to group data in an internal table based on a column value (just like how we used GROUP BY on the SELECT statement). It is true that LOOP is one of the most famous statements to read, modify and append internal tables. We think that you all use LOOP statement daily in your codes. In order to "move-corresponding" you can map the customer component to the kunnr component. LT_OUT = CORRESPONDING #( LT_VBAK MAPPING CUSTOMER = KUNNR ).Īs you can see lt_vbak has a matnr component but lt_out hasn't. INTO CORRESPONDING FIELDS OF TABLE LT_VBAK. Let's see: DATA: BEGIN OF LT_VBAK OCCURS 0, You will understand it completely with the following example. Besides assigning components with the same technical name you can also define the mapping you want. It seems like move-corresponding for structures or internal tables but it has something unique. Here is another very useful constructor operator. IN DATE-YEAR & SEP & DATE-MONTH & SEP & DATE-DAY ). TYPES: TT_DATES TYPE TABLE OF TY_DATES WITH EMPTY KEY. IT_TABDESCR = REF_TABLE_DESCR->COMPONENTS.ĭATA(STRUCT_COMPONENTS_L) = CAST CL_ABAP_STRUCTDESCR(ĬL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( P_TABLE ) )->COMPONENTS. REF_TABLE_DESCR ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( P_TABLE ). "Example OneĭATA : IT_TABDESCR TYPE ABAP_COMPDESCR_TAB,ĭATA : REF_TABLE_DESCR TYPE REF TO CL_ABAP_STRUCTDESCR. Expressions are so good if you know how to use them. Amazing, isn't it? Finally we will show you a complete example where you can see how value can be used in a block of code combined with conv and let. The old way where you declare the variable and call line by line the methods and the newer one where you use inline declaration with casting. Below there is an example which shows how to dynamically take the components of a table. Ok, let's make it a little bit more complex now.
0 Comments
Leave a Reply. |