Skip to content

Commit 4508162

Browse files
authored
Merge pull request #6 from abap2UI5-addons/claude/small-improvements-1j4pdm
Refactor: Code cleanup, bug fixes, and branding updates
2 parents c8ad542 + f52a028 commit 4508162

18 files changed

Lines changed: 89 additions & 121 deletions

.abapgit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
33
<asx:values>
44
<DATA>
5-
<NAME>a2UI5-table-content-loader</NAME>
5+
<NAME>table-content-loader</NAME>
66
<MASTER_LANGUAGE>E</MASTER_LANGUAGE>
77
<STARTING_FOLDER>/src/</STARTING_FOLDER>
88
<FOLDER_LOGIC>PREFIX</FOLDER_LOGIC>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _Supported Formats: JSON, CSV, XLSX..._
1010
#### Compatibility
1111
* S/4 Public Cloud ABAP and BTP ABAP Environment (ABAP for Cloud)
1212
* S/4 Private Cloud or On-Premise (ABAP for Cloud, Standard ABAP)
13-
* R/3 NetWeaver AS ABAP 7.50 or higher (Standard ABAP)
13+
* SAP NetWeaver AS ABAP 7.50 or higher (Standard ABAP)
1414

1515
#### Dependencies
1616
* [abap2UI5](https://github.com/abap2UI5/abap2UI5)
@@ -22,7 +22,7 @@ _Supported Formats: JSON, CSV, XLSX..._
2222
* XLSX Upload/Download for ABAP Cloud
2323

2424
#### Demo
25-
<img width="700" alt="image" src="https://github.com/abap2UI5-apps/table-content-loader/assets/102328295/73e044dc-137d-49fe-b6ac-0247fb542a0f">
25+
<img width="700" alt="Table Content Loader start page with tiles for JSON, CSV and XLSX upload and download" src="https://github.com/abap2UI5-apps/table-content-loader/assets/102328295/73e044dc-137d-49fe-b6ac-0247fb542a0f">
2626

2727
#### Contribution & Support
2828
Pull Requests are welcome! Whether you're fixing a bug, adding new functionality, or improving the documentation, your contributions are always appreciated. If you run into problems, feel free to open an issue.

src/package.devc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
44
<asx:values>
55
<DEVC>
6-
<CTEXT>a2UI5-table-content-loader</CTEXT>
6+
<CTEXT>abap2UI5 - table content loader</CTEXT>
77
</DEVC>
88
</asx:values>
99
</asx:abap>

src/z2ui5_cl_tcl_app_00.clas.abap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CLASS Z2UI5_CL_TCL_APP_00 IMPLEMENTATION.
2828
shownavbutton = abap_true
2929
)->header_content(
3030
)->overflow_toolbar(
31-
)->link( text = 'Project on GitHub' target = '_blank' href = 'https://github.com/abap2ui5-apps/table_content_loader'
31+
)->link( text = 'Project on GitHub' target = '_blank' href = 'https://github.com/abap2UI5-addons/table-content-loader'
3232
)->get_parent( )->get_parent( ).
3333
page = page->vbox( ).
3434
page = page->hbox( ).
@@ -37,25 +37,25 @@ CLASS Z2UI5_CL_TCL_APP_00 IMPLEMENTATION.
3737
header = `JSON`
3838
subheader = `Upload DB Content`
3939
state = 'Disabled'
40-
press = client->_event( `z2ui5_dbl_cl_app_01` )
40+
press = client->_event( `z2ui5_cl_tcl_app_01` )
4141
)->get( )->tile_content(
4242
)->image_content( src = 'sap-icon://upload' ).
4343

4444
page->generic_tile(
4545
class = 'sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout'
4646
header = `JSON`
4747
subheader = `Download DB Content`
48-
press = client->_event( `z2ui5_dbl_cl_app_03` )
48+
press = client->_event( `z2ui5_cl_tcl_app_03` )
4949
)->get( )->tile_content(
5050
)->image_content( src = 'sap-icon://download' ).
5151

52-
page = page->get_parent( )->hbox( ).
52+
page = page->get_parent( )->hbox( ).
5353

5454
page->generic_tile(
5555
class = 'sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout'
5656
header = `CSV`
5757
subheader = `Upload DB Content`
58-
press = client->_event( `z2ui5_file_cl_app_01` )
58+
press = client->_event( `z2ui5_cl_tcl_app_04` )
5959
enablenavigationbutton = abap_false
6060
state = 'Disabled'
6161
)->get( )->tile_content(
@@ -65,7 +65,7 @@ page = page->get_parent( )->hbox( ).
6565
class = 'sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout'
6666
header = `CSV`
6767
subheader = `Download DB Content`
68-
press = client->_event( `z2ui5_file_cl_app_01` )
68+
press = client->_event( `z2ui5_cl_tcl_app_04` )
6969
state = 'Disabled'
7070
)->get( )->tile_content(
7171
)->image_content( src = 'sap-icon://download' ).
@@ -77,15 +77,15 @@ page = page->get_parent( )->hbox( ).
7777
header = `XLSX`
7878
subheader = `Upload DB Content`
7979
state = 'Disabled'
80-
press = client->_event( `z2ui5_dbl_cl_app_05` )
80+
press = client->_event( `z2ui5_cl_tcl_app_05` )
8181
)->get( )->tile_content(
8282
)->image_content( src = 'sap-icon://upload' ).
8383

8484
page->generic_tile(
8585
class = 'sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout'
8686
header = `XLSX`
8787
subheader = `Download DB Content`
88-
press = client->_event( `z2ui5_dbl_cl_app_06` )
88+
press = client->_event( `z2ui5_cl_tcl_app_06` )
8989
)->get( )->tile_content(
9090
)->image_content( src = 'sap-icon://download' ).
9191

src/z2ui5_cl_tcl_app_00.clas.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<VSEOCLASS>
66
<CLSNAME>Z2UI5_CL_TCL_APP_00</CLSNAME>
77
<LANGU>E</LANGU>
8-
<DESCRIPT>db_loader - start page</DESCRIPT>
8+
<DESCRIPT>table content loader - start page</DESCRIPT>
99
<STATE>1</STATE>
1010
<CLSCCINCL>X</CLSCCINCL>
1111
<FIXPT>X</FIXPT>

src/z2ui5_cl_tcl_app_01.clas.abap

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ CLASS z2ui5_cl_tcl_app_01 DEFINITION
2929
METHODS z2ui5_view_display.
3030

3131
PRIVATE SECTION.
32-
DATA mv_db_save_callback TYPE string.
3332
ENDCLASS.
3433

3534

@@ -52,7 +51,7 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
5251
DATA(lo_popup_file) = CAST z2ui5_cl_pop_file_ul( client->get_app( client->get( )-s_draft-id_prev_app ) ).
5352
IF lo_popup_file->result( )-check_confirmed = abap_true.
5453
ms_app-file = lo_popup_file->result( )-value.
55-
client->message_toast_display( `File uploaded sucessfully` ).
54+
client->message_toast_display( `File uploaded successfully` ).
5655
ms_app-file_size = CONV i( ( strlen( ms_app-file ) ) / 1000 ).
5756
client->view_model_update( ).
5857
ENDIF.
@@ -101,7 +100,7 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
101100

102101
client->view_model_update( ).
103102
CATCH cx_root.
104-
client->message_box_display( `DB Table no found, check input: ` && ms_app-db_table ).
103+
client->message_box_display( `DB Table not found, check input: ` && ms_app-db_table ).
105104
ENDTRY.
106105

107106
WHEN `PROCESS`.
@@ -126,11 +125,9 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
126125
ENDTRY.
127126

128127
WHEN `PREVIEW`.
129-
ASSIGN mt_tab->* TO <tab2>.
130128

131129
DATA lr_tab TYPE REF TO data.
132130
DATA lr_dummy TYPE REF TO data.
133-
CREATE DATA lr_tab TYPE STANDARD TABLE OF (ms_app-db_table).
134131

135132
lr_tab = z2ui5_cl_util=>conv_copy_ref_data( mt_tab ).
136133

@@ -144,7 +141,7 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
144141
client->nav_app_call( z2ui5_cl_pop_table=>factory( <tab2> ) ).
145142

146143
WHEN 'DB_SAVE'.
147-
mv_db_save_callback = client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Database will be deleted and new entries filled. Are you sure?`) ).
144+
client->nav_app_call( z2ui5_cl_pop_to_confirm=>factory( `Database will be deleted and new entries filled. Are you sure?` ) ).
148145

149146
WHEN 'UPLOAD'.
150147
client->nav_app_call( z2ui5_cl_pop_file_ul=>factory( ) ).
@@ -172,7 +169,7 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
172169
DATA(view) = z2ui5_cl_xml_view=>factory( ).
173170

174171
DATA(page) = view->shell( appwidthlimited = client->_bind_edit( ms_app-check_appwidthlimited ) )->page(
175-
title = 'a2UI5 App - JSON File Upload'
172+
title = 'abap2UI5 - JSON File Upload'
176173
navbuttonpress = client->_event( 'BACK' )
177174
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
178175
)->header_content(
@@ -183,8 +180,8 @@ CLASS Z2UI5_CL_TCL_APP_01 IMPLEMENTATION.
183180
)->link(
184181
text = 'Project on GitHub'
185182
target = '_blank'
186-
href = `https://github.com/oblomov-dev/a2UI5-db_table_loader`
187-
)->get_parent( )->get_parent( ).
183+
href = `https://github.com/abap2UI5-addons/table-content-loader`
184+
)->get_parent( )->get_parent( ).
188185

189186
DATA(content) = page->simple_form( editable = `true` ).
190187

src/z2ui5_cl_tcl_app_01.clas.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<VSEOCLASS>
66
<CLSNAME>Z2UI5_CL_TCL_APP_01</CLSNAME>
77
<LANGU>E</LANGU>
8-
<DESCRIPT>dbt - upload json</DESCRIPT>
8+
<DESCRIPT>table content loader - json upload</DESCRIPT>
99
<STATE>1</STATE>
1010
<CLSCCINCL>X</CLSCCINCL>
1111
<FIXPT>X</FIXPT>

src/z2ui5_cl_tcl_app_02.clas.abap

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,15 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
159159

160160
METHOD z2ui5_on_render_view_edit.
161161

162-
DATA(page) = Z2UI5_CL_XML_VIEW=>factory( )->shell(
162+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
163163
)->page(
164-
title = 'abap2ui5 - Table Maintenance'
164+
title = 'abap2UI5 - Table Maintenance'
165165
navbuttonpress = client->_event( 'BACK' )
166166
shownavbutton = abap_true
167167
)->header_content(
168168
)->link(
169169
text = 'Demo' target = '_blank'
170170
href = `https://twitter.com/abap2UI5/status/1634206964291911682`
171-
* )->link(
172-
* text = 'Source_Code' target = '_blank'
173-
* href = Z2UI5_CL_XML_VIEW=>hlp_get_source_code_url( app = me )
174171
)->get_parent(
175172
)->sub_header(
176173
)->overflow_toolbar(
@@ -195,7 +192,7 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
195192

196193
grid = page->grid( 'L12 M12 S12' )->content( 'layout' ).
197194

198-
DATA(cont) = grid->simple_form( )->content( 'form' ).
195+
DATA(cont) = grid->simple_form( )->content( 'form' ).
199196

200197
cont->overflow_toolbar(
201198
)->button(
@@ -216,7 +213,7 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
216213

217214
DATA(tab) = scroll->table(
218215
width = '100rem'
219-
items = client->_bind( ms_edit-t_table )
216+
items = client->_bind_edit( ms_edit-t_table )
220217
mode = 'MultiSelect' ).
221218

222219
DATA(lt_fields) = lcl_db=>get_fieldlist_by_table( ms_edit-t_table ).
@@ -247,18 +244,15 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
247244

248245
METHOD z2ui5_on_render_view_export.
249246

250-
DATA(page) = Z2UI5_CL_XML_VIEW=>factory( )->shell(
247+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
251248
)->page(
252-
title = 'abap2ui5 - Table Maintenance'
249+
title = 'abap2UI5 - Table Maintenance'
253250
navbuttonpress = client->_event( 'BACK' )
254251
shownavbutton = abap_true
255252
)->header_content(
256253
)->link(
257254
text = 'Demo'
258255
href = `https://twitter.com/abap2UI5/status/1634206964291911682`
259-
* )->link(
260-
* text = 'Source_Code'
261-
* href = Z2UI5_CL_XML_VIEW=>hlp_get_source_code_url( app = me )
262256
)->get_parent(
263257
)->sub_header(
264258
)->overflow_toolbar(
@@ -281,19 +275,18 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
281275
)->label( 'Table'
282276
)->input( 'SPFLI'
283277
)->label( 'Format'
284-
)->segmented_button( client->_bind( ms_export-segment_key )
278+
)->segmented_button( client->_bind_edit( ms_export-segment_key )
285279
)->items(
286280
)->segmented_button_item( key = 'json' text = 'json'
287281
)->segmented_button_item( key = 'csv' text = 'csv'
288282
)->segmented_button_item( key = 'xml' text = 'xml' ).
289283

290284
grid = page->grid( 'L12 M12 S12' )->content( 'layout' ).
291285

292-
* grid->scroll_container( '75%'
293-
page->code_editor(
294-
type = COND #( WHEN ms_export-segment_key = 'csv' THEN |plain_text| ELSE ms_import-segment_key )
295-
value = client->_bind( ms_export-editor )
296-
editable = abap_false ).
286+
page->code_editor(
287+
type = COND #( WHEN ms_export-segment_key = 'csv' THEN |plain_text| ELSE ms_export-segment_key )
288+
value = client->_bind( ms_export-editor )
289+
editable = abap_false ).
297290

298291
page->footer(
299292
)->overflow_toolbar(
@@ -304,25 +297,22 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
304297
type = 'Emphasized'
305298
icon = 'sap-icon://download-from-cloud' ).
306299

307-
client->view_display( page->get_root( )->xml_get( ) ).
300+
client->view_display( page->get_root( )->xml_get( ) ).
308301

309302
ENDMETHOD.
310303

311304

312305
METHOD z2ui5_on_render_view_import.
313306

314-
DATA(page) = Z2UI5_CL_XML_VIEW=>factory( )->shell(
307+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
315308
)->page(
316309
title = 'abap2UI5 - Table Maintenance'
317310
navbuttonpress = client->_event( 'BACK' )
318-
shownavbutton = abap_true
311+
shownavbutton = abap_true
319312
)->header_content(
320313
)->link(
321314
text = 'Demo'
322315
href = `https://twitter.com/abap2UI5/status/1634206964291911682`
323-
* )->link(
324-
* text = 'Source_Code'
325-
* href = Z2UI5_CL_XML_VIEW=>hlp_get_source_code_url( app = me )
326316
)->get_parent(
327317
)->sub_header(
328318
)->overflow_toolbar(
@@ -345,19 +335,18 @@ CLASS Z2UI5_CL_TCL_APP_02 IMPLEMENTATION.
345335
)->label( 'Table'
346336
)->input( 'SPFLI'
347337
)->label( 'Format'
348-
)->segmented_button( client->_bind( ms_import-segment_key ) )->get(
338+
)->segmented_button( client->_bind_edit( ms_import-segment_key ) )->get(
349339
)->items( )->get(
350340
)->segmented_button_item( key = 'json' text = 'json'
351341
)->segmented_button_item( key = 'csv' text = 'csv'
352342
)->segmented_button_item( key = 'xml' text = 'xml' ).
353343

354344
grid = page->grid( 'L12 M12 S12' )->content( 'layout' ).
355345

356-
* grid->scroll_container( '75%'
357-
page->code_editor(
358-
type = COND #( WHEN ms_import-segment_key = 'csv' THEN |plain_text| ELSE ms_import-segment_key )
359-
value = client->_bind( ms_import-editor )
360-
editable = abap_true ).
346+
page->code_editor(
347+
type = COND #( WHEN ms_import-segment_key = 'csv' THEN |plain_text| ELSE ms_import-segment_key )
348+
value = client->_bind_edit( ms_import-editor )
349+
editable = abap_true ).
361350

362351
page->footer( )->overflow_toolbar(
363352
)->button(

src/z2ui5_cl_tcl_app_02.clas.locals_imp.abap

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ CLASS lcl_db DEFINITION.
77
TYPES ty_t_table TYPE z2ui5_cl_tcl_app_02=>ty_t_table.
88

99
CLASS-DATA app TYPE REF TO z2ui5_cl_tcl_app_02.
10-
"CLASS-DATA st_table TYPE ty_t_table.
11-
12-
CLASS-METHODS generate_test_data.
1310

1411
CLASS-METHODS get_table_by_json
1512
IMPORTING
@@ -71,22 +68,6 @@ ENDCLASS.
7168

7269
CLASS lcl_db IMPLEMENTATION.
7370

74-
METHOD generate_test_data.
75-
76-
app->st_db = VALUE #(
77-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
78-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
79-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
80-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
81-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
82-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
83-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
84-
( carrid = 'DL' connid = '0106' countryfr = 'US' cityfrom = 'NEW YORK' airpfrom = 'JFK' countryto = 'DE' cityto = 'FRANKFURT' airpto = 'FR' )
85-
).
86-
87-
ENDMETHOD.
88-
89-
9071
METHOD get_table_by_json.
9172

9273
z2ui5_cl_util=>json_parse( EXPORTING val = val

src/z2ui5_cl_tcl_app_02.clas.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<VSEOCLASS>
66
<CLSNAME>Z2UI5_CL_TCL_APP_02</CLSNAME>
77
<LANGU>E</LANGU>
8-
<DESCRIPT>dbt - view/edit/download</DESCRIPT>
8+
<DESCRIPT>table content loader - view/edit/download</DESCRIPT>
99
<STATE>1</STATE>
1010
<CLSCCINCL>X</CLSCCINCL>
1111
<FIXPT>X</FIXPT>

0 commit comments

Comments
 (0)