Code: Alles auswählen.
LOOP AT d_it_gesamt.
DATA it_fieldcatalog TYPE lvc_t_fcat.
DATA wa_fcat TYPE lvc_s_fcat.
DATA wa_fieldcat TYPE lvc_s_fcat.
DATA: puff_field(30) TYPE c,
puff_intyp(1) TYPE c,
puff_ileng(6) TYPE n,
puff_ddtyp(4) TYPE c,
puff_oleng(6) TYPE n.
DATA ep_table TYPE REF TO data.
DATA: counter1 TYPE i.
DATA: wa_tab1 TYPE REF TO data.
FIELD-SYMBOLS: <my_table> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <wa_tabl2> TYPE ANY.
FIELD-SYMBOLS: <struct>.
FIELD-SYMBOLS: <feld>.
SELECT fieldname inttype intlen datatype leng
INTO (puff_field, puff_intyp, puff_ileng, puff_ddtyp, puff_oleng)
FROM dd03l WHERE tabname = d_it_gesamt-tabel
AND keyflag = 'X'.
IF counter1 < 99.
IF NOT puff_field = 'JOBNAME'.
wa_fcat-fieldname = puff_field.
wa_fcat-inttype = puff_intyp.
wa_fcat-intlen = puff_ileng.
wa_fcat-datatype = puff_ddtyp.
* wa_fcat-outputlen = puff_oleng.
APPEND wa_fcat TO it_fieldcatalog.
counter1 = counter1 + 1.
ENDIF.
ENDIF.
ENDSELECT.
SELECT SINGLE fieldname inttype intlen datatype leng
INTO (puff_field, puff_intyp, puff_ileng, puff_ddtyp, puff_oleng)
FROM dd03l WHERE tabname = d_it_gesamt-tabel
AND fieldname = d_it_gesamt-field.
wa_fcat-fieldname = puff_field.
wa_fcat-inttype = puff_intyp.
wa_fcat-intlen = puff_ileng.
wa_fcat-datatype = puff_ddtyp.
wa_fcat-outputlen = puff_oleng.
APPEND wa_fcat TO it_fieldcatalog.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcatalog
IMPORTING
ep_table = ep_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN ep_table->* TO <my_table>.
CREATE DATA wa_tab1 LIKE LINE OF <my_table>.
ASSIGN wa_tab1->* TO <wa_tabl2>.
LOOP AT <my_table> ASSIGNING <struct>.
LOOP AT it_fieldcatalog INTO wa_fcat.
ASSIGN COMPONENT wa_fcat-fieldname OF STRUCTURE <struct> TO <feld>.
* <feld> = '123456'.
* APPEND <struct> TO <my_table>.
ENDLOOP.
ENDLOOP.
REFRESH d_it_data.
LOOP AT it_fieldcatalog INTO wa_fieldcat.
d_zw_data = wa_fieldcat-fieldname.
APPEND d_zw_data TO d_it_data.
ENDLOOP.
SELECT (d_it_data) FROM (d_it_gesamt-tabel)
INTO TABLE <my_table>.
LOOP AT <my_table> INTO <wa_tabl2>.
WRITE <wa_tabl2>.
* UPDATE ?????
ENDLOOP.
REFRESH it_fieldcatalog.
REFRESH <my_table>.
ENDLOOP.
Code: Alles auswählen.
REFRESH d_it_data.
CONCATENATE d_it_gesamt-field ' = ''' d_it_gesamt-print '''' INTO
where_clause.
APPEND where_clause TO d_it_data.
SELECT * FROM (d_it_gesamt-tabel)
INTO CORRESPONDING FIELDS OF TABLE <my_table>
WHERE (d_it_data).
LOOP AT <my_table> INTO <wa_tabl2>.
MOVE prin_new TO <wa_tabl2>+count_dd(4).
UPDATE (d_it_gesamt-tabel) FROM <wa_tabl2>.
IF NOT ret_sub = 4.
ret_sub = sy-subrc.
ENDIF.
ENDLOOP.