ALV OPPS
*&---------------------------------------------------------------------*
*&
Report ZRP_OOPS_ALV_VBAK
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZRP_OOPS_ALV_VBAK.
data : it_vbak
like TABLE OF vbak,
wa_vbak LIKE LINE OF it_vbak.
data : o_cont
TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
PERFORM
display_data.
*&---------------------------------------------------------------------*
*& Form
get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->
p1 text
* <--
p2 text
*----------------------------------------------------------------------*
FORM get_data .
select * from
vbak INTO TABLE it_vbak UP TO 100 rows.
ENDFORM. " get_data
*&---------------------------------------------------------------------*
*& Form
display_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->
p1 text
* <--
p2 text
*----------------------------------------------------------------------*
FORM display_data
.
call screen 100.
ENDFORM. " display_data
*&---------------------------------------------------------------------*
*& Module
STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE
STATUS_0100 OUTPUT.
SET PF-STATUS 'MYSTATUS'.
* SET TITLEBAR 'xxx'.
CREATE OBJECT O_CONT
EXPORTING
* PARENT =
CONTAINER_NAME = 'CONT'
* STYLE =
* LIFETIME = lifetime_default
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER
SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4.
ENDIF.
CREATE OBJECT O_ALV
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = o_cont
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER
SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4.
ENDIF.
CALL METHOD
O_ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'VBAK'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = it_vbak
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER
SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module
USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE
USER_COMMAND_0100 INPUT.
CASE sy-ucomm .
WHEN
'BACK' or 'EXIT' .
leave to SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
No comments:
Post a Comment