Skip to content

Commit

Permalink
Merge pull request #7 from hhelibeb/hhelibeb-patch-1
Browse files Browse the repository at this point in the history
fix_export_issue
  • Loading branch information
hhelibeb authored Oct 12, 2020
2 parents a9d4525 + de677cc commit 1866ceb
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions src/zafl_macros.prog.abap
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ DEFINE /afl/log_init.
IF /afl/config-import = abap_true.
/afl/log_get_json 'I' /afl/log-import.
ENDIF.
IF /afl/config-export = abap_true.
/afl/log_get_json 'E' /afl/log-export.
ENDIF.

IF /afl/config-table_in = abap_true.
/afl/log_get_table_json /afl/log-table_in.
Expand Down Expand Up @@ -87,19 +84,21 @@ DEFINE /afl/log_get_json.
APPEND /afl/comp_wa TO /afl/comp_tab.
ENDLOOP.

/afl/struct_type = cl_abap_structdescr=>create( /afl/comp_tab ).
IF /afl/comp_tab IS NOT INITIAL.
/afl/struct_type = cl_abap_structdescr=>create( /afl/comp_tab ).

CREATE DATA /afl/parameter_data TYPE HANDLE /afl/struct_type.
CREATE DATA /afl/parameter_data TYPE HANDLE /afl/struct_type.

ASSIGN /afl/parameter_data->* TO </afl/parameter_data>.
ASSIGN /afl/parameter_data->* TO </afl/parameter_data>.

LOOP AT /afl/comp_tab ASSIGNING </alf/comp>.
ASSIGN (</alf/comp>-name) TO </afl/parameter>.
ASSIGN COMPONENT </alf/comp>-name OF STRUCTURE </afl/parameter_data> TO </afl/parameter_data_field>.
</afl/parameter_data_field> = </afl/parameter>.
ENDLOOP.
LOOP AT /afl/comp_tab ASSIGNING </alf/comp>.
ASSIGN (</alf/comp>-name) TO </afl/parameter>.
ASSIGN COMPONENT </alf/comp>-name OF STRUCTURE </afl/parameter_data> TO </afl/parameter_data_field>.
</afl/parameter_data_field> = </afl/parameter>.
ENDLOOP.

&2 = /ui2/cl_json=>serialize( data = </afl/parameter_data> ).
&2 = /ui2/cl_json=>serialize( data = </afl/parameter_data> ).
ENDIF.

END-OF-DEFINITION.

Expand Down Expand Up @@ -132,6 +131,10 @@ DEFINE /afl/save .

GET TIME STAMP FIELD /afl/end_time.

IF /afl/config-export = abap_true.
/afl/log_get_json 'E' /afl/log-export.
ENDIF.

/afl/log-time_cost = cl_abap_tstmp=>subtract( tstmp1 = /afl/end_time tstmp2 = /afl/start_time ).

IF /afl/config-table_out = abap_true.
Expand Down Expand Up @@ -159,19 +162,21 @@ DEFINE /afl/log_get_table_json.
APPEND /afl/comp_wa TO /afl/comp_tab.
ENDLOOP.

/afl/struct_type = cl_abap_structdescr=>create( /afl/comp_tab ).
IF /afl/comp_tab IS NOT INITIAL.
/afl/struct_type = cl_abap_structdescr=>create( /afl/comp_tab ).

CREATE DATA /afl/parameter_data TYPE HANDLE /afl/struct_type.
CREATE DATA /afl/parameter_data TYPE HANDLE /afl/struct_type.

ASSIGN /afl/parameter_data->* TO </afl/parameter_data>.
ASSIGN /afl/parameter_data->* TO </afl/parameter_data>.

LOOP AT /afl/comp_tab ASSIGNING </alf/comp>.
true_fieldname = </alf/comp>-name && '[]'.
ASSIGN (true_fieldname) TO </afl/parameter>.
ASSIGN COMPONENT </alf/comp>-name OF STRUCTURE </afl/parameter_data> TO </afl/parameter_data_field>.
</afl/parameter_data_field> = </afl/parameter>.
ENDLOOP.
LOOP AT /afl/comp_tab ASSIGNING </alf/comp>.
true_fieldname = </alf/comp>-name && '[]'.
ASSIGN (true_fieldname) TO </afl/parameter>.
ASSIGN COMPONENT </alf/comp>-name OF STRUCTURE </afl/parameter_data> TO </afl/parameter_data_field>.
</afl/parameter_data_field> = </afl/parameter>.
ENDLOOP.

&1 = /ui2/cl_json=>serialize( data = </afl/parameter_data> ).
&1 = /ui2/cl_json=>serialize( data = </afl/parameter_data> ).
ENDIF.

END-OF-DEFINITION.

0 comments on commit 1866ceb

Please sign in to comment.