Code: Alles auswählen.
CALL METHOD zsit_sm_task_controller=>s_get_all_params
EXPORTING
iv_type = 'ZSIT_LE'
IMPORTING
et_param_list = lt_param_list.
loop at lt_param_list into ls_param_list.
ls_fieldcatalog-DATATYPE = ls_param_list-param_type.
ls_fieldcatalog-FIELDNAME = ls_param_list-param_name.
append ls_fieldcatalog to lt_fieldcatalog.
endloop.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = lt_fieldcatalog
IMPORTING
EP_TABLE = new_table
EXCEPTIONS
generate_subpool_dir_full = 1
others = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ASSIGN new_table->* TO <my_table>.
eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( <my_table> ).
Code: Alles auswählen.
cl_alv_table_create=>create_dynamic_table(
EXPORTING
it_fieldcatalog = lt_fieldcat
IMPORTING
ep_table = lo_table ).
Code: Alles auswählen.
eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( lo_table ).
meinst du so:jensschladitz hat geschrieben:Sali,
als die Variable LO_TABLE ist die Referenz auf die neue interne Tabelle und diese ist zugewiesen, so dass ein assign auf ein Feldsymbol vom Type any table problemlos klappt, dann dort die Daten/ Werte reinschreiben und schon klappt es - zumindest bei mir
Gruss
Code: Alles auswählen.
ASSIGN LO_TABLE->* TO <my_table>.
eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( <my_table> ).
nein... CL_ABAP_STRUCTDESCRa-dead-trousers hat geschrieben:Von welchem Typ ist die Variable "eo_field_catalog"?
Doch hoffentlich CL_ABAP_TABLEDESCR.
Code: Alles auswählen.
new_table Typ Ref to Data
Code: Alles auswählen.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = new_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
Meinst du sowas:Trulchen hat geschrieben:Aber ich weiß nicht wie ich meinein eine Struktur bekomme....Code: Alles auswählen.
new_table Typ Ref to Data
Code: Alles auswählen.
data: lr_line type ref to data.
field-symbols: <la_line> type any.
create data lr_line like line of <lt_table>.
assign lr_line->* to <la_line>.
Code: Alles auswählen.
field-symbols: <la_line> type any.
loop at <lt_table> assigning <la_line>.
...
endloop.
jensschladitz hat geschrieben:Sali,
... und wie gelöst ( kurze Info oder so ) - vieleicht interessant für Nachfolgende![]()
Gruss
Code: Alles auswählen.
CALL METHOD zsit_sm_task_controller=>s_get_all_params
EXPORTING
iv_type = 'ZSIT_LE'
IMPORTING
et_param_list = lt_param_list.
LOOP AT lt_param_list INTO ls_param_list.
ls_fieldcatalog-fieldname = ls_param_list-param_name.
ls_fieldcatalog-datatype = ls_param_list-param_type.
APPEND ls_fieldcatalog TO lt_fieldcatalog.
ENDLOOP.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = new_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN new_table->* TO <f_tab>.
INSERT INITIAL LINE INTO TABLE <f_tab>.
LOOP AT <f_tab> ASSIGNING <fs_any>.
EXIT.
ENDLOOP.
eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( <fs_any> ).