[Series] ABAP SAP ABAP animated cursors

No public: SAP Technical
Author: Matinal
 

 

The preface

We can focus on my public number, the number public in the layout better, read more comfortable.

Body part

There have put income, in turn explain, for example behind for beginners (because there are a lot of people asked me this)

    Some information about abap pointer.
    1. What is abap pointer:
    in abap inside, fieldsymbol equivalent pointer c language. If you define and assign the appropriate structures or variables to it, in fact, it points to the address of the structure or variable, if you modify the value fieldsymbol, the corresponding value of the structure or variable also will change.
    2. How to define a pointer:
    the basic form: field-symbols.
    Additional information:
    . 1 .... type: define a data type, and then define the pointer
    2 .... typerefto: a pointer to the class or interface
    3 .... typerefto: pointers to data structures
    4 .... typelineof: line items within the pointer table
    5 .... like: type database table pointer
    6 .... likelineof: pointer type line item database table
    7 .... type <>: pointer in the table
    3. how allocation pointer:
    (. 1) .assignfto .: assigned a pointer, including the following types
    1 .... casting ...: operating system mainly unicode
    . 1A .... Casting
    1B .... castingtypetype
    1C .... Casting ... decimalsdec
    1D castinglikef1 ....
    2 .... TypeType: directly specify the type
    3 .... decimalsdec: Specifies the number of decimal places
    4 .... rangerange: specified range
    . (2) assigned to a field structure pointer
    assigncomponentidxofstructurestructo.
    Assigncomponentnameofstructurestructo.
    (. 3) a method of allocating a pointer to the class.
    Assigndref-> to *.
    (. 4). from the beginning f, f is the content of n times after a long pointer assigned to
    assignfincrementnto.
    (. 5). pointer to the local variables assigned
    assignlocalcopy
    3a.assignlocalcopyoffto.
    3b.assignlocalcopyofinitialfto.
    3c.assignlocalcopyofinitiallineofitabto.
    4c.assignlocalcopyofmaintablefield (F) to.
    (. 6) .assigndynamicj: dynamic allocation pointer
    . 4a.assign (F) to
    . 4b.assignoref -> (F) to
    . 4c.assign (F1) => (F2) to
    4d.assigntablefield (F ) to.
    4e.assignlocalcopyofmaintablefield (f) to.
    4f.assignlocalcopyof ... (f) to.
    4. How unassigned:
    Unassign.

Example 1:

 

field-SYMBOLS: <wa> TYPE any,
               <wa2> TYPE any.
ASSIGN WA_MARA to <wa>.
select single *
  from MARA into WA_MARA.
WHILE sy-subrc = 0.
  ASSIGN COMPONENT sy-index of STRUCTURE <wa> to <wa2>.
  IF sy-index = 5.
    itab-ZXXX1 = <wa2>.
  ENDIF.
  IF sy-index > 9 and sy-index < 25.
    itab-ZXXX2 = <wa2>.
  ENDIF.
  APPEND itab.
ENDWHILE.


Example 2:

 

 

LOOP AT ITAB.
  CONCATENATE T_A ITAB-A INTO T_B.
  ASSIGN (XXX) TO <A>.
  ITAB2-A1 = <A>.
  APPEND ITAB2.
ENDLOOP.

 

Guess you like

Origin www.cnblogs.com/SAPmatinal/p/11183832.html