Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Read components of a dynamic structure

      DATA(lo_structdescr) = CAST cl_abap_structdescr( cl_abap_structdescr=>describe_by_data( p_data = <dynamic_structure> ) ).
      DATA(components)     = lo_structdescr->get_components( ).

      IF line_exists( components[ name = 'FIELD1' ] ).
         ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <dynamic_structure> TO FIELD-SYMBOL(<field1>).
         "do stuff...
      ENDIF.

Leave a Reply

Your email address will not be published. Required fields are marked *