Example: ALV Reporting Using Classes (ABORT ERROR - Field Catalog Not Found)
Example: ALV Reporting Using Classes (ABORT ERROR - Field Catalog Not Found)
*tables vbak.
*SELECT-OPTIONS so_vbeln for vbak-vbeln.
data v_vbeln type vbak-vbeln.
select-OPTIONS so_vbeln for v_vbeln DEFAULT '4980' to '4985'.
data : o_cust_cont type ref to cl_gui_custom_container,
o_grid type ref to cl_gui_alv_grid.
types : begin of ty_sales,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
erzet type vbak-erzet,
ernam type vbak-ernam,
end of ty_sales.
data t_sales type table of ty_sales.
START-OF-SELECTION.
call screen 100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ABC'.
* SET TITLEBAR 'xxx'.
* link custom container with custom control
CREATE OBJECT O_CUST_CONT
EXPORTING
CONTAINER_NAME = 'CUSTCTRL'.
* link alv grid with custom container
CREATE OBJECT O_GRID
EXPORTING
I_PARENT = o_cust_cont.
* get sales orders
perform getsalesorders.
if t_sales is not INITIAL.
* display sales orders
CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = t_sales.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE USER_COMMAND_0100 INPUT.
CASE sy-ucomm.
when 'FC1'.
leave PROGRAM.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
FORM GETSALESORDERS .
select vbeln erdat erzet ernam
from vbak
into table t_sales
where vbeln in so_vbeln.
ENDFORM. " GETSALESORDERS
Flowlogic:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
Module pool screen 100:
PF-STATUS ‘ABC’: