Skip to content

Commit 019feb9

Browse files
authored
Merge pull request #4 from abap2UI5-addons/claude/small-improvements-1j4pdm
Code cleanup: standardize quotes, fix typos, and improve formatting
2 parents 13752e6 + 8c35d88 commit 019feb9

19 files changed

Lines changed: 159 additions & 216 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-selection-screen</NAME>
5+
<NAME>selection-screen</NAME>
66
<MASTER_LANGUAGE>E</MASTER_LANGUAGE>
77
<STARTING_FOLDER>/src/</STARTING_FOLDER>
88
<FOLDER_LOGIC>PREFIX</FOLDER_LOGIC>

.github/workflows/ABAP_CLOUD.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
node-version: 22
1919
- run: npm ci
20-
- run: npx abaplint .github/abaplint/abap_cloud.jsonc
20+
- run: npx abaplint .github/abaplint/abap_cloud.jsonc

.github/workflows/ABAP_STANDARD.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
node-version: 22
1919
- run: npm ci
20-
- run: npx abaplint ./abaplint.jsonc
20+
- run: npx abaplint ./abaplint.jsonc

.github/workflows/rename_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
node-version: 22
1919
- run: npm ci
20-
- run: npm run rename
20+
- run: npm run rename

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
node_modules
1+
node_modules

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# selection-screen
77

88
#### Key Features
9-
* Ranges, Filter, Selection-Screens
9+
* Ranges, Filters, Selection-Screens
1010
* Persist Variants
11-
11+
1212
#### Compatibility
1313
* S/4 Public Cloud and BTP ABAP Environment (ABAP for Cloud)
1414
* S/4 Private Cloud or On-Premise (ABAP for Cloud, Standard ABAP)
15-
* R/3 NetWeaver AS ABAP 7.50 or higher (Standard ABAP)
15+
* SAP NetWeaver AS ABAP 7.50 or higher (Standard ABAP)
1616

1717
#### Dependencies
1818
* [abap2UI5](https://github.com/abap2UI5/abap2UI5)

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"description": "Selection-Screens, Ranges, Filter and Variant Management for abap2UI5.",
66
"scripts": {
77
"syfixes": "find . -type f -name '*.abap' -exec sed -i -e 's/ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found/ ASSERT 1 = 0/g' {} + ",
8-
"downport": "abaplint --fix .github/abaplint/abap_702.jsonc && npm run syfixes",
98
"rename": "abaplint .github/abaplint/rename.json --rename"
109
},
1110
"repository": {

src/00/z2ui5_cl_sel_sample_01.clas.abap

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ CLASS z2ui5_cl_sel_sample_01 DEFINITION PUBLIC.
1717
PROTECTED SECTION.
1818
PRIVATE SECTION.
1919

20-
2120
ENDCLASS.
2221

2322

@@ -31,7 +30,7 @@ CLASS z2ui5_cl_sel_sample_01 IMPLEMENTATION.
3130
set_data( ).
3231
client->view_model_update( ).
3332

34-
WHEN 'BACK'.
33+
WHEN `BACK`.
3534
client->nav_app_leave( ).
3635

3736
ENDCASE.
@@ -55,28 +54,27 @@ CLASS z2ui5_cl_sel_sample_01 IMPLEMENTATION.
5554
DATA(view) = z2ui5_cl_xml_view=>factory( ).
5655

5756
view = view->shell( )->page( id = `page_main`
58-
title = 'abap2UI5 - Select-Options'
59-
navbuttonpress = client->_event( 'BACK' )
57+
title = `abap2UI5 - Select-Options`
58+
navbuttonpress = client->_event( `BACK` )
6059
shownavbutton = client->check_app_prev_stack( ) ).
6160

6261
DATA(vbox) = view->vbox( ).
6362

64-
DATA(lo_panel) = vbox->panel(
65-
expandable = abap_true
66-
expanded = client->_bind_edit( mv_expanded )
67-
headertext = |Selection Screen|
68-
).
63+
DATA(lo_panel) = vbox->panel( expandable = abap_true
64+
expanded = client->_bind_edit( mv_expanded )
65+
headertext = `Selection Screen` ).
6966

70-
mo_multiselect->set_output( client = client view = lo_panel ).
67+
mo_multiselect->set_output( client = client
68+
view = lo_panel ).
7169

7270
ASSIGN mr_table->* TO FIELD-SYMBOL(<table>).
7371
DATA(tab) = vbox->table( client->_bind( <table> )
7472
)->header_toolbar(
75-
)->overflow_toolbar(
76-
)->toolbar_spacer(
77-
)->button( text = `Go`
78-
press = client->_event( `BUTTON_START` )
79-
type = `Emphasized`
73+
)->overflow_toolbar(
74+
)->toolbar_spacer(
75+
)->button( text = `Go`
76+
press = client->_event( `BUTTON_START` )
77+
type = `Emphasized`
8078
)->get_parent( )->get_parent( ).
8179

8280
DATA(lo_columns) = tab->columns( ).
@@ -114,14 +112,11 @@ CLASS z2ui5_cl_sel_sample_01 IMPLEMENTATION.
114112

115113
ENDMETHOD.
116114

117-
118115
METHOD on_init.
119116

120117
mr_table = z2ui5_cl_util=>rtti_create_tab_by_name( mv_tabname ).
121-
mo_multiselect = z2ui5_cl_sel_multisel=>factory_by_name(
122-
val = mv_tabname
123-
s_variant = value #( handle01 = 'TEST' )
124-
).
118+
mo_multiselect = z2ui5_cl_sel_multisel=>factory_by_name( val = mv_tabname
119+
s_variant = VALUE #( handle01 = `TEST` ) ).
125120

126121
view_display( ).
127122

src/00/z2ui5_cl_sel_sample_02.clas.abap

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ CLASS z2ui5_cl_sel_sample_02 DEFINITION PUBLIC.
1515
END OF ty_s_tab.
1616
TYPES ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY.
1717

18-
DATA mt_table TYPE ty_t_table.
18+
DATA mt_table TYPE ty_t_table.
1919
DATA mo_variant TYPE REF TO z2ui5_cl_sel_multisel_pop.
20-
* DATA mt_filter TYPE z2ui5_cl_util=>ty_t_filter_multi.
2120

2221
PROTECTED SECTION.
2322
DATA client TYPE REF TO z2ui5_if_client.
24-
DATA mv_check_initialized TYPE abap_bool.
23+
2524
METHODS on_event.
2625
METHODS view_display.
2726
METHODS set_data.
@@ -41,15 +40,7 @@ CLASS z2ui5_cl_sel_sample_02 IMPLEMENTATION.
4140
client->view_model_update( ).
4241
WHEN `PREVIEW_FILTER`.
4342
client->nav_app_call( mo_variant ).
44-
* z2ui5_cl_sel_multisel_pop=>factory(
45-
* val = mt_filter
46-
** check_db_active = abap_true
47-
** var_check_user = abap_true
48-
* var_handle1 = 'TEST_POP'
49-
** var_handle2 =
50-
** var_handle3 =
51-
* ) ).
52-
WHEN 'BACK'.
43+
WHEN `BACK`.
5344
client->nav_app_leave( ).
5445
ENDCASE.
5546

@@ -59,12 +50,12 @@ CLASS z2ui5_cl_sel_sample_02 IMPLEMENTATION.
5950
METHOD set_data.
6051

6152
mt_table = VALUE #(
62-
( product = 'table' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
63-
( product = 'chair' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
64-
( product = 'sofa' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
65-
( product = 'computer' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
66-
( product = 'oven' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
67-
( product = 'table2' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) ).
53+
( product = `table` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
54+
( product = `chair` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
55+
( product = `sofa` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
56+
( product = `computer` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
57+
( product = `oven` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 )
58+
( product = `table2` create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) ).
6859

6960
z2ui5_cl_util=>filter_itab(
7061
EXPORTING
@@ -79,21 +70,23 @@ CLASS z2ui5_cl_sel_sample_02 IMPLEMENTATION.
7970

8071
DATA(view) = z2ui5_cl_xml_view=>factory( ).
8172

82-
view = view->shell( )->page( id = `page_main`
83-
title = 'abap2UI5 - Select-Options'
84-
navbuttonpress = client->_event( 'BACK' )
85-
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
86-
).
73+
view = view->shell( )->page( id = `page_main`
74+
title = `abap2UI5 - Select-Options`
75+
navbuttonpress = client->_event( `BACK` )
76+
shownavbutton = client->check_app_prev_stack( ) ).
8777

8878
DATA(vbox) = view->vbox( ).
8979

90-
DATA(tab) = vbox->table(
91-
items = client->_bind( val = mt_table )
80+
DATA(tab) = vbox->table( items = client->_bind( val = mt_table )
9281
)->header_toolbar(
93-
)->overflow_toolbar(
94-
)->toolbar_spacer(
95-
)->button( text = `Filter` press = client->_event( `PREVIEW_FILTER` ) icon = `sap-icon://filter`
96-
)->button( text = `Go` press = client->_event( `BUTTON_START` ) type = `Emphasized`
82+
)->overflow_toolbar(
83+
)->toolbar_spacer(
84+
)->button( text = `Filter`
85+
press = client->_event( `PREVIEW_FILTER` )
86+
icon = `sap-icon://filter`
87+
)->button( text = `Go`
88+
press = client->_event( `BUTTON_START` )
89+
type = `Emphasized`
9790
)->get_parent( )->get_parent( ).
9891

9992
DATA(lo_columns) = tab->columns( ).
@@ -121,10 +114,8 @@ CLASS z2ui5_cl_sel_sample_02 IMPLEMENTATION.
121114

122115
IF client->check_on_init( ).
123116

124-
mo_variant = z2ui5_cl_sel_multisel_pop=>factory_by_data(
125-
data = mt_table
126-
var_handle1 = 'TEST_POP'
127-
).
117+
mo_variant = z2ui5_cl_sel_multisel_pop=>factory_by_data( data = mt_table
118+
var_handle1 = `TEST_POP` ).
128119
set_data( ).
129120
view_display( ).
130121
RETURN.

src/00/z2ui5_cl_sel_sample_03.clas.abap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CLASS z2ui5_cl_sel_sample_03 DEFINITION
22
PUBLIC
33
FINAL
4-
CREATE PUBLIC .
4+
CREATE PUBLIC.
55

66
PUBLIC SECTION.
77
INTERFACES z2ui5_if_app.
@@ -16,7 +16,6 @@ CLASS z2ui5_cl_sel_sample_03 DEFINITION
1616
DATA client TYPE REF TO z2ui5_if_client.
1717
PRIVATE SECTION.
1818

19-
2019
ENDCLASS.
2120

2221

@@ -66,7 +65,7 @@ CLASS z2ui5_cl_sel_sample_03 IMPLEMENTATION.
6665

6766
CASE client->get( )-event.
6867

69-
WHEN 'ABC'.
68+
WHEN `ABC`.
7069

7170
ENDCASE.
7271

0 commit comments

Comments
 (0)