Code Example for a LIST ImplementationThis is an example for the implementation of a LIST for payroll results, where the RGDIR
structure is also extended manually with the fields P0002-NACHN
and -MAXBT
.
Note
If you have no need of such extensions of an existing structure, use the example of the form implementation, where the service CL_HRESS_FPM_GUIBB_SERVICES- > get_guibbf_definition_dstruc
does a lot of the work for you.
Syntax
METHOD if_fpm_guibb_list~get_definition. DATA: lo_table_descr TYPE REF TO cl_abap_tabledescr, lo_struc_descr TYPE REF TO cl_abap_structdescr, lt_component_tab TYPE cl_abap_structdescr=>component_table, lt_rgdir TYPE h99_clst_t_rgdir, ls_component_wa TYPE abap_componentdescr.
* call super method, because it is the done thing. super->if_fpm_guibb_form~get_definition( IMPORTING es_message = es_message eo_field_catalog = eo_field_catalog et_field_description = et_field_description et_action_definition = et_action_definition et_special_groups = et_special_groups ev_additional_error_info = ev_additional_error_info ).
* getting the field catalog for remuneration statement***
* 1 Get the line type from the table* 2 Get the table of components from the line type* 3 Add a component to the table of components* 4 Create a new (expanded) structure* 5 Create a new table typed with the new (expanded) structure
lo_table_descr ?= cl_abap_tabledescr=>describe_by_name( 'H99_CLST_T_RGDIR' ). lo_struc_descr ?= lo_table_descr->get_table_line_type( ). lt_component_tab = lo_struc_descr->get_components( ). ls_component_wa-name = 'NAME'. ls_component_wa-type ?= cl_abap_datadescr=>describe_by_name( 'P0002- NACHN' ). ls_component_wa-as_include = abap_false. APPEND ls_component_wa TO lt_component_tab. ls_component_wa-name = 'BETRG'. ls_component_wa-type ?= cl_abap_datadescr=>describe_by_name( 'MAXBT' ). ls_component_wa-as_include = abap_false. APPEND ls_component_wa TO lt_component_tab.
CLEAR: lo_struc_descr. lo_struc_descr ?= cl_abap_structdescr=>get( lt_component_tab ).
eo_field_catalog ?= cl_abap_tabledescr=>get( lo_struc_descr ).Endmethod.