DATA: BEGIN OF T_OUT_FOR_F4 OCCURS 0,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
END OF T_OUT_FOR_F4.
PARAMETERS: P_BUKRS TYPE BUKRS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.
PERFORM F4_FOR_BUKRS.
*&---------------------------------------------------------------------*
*& Form F4_FOR_BUKRS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------*
FORM F4_FOR_BUKRS.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
IT_REPORT TYPE SY-REPID,
ES_SELFIELD TYPE SLIS_SELFIELD.
* Get data
SELECT BUKRS BUTXT FROM T001
INTO TABLE T_OUT_FOR_F4
WHERE BUKRS = '0001' OR BUKRS = 'US01'.
* Get field
IT_REPORT = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = IT_REPORT
I_INTERNAL_TABNAME = 'T_OUT_FOR_F4'
I_INCLNAME = IT_REPORT
CHANGING
CT_FIELDCAT = IT_FIELDCAT[].
LOOP AT IT_FIELDCAT.
IT_FIELDCAT-KEY = SPACE.
IF IT_FIELDCAT-FIELDNAME = 'BUTXT'.
IT_FIELDCAT-KEY = 'X'.
ENDIF.
MODIFY IT_FIELDCAT.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
* I_TITLE =
* I_SELECTION = 'X'
* I_ZEBRA = ' '
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = 'T_OUT_FOR_F4'
* I_STRUCTURE_NAME =
IT_FIELDCAT = IT_FIELDCAT[]
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE =
IMPORTING ES_SELFIELD = ES_SELFIELD
* E_EXIT =
TABLES
T_OUTTAB = T_OUT_FOR_F4
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2 .
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
READ TABLE T_OUT_FOR_F4 INDEX ES_SELFIELD-TABINDEX.
P_BUKRS = T_OUT_FOR_F4-BUKRS.
ENDIF.
ENDFORM. " F4_FOR_BUKRS
ALSO READ:
- F4 (Value On Request) On Logical File On selection Screen.
- Display Icon On Selection Screen.
- Sample Program To Display Icon On Selection Screen.
- Multiple Selection Screen Options.
- Pop Up Window With Check Box.
..... Back To Index On ALV List/ Grid Display.
..... Back To MAIN INDEX.
- Display Icon On Selection Screen.
- Sample Program To Display Icon On Selection Screen.
- Multiple Selection Screen Options.
- Pop Up Window With Check Box.
..... Back To Index On ALV List/ Grid Display.
..... Back To MAIN INDEX.
No comments:
Post a Comment