This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATA: lt_fields TYPE ddfields. | |
| lt_fields = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( 'SFLIGHT' ) )->get_ddic_fields( ). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Goal: find the maximum value among all "some_value" fields in itab "lt_itab". | |
| DATA lv_maximum_value = abap_bool. | |
| lv_maximum_value = REDUCE #( INIT max = value #( ) | |
| FOR entry in lt_itab | |
| NEXT max = COND #( WHEN entry-some_value > max | |
| THEN entry-some_value | |
| ELSE max ) ). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATA: lv_json_final TYPE string, | |
| lv_json_file_entry TYPE string, | |
| lv_json_component TYPE string. | |
| DATA: lo_type_def TYPE REF TO cl_abap_typedescr. | |
| DATA: lo_struct_def TYPE REF TO cl_abap_structdescr. | |
| DATA: lo_table_def TYPE REF TO cl_abap_tabledescr. | |
| DATA: lo_data_def TYPE REF TO cl_abap_datadescr. | |
| DATA: lo_element_def TYPE REF TO cl_abap_elemdescr. | |
| DATA: lt_components TYPE abap_compdescr_tab. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * This is a nice and quick way for uploading the content of a multi-sheet Excel file. | |
| CLASS lcl_main DEFINITION. | |
| PUBLIC SECTION. | |
| TYPES: tt_spreadsheet_by_sheetname TYPE STANDARD TABLE OF if_mass_spreadsheet_types=>s_spreadsheet_by_sheetname WITH DEFAULT KEY. | |
| CLASS-METHODS: get_data_from_excel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * SALV IDA is great for displaying contents of database tables. Here I had a request to display content of a database table | |
| * (like in se16n) with restrictions that users apply on selection screen. | |
| " method declaration: | |
| METHODS: | |
| process_display | |
| IMPORTING | |
| it_lifnr TYPE lif_types~tt_lifnr_range | |
| it_xblnr TYPE lif_types~tt_xblnr_range | |
| it_lblni TYPE lif_types~tt_lblni_range. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATA: | |
| lo_salv TYPE REF TO cl_salv_table, "ALV object | |
| lo_columns TYPE REF TO cl_salv_columns. "columns of ALV object | |
| INCLUDE <color>. "user-friendly color names | |
| TRY. | |
| cl_salv_table=>factory( | |
| IMPORTING | |
| r_salv_table = lo_salv |