Skip to Content
-1

Append line of one table to feilds of other table

Jun 15, 2017 at 06:52 AM

51

avatar image

i want to append record of itab1 to feilds of itab 2.

itab1

itab2

can any one help.

lips.jpg (35.7 kB)
tt.jpg (60.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Evgeny Gubenko Jun 15, 2017 at 07:19 AM
0

Hi!

You can get a fields table from your IT_D0_DETAIL table line via class CL_ABAP_STRUCTDESCR and then loop by fields (attribute COMPONENTS) for example with mask DIO* and read TBL_T9 line based in DIO index

Hope it's helpful

Evgeny

Show 3 Share
10 |10000 characters needed characters left characters exceeded

can you tell me the code

0
DATA: ls_line LIKE LINE OF it_d0_detail,
      lo_strdescr TYPE REF TO cl_abap_structdescr.
           
lo_strdescr = cl_abap_structdescr=>describe_by_data( ls_line ).
LOOP AT lo_strdescr->components ASSIGNING FIELD-SYMBOL(<ls_component>)
  WHERE name CP 'DIO*'.
  lv_index = <ls_component>-name+3.
  ASSIGN COMPONENT <ls_component>-name OF STRUCTURE ls_line TO FIELD-SYMBOL(<lv_target>).
  IF sy-subrc = 0.
    <lv_target> = TBL_T9[ lv_index ]-vbeln.
  ENDIF.
ENDLOOP.

Should be something like this

0

Don't ask for code, links, documents or other material. There are plenty of examples if you will search.

0