Skip to content

Commit

Permalink
data sample update (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev authored Apr 23, 2024
1 parent 7a7e4b7 commit da47401
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/z2ui5_cl_demo_app_192.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ CLASS z2ui5_cl_demo_app_192 DEFINITION PUBLIC.
value TYPE string,
tabname TYPE char30,
comp TYPE abap_componentdescr,
END OF ty_S_key_value,
END OF ty_s_key_value,
ty_t_key_values TYPE STANDARD TABLE OF ty_s_key_value WITH EMPTY KEY.

TYPES: BEGIN OF ty_s_merged_Data,
TYPES: BEGIN OF ty_s_merged_data,
t_kopf TYPE REF TO data,
t_pos TYPE REF TO data,
t_keyva TYPE ty_T_KEY_VALUEs,
END OF ty_S_merged_Data,
ty_t_merged_Data TYPE STANDARD TABLE OF ty_s_merged_Data WITH EMPTY KEY.
t_keyva TYPE ty_t_key_values,
END OF ty_s_merged_data,
ty_t_merged_data TYPE STANDARD TABLE OF ty_s_merged_data WITH EMPTY KEY.

DATA mt_new_data TYPE ty_t_merged_data.
* DATA mt_new_data TYPE ty_t_merged_data.

DATA mt_new_data2 TYPE STANDARD TABLE OF REF TO z2ui5_cl_demo_app_193 WITH EMPTY KEY.

TYPES:
BEGIN OF ty_s_out,
Expand Down Expand Up @@ -70,10 +72,12 @@ CLASS z2ui5_cl_demo_app_192 IMPLEMENTATION.
METHOD z2ui5_if_app~main.

me->client = client.
get_data( ).
ui5_display( ).

get_DATA( ).
* DATA(lv_stringify) = z2ui5_cl_util_api=>xml_srtti_stringify( data = mt_new_data2 ).

ui5_display( ).
* DATA(lr_result) = z2ui5_cl_util_api=>xml_srtti_parse( rtti_data = lv_stringify ).

ENDMETHOD.

Expand All @@ -93,16 +97,19 @@ CLASS z2ui5_cl_demo_app_192 IMPLEMENTATION.

LOOP AT kopf->* ASSIGNING <fs_s_head>.

APPEND INITIAL LINE TO mt_new_data ASSIGNING FIELD-SYMBOL(<fs_s_new_data>).
* APPEND INITIAL LINE TO mt_new_data ASSIGNING FIELD-SYMBOL(<fs_s_new_data>).
DATA(lo_new_data) = NEW z2ui5_cl_demo_app_193( ).
INSERT lo_new_data INTO TABLE mt_new_data2.

lr_structdescr ?= cl_abap_structdescr=>describe_by_data( <fs_s_head> ).
lr_tabdescr ?= cl_abap_tabledescr=>create( p_line_type = lr_structdescr ).

CREATE DATA <fs_s_new_data>-t_kopf TYPE HANDLE lr_tabdescr.
ASSIGN <fs_s_new_data>-t_kopf->* TO <fs_t_head_new>.
CREATE DATA lo_new_data->mt_kopf TYPE HANDLE lr_tabdescr.
ASSIGN lo_new_data->mt_kopf->* TO <fs_t_head_new>.

APPEND INITIAL LINE TO <fs_t_head_new> ASSIGNING <fs_s_head_new>.
<fs_s_head> = CORRESPONDING #( <fs_s_head_new> ).
<fs_s_head_new> = CORRESPONDING #( <fs_s_head> ).
* <fs_s_head> = CORRESPONDING #( <fs_s_head_new> ).

ENDLOOP.

Expand Down
23 changes: 23 additions & 0 deletions src/z2ui5_cl_demo_app_192.clas.locals_imp.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations
class lcl_merged_data DEFINITION.

PUBLIC SECTION.

TYPES: BEGIN OF ty_s_key_value,
fname TYPE char30,
value TYPE string,
tabname TYPE char30,
comp TYPE abap_componentdescr,
END OF ty_s_key_value,
ty_t_key_values TYPE STANDARD TABLE OF ty_s_key_value WITH EMPTY KEY.

TYPES: BEGIN OF ty_s_merged_data,
t_kopf TYPE REF TO data,
t_pos TYPE REF TO data,
t_keyva TYPE ty_t_key_values,
END OF ty_s_merged_data.


endclass.
26 changes: 26 additions & 0 deletions src/z2ui5_cl_demo_app_193.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CLASS z2ui5_cl_demo_app_193 DEFINITION PUBLIC.

PUBLIC SECTION.

TYPES:
BEGIN OF ty_s_key_value,
fname TYPE char30,
value TYPE string,
tabname TYPE char30,
comp TYPE abap_componentdescr,
END OF ty_s_key_value,
ty_t_key_values TYPE STANDARD TABLE OF ty_s_key_value WITH EMPTY KEY.

DATA:
mt_kopf TYPE REF TO data,
mt_pos TYPE REF TO data,
mt_keyva TYPE ty_t_key_values.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS z2ui5_cl_demo_app_193 IMPLEMENTATION.


ENDCLASS.
23 changes: 23 additions & 0 deletions src/z2ui5_cl_demo_app_193.clas.locals_imp.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations
class lcl_merged_data DEFINITION.

PUBLIC SECTION.

TYPES: BEGIN OF ty_s_key_value,
fname TYPE char30,
value TYPE string,
tabname TYPE char30,
comp TYPE abap_componentdescr,
END OF ty_s_key_value,
ty_t_key_values TYPE STANDARD TABLE OF ty_s_key_value WITH EMPTY KEY.

TYPES: BEGIN OF ty_s_merged_data,
t_kopf TYPE REF TO data,
t_pos TYPE REF TO data,
t_keyva TYPE ty_t_key_values,
END OF ty_s_merged_data.


endclass.
16 changes: 16 additions & 0 deletions src/z2ui5_cl_demo_app_193.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_193</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>data container</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

0 comments on commit da47401

Please sign in to comment.