Show TOC

Syntax documentationCode Example for a LIST Implementation

This 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 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.

End of the note.

Syntax Syntax

  1. METHOD if_fpm_guibb_list~get_definition.
  2. 	DATA: lo_table_descr    TYPE REF TO cl_abap_tabledescr,
  3. 		lo_struc_descr    TYPE REF TO cl_abap_structdescr,
  4. 		lt_component_tab  TYPE cl_abap_structdescr=>component_table,
  5. 		lt_rgdir          TYPE h99_clst_t_rgdir,
  6. 		ls_component_wa   TYPE abap_componentdescr.
    
  7. * call super method, because it is the done thing.
  8. 	super->if_fpm_guibb_form~get_definition(
  9. 		IMPORTING
  10. 			es_message               = es_message
  11. 			eo_field_catalog         = eo_field_catalog
  12. 			et_field_description     = et_field_description
  13. 			et_action_definition     = et_action_definition
  14. 			et_special_groups        = et_special_groups
  15. 			ev_additional_error_info = ev_additional_error_info ).
    
  16. * getting the field catalog for remuneration statement***
    
  17. * 1 Get the line type from the table
  18. * 2 Get the table of components from the line type
  19. * 3 Add a component to the table of components
  20. * 4 Create a new (expanded) structure
  21. * 5 Create a new table typed with the new (expanded) structure
    
  22. 	lo_table_descr ?= cl_abap_tabledescr=>describe_by_name( 
  23. 							'H99_CLST_T_RGDIR' ).
  24. 	lo_struc_descr ?= lo_table_descr->get_table_line_type( ).
  25. 	lt_component_tab = lo_struc_descr->get_components( ).
  26. 	ls_component_wa-name = 'NAME'.
  27. 	ls_component_wa-type ?= cl_abap_datadescr=>describe_by_name( 'P0002-
  28. 							NACHN' ).
  29. 	ls_component_wa-as_include = abap_false.
  30. 	APPEND ls_component_wa TO lt_component_tab.
  31. 	ls_component_wa-name = 'BETRG'.
  32. 	ls_component_wa-type ?= cl_abap_datadescr=>describe_by_name( 'MAXBT' 
  33. 							).
  34. 	ls_component_wa-as_include = abap_false.
  35. 	APPEND ls_component_wa TO lt_component_tab.
    
  36. 	CLEAR: lo_struc_descr.
  37. 	lo_struc_descr ?= cl_abap_structdescr=>get( lt_component_tab ).
    
  38. 	eo_field_catalog ?= cl_abap_tabledescr=>get( lo_struc_descr ).
  39. Endmethod.
End of the code.