Skip to content

Commit b47adec

Browse files
authored
Update xlsx.md
1 parent 480e955 commit b47adec

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

docs/development/xlsx.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The code snippets above are not compatible with ABAP Cloud, modify the lcl_help
179179
:::
180180

181181
#### abap2xlsx
182-
Instead of using the above XLSX API (which may change between releases), consider leveraging the excellent open-source project abap2xlsx. It provides reusable APIs for common XLSX operations and works entirely within the ABAP stack, ensuring seamless integration with abap2UI5. The following example demonstrates using abap2xlsx in the LCL_HELP class:
182+
Instead of using the above XLSX API (which may change between releases), consider leveraging the excellent open-source project [abap2xlsx](https://github.com/abap2xlsx/abap2xlsx). It provides reusable APIs for common XLSX operations and works entirely within the ABAP stack. The following example demonstrates using abap2xlsx in the `LCL_HELP` class:
183183
::: code-group
184184

185185
```abap
@@ -217,18 +217,9 @@ ENDMETHOD.
217217
```
218218

219219
```abap [LCL_HELP]
220-
CLASS lcl_help DEFINITION
221-
FINAL
222-
CREATE PUBLIC .
220+
CLASS lcl_help DEFINITION FINAL CREATE PUBLIC .
223221
224222
PUBLIC SECTION.
225-
226-
CLASS-METHODS get_itab_by_xlsx
227-
IMPORTING
228-
val TYPE string
229-
RETURNING
230-
VALUE(result) TYPE REF TO data.
231-
232223
CLASS-METHODS get_xlsx_by_itab
233224
IMPORTING
234225
val TYPE any
@@ -237,9 +228,7 @@ CLASS lcl_help DEFINITION
237228
238229
ENDCLASS.
239230
240-
241231
CLASS lcl_help IMPLEMENTATION.
242-
243232
METHOD get_xlsx_by_itab.
244233
TRY.
245234
@@ -250,7 +239,6 @@ CLASS lcl_help IMPLEMENTATION.
250239
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
251240
ls_table_settings TYPE zexcel_s_table_settings.
252241
253-
254242
" Creates active sheet
255243
CREATE OBJECT lo_excel.
256244
@@ -277,29 +265,6 @@ CLASS lcl_help IMPLEMENTATION.
277265
z2ui5_cL_util=>x_raise( x->get_text( ) ).
278266
ENDTRY.
279267
ENDMETHOD.
280-
281-
METHOD get_itab_by_xlsx.
282-
TRY.
283-
284-
SPLIT val AT `;` INTO DATA(lv_dummy) DATA(lv_data).
285-
SPLIT lv_data AT `,` INTO lv_dummy lv_data.
286-
DATA(lv_xdata) = z2ui5_cl_util=>conv_decode_x_base64( lv_data ).
287-
288-
DATA: lo_excel TYPE REF TO zcl_excel,
289-
lo_reader TYPE REF TO zif_excel_reader,
290-
lo_worksheet TYPE REF TO zcl_excel_worksheet.
291-
292-
CREATE OBJECT lo_reader TYPE zcl_excel_reader_2007.
293-
lo_excel = lo_reader->load( lv_xdata ).
294-
lo_worksheet = lo_excel->get_worksheet_by_index( 1 ).
295-
lo_worksheet->convert_to_table(
296-
IMPORTING
297-
er_data = result ).
298-
299-
CATCH cx_root INTO DATA(x).
300-
z2ui5_cL_util=>x_raise( x->get_text( ) ).
301-
ENDTRY.
302-
ENDMETHOD.
303268
ENDCLASS.
304269
```
305270
:::

0 commit comments

Comments
 (0)