Необходимо в одном отчете передать в MEMORY ID, а в другом считать из MEMORY ID таблицу, тип которой определяется динамически.
в 4.6С работал такой код
REPORT ZEXPORT.
Code:
data: lt_ru_export type table of zias_s_zruficubea_virt.
free memory id 'ZIAS_DT'.
assign lt_ru_export to <fs_virtual_records>.
export <fs_virtual_records> to memory id 'ZIAS_DT'.
REPORT ZIMPORT.
Code:
data:
end of wa_sidata_extended
, l_struct_name type tabname
, lt_fcat type lvc_t_fcat
, lt_virtual_records type ref to data
, lt_record_variants like wa_sidata_extended
occurs 1
, wa_sidata_extended_tmp like wa_sidata_extended
.
field-symbols: <fs_virtual_records> type table
, <wa_virtual_records> type any
, <field_s> type any
, <field_d> type any
, <wa_fcat> type lvc_s_fcat
.
concatenate 'ZIAS_S_'
l_ntabname
'_VIRT'
into l_struct_name.
refresh lt_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = l_struct_name
changing
ct_fieldcat = lt_fcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = lt_fcat[]
importing
ep_table = lt_virtual_records
exceptions
generate_subpool_dir_full = 1
others = 2.
assign lt_virtual_records->*
to <fs_virtual_records>.
import <fs_virtual_records> from memory
id 'ZIAS_DT'.
loop at <fs_virtual_records>
assigning <wa_virtual_records>.
endloop.
Имя структуры при импорте считаем известным, но может быть разным.
В ERP 6.0 падает в дамп при import <fs_virtual_records> from memory id 'ZIAS_DT'.
Цитата:
Динамическая ошибка CONNE_IMPORT_WRONG_STRUCTURE
...
When attempting to import data, the
structure of the complex object "<FS_VIRTUAL_RECORDS>" was not compatible with
the
target object. The error occurred with component no. 3.
Типы при этом одинаковые, перепроверял.
Посоветуйте, как реализовать такую задачку?