FIELD-SYMBOLS:
DATA: is_lvc_cat TYPE lvc_s_fcat,
it_lvc_cat TYPE lvc_t_fcat.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data.
START-OF-SELECTION.
is_lvc_cat-fieldname = 'KUNNR'.
APPEND is_lvc_cat TO it_lvc_cat.
is_lvc_cat-fieldname = 'NAME1'.
APPEND is_lvc_cat TO it_lvc_cat.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_lvc_cat
IMPORTING
ep_table = new_table.
*Create a new Line with the same structure of the table.
ASSIGN new_table->* TO
CREATE DATA new_line LIKE LINE OF
ASSIGN new_line->* TO
DO 2 TIMES.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE
ASSIGN COMPONENT 'NAME1' OF STRUCTURE
INSERT
ENDDO.
LOOP AT
WRITE:/
ENDLOOP.
READ TABLE
MODIFY
LOOP AT
WRITE:/
ENDLOOP.
No comments:
Post a Comment