ALV show should be possible with the ALV Grid using HR_DISPLAY_BASIC_LIST.
A little program to investigate the fundamentals of this FM.
TABLES: ALV Grid using HR_DISPLAY_BASIC_LIST
marc.
DATA: BEGIN OF data_table OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
pstat LIKE marc-pstat,
mmsta LIKE marc-mmsta,
END OF data_table.
DATA: BEGIN OF fieldname_table OCCURS 3,
title(60) TYPE c,
table(6) TYPE c,
field(10) TYPE c,
type(1) TYPE c,
END OF fieldname_table.
DATA: headline(80).
DATA: BEGIN OF error_tab OCCURS 10. “Error table
INCLUDE STRUCTURE hrerror.
DATA: END OF error_tab.
PERFORM get_data.
PERFORM set_column_headers.
PERFORM setup_control.
*&———————————————————————*
*& Form get_data
*&———————————————————————*
FORM get_data .
SELECT * UP TO 500 ROWS FROM marc INTO CORRESPONDING FIELDS OF TABLE
data_table.
ENDFORM. ” get data
*&——————————————————————–*
*& Form set_column_headers
*&——————————————————————–*
* text
*———————————————————————*
FORM set_column_headers.
fieldname_table-title = ‘Material Number’.
fieldname_table-table = ‘MARC’.
fieldname_table-field = ‘MATNR’.
fieldname_table-type = ”.
APPEND fieldname_table.
fieldname_table-title = ‘Plant’.
fieldname_table-field = ‘WERKS’.
APPEND fieldname_table.
fieldname_table-title = ‘Maintenance status’.
fieldname_table-field = ‘PSTAT’.
APPEND fieldname_table.
fieldname_table-title = ‘Plant-Specific Material Status’.
fieldname_table-field = ‘MMSTA’.
APPEND fieldname_table.
ENDFORM.
*&———————————————————————*
*& Form setup_control
*&———————————————————————*
FORM setup_control .
CALL FUNCTION ‘HR_DISPLAY_BASIC_LIST’
EXPORTING
file_name = sy-repid
head_line1 = ‘head1’
foot_note1 = ‘foot1’
dyn_pushbutton_text1 = ‘Push1’
dyn_pushbutton_text2 = ‘Push2′
LIST_LEVEL = ’01’
no_alv_grid = ‘X’
TABLES
data_tab = data_table
fieldname_tab = fieldname_table .
ENDFORM.
Test Result of the above piece of code.
You could likewise prefer to really look at our other post on option in contrast to REUSE_ALV_GRID_DISPLAY, named, For what reason are designers so partial to REUSE_ALV_GRID_DISPLAY.
Much thanks for your time!!
Assuming you enjoyed it, if it’s not too much trouble, share it.
YOU MAY BE INTERESTED IN
SAP Business Workflow: Streamlining Business Processe