Issue with Dynamic Table Access for Copying MOLGA Content Between Tables
Hi @ALL, I’m currently developing a report to copy MOLGA content from one MOLGA to another. I’ve implemented dynamic table access for this, but it’s unable to retrieve the table data. I’ll share the program below, and any assistance would be greatly appreciated. TYPES: BEGIN OF ty_tbl_list, tabname TYPE tabname, END OF ty_tbl_list. DATA: lt_tables TYPE TABLE OF ty_tbl_list, ls_table TYPE ty_tbl_list, lv_src_ctry TYPE land1 VALUE ’06’, ” France lv_tgt_ctry TYPE land1 VALUE ‘MA’. ” Morocco. FIELD-SYMBOLS: <lt_src_data> TYPE STANDARD TABLE, <lt_tgt_data> TYPE STANDARD TABLE, <ls_data> TYPE any, <fs_country> TYPE any, <fs_table> TYPE STANDARD TABLE. START-OF-SELECTION. CLEAR lt_tables. CLEAR ls_table. ” Manually populating the internal table ls_table–tabname = ‘V_T52D1’. APPEND ls_table TO lt_tables. LOOP AT lt_tables INTO ls_table. PERFORM copy_tbl_content USING ls_table–tabname lv_src_ctry lv_tgt_ctry. ENDLOOP. FORM copy_tbl_content USING pv_tabname TYPE tabname pv_src_ctry TYPE land1 pv_tgt_ctry TYPE land1. ASSIGN (pv_tabname) TO <fs_table>.IF sy–subrc <> 0. WRITE: / ‘Table’, pv_tabname, ‘not found’. RETURN.ENDIF. ” Select data from source country SELECT * FROM (pv_tabname) INTO TABLE <lt_src_data> WHERE country = pv_src_ctry. IF <lt_src_data> IS INITIAL. WRITE: / ‘No data found in table’, pv_tabname, ‘for country’, pv_src_ctry. RETURN. ENDIF. …
Issue with Dynamic Table Access for Copying MOLGA Content Between Tables Read More »