Sample Program On AT SELECTION-SCREEN OUTPUT - 3.
REPORT ztest.
TABLES: zcust_req_header.
DATA : v_chk_mdcc_appr(1).
DATA : req_no1 TYPE zcust_req_header-req_no.
DATA : it_tmp_req_hdr TYPE STANDARD TABLE OF zcust_req_header WITH HEADER LINE,
wa_tmp_usr21 TYPE usr21.
*---------------------------------------
* Selection Screen
*---------------------------------------
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title1 NO INTERVALS.
SELECT-OPTIONS: s_req_no FOR zcust_req_header-req_no.
SELECT-OPTIONS: s_crt_by FOR zcust_req_header-created_by NO-EXTENSION NO INTERVALS DEFAULT sy-uname.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE title2 NO INTERVALS.
PARAMETERS: p_r1 RADIOBUTTON GROUP rad2 MODIF ID bl3 , " All
p_r2 RADIOBUTTON GROUP rad2 DEFAULT 'X' MODIF ID bl3 ," CREATED should be selected by default
p_r3 RADIOBUTTON GROUP rad2 MODIF ID bl3 , " Rejected
p_r4 RADIOBUTTON GROUP rad2 MODIF ID bl3. " Approved by ABC team
SELECTION-SCREEN END OF BLOCK b2.
*----------------------------------------------
INITIALIZATION.
title1 = 'Please enter the details'.
title1 = 'Please select an option'.
*Identify User Login
CLEAR v_chk_mdcc_appr.
AUTHORITY-CHECK OBJECT 'Z_ABC_AUT'
ID 'ZABC' FIELD 'ABC'. " The field 'ABC' should be checked only for people in ABC team
IF sy-subrc EQ 0.
v_chk_mdcc_appr = 'X'.
ENDIF.
*------------------------------------------------
AT SELECTION-SCREEN.
IF s_req_no[] IS NOT INITIAL.
req_no1 = s_req_no-low.
REFRESH it_tmp_req_hdr[].
SELECT SINGLE * FROM zcust_req_header
INTO CORRESPONDING FIELDS OF it_tmp_req_hdr
WHERE req_no IN s_req_no.
IF sy-subrc NE 0.
MESSAGE 'The request does not exist' TYPE 'E'.
ENDIF.
ENDIF.
IF s_crt_by[] IS NOT INITIAL.
CLEAR wa_tmp_usr21.
SELECT SINGLE * FROM usr21
INTO CORRESPONDING FIELDS OF wa_tmp_usr21
WHERE bname IN s_crt_by.
IF sy-subrc NE 0.
MESSAGE 'The creator does not exist' TYPE 'E'.
ENDIF.
ENDIF.
*------------------------------------------------
AT SELECTION-SCREEN OUTPUT.
IF v_chk_mdcc_appr = 'X'.
REFRESH s_crt_by[].
ENDIF.
IF v_chk_mdcc_appr NE 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'BL3'.
screen-active = 0.
ENDIF.
IF screen-name = 'CRTED_BY-LOW'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
OUTPUT:
In case the user has no authority, the selection screen looks like:
And in case the user has the authority to process the program, the selection screen looks like:
ALSO READ:
- ABAP EVENTS During Runtime Of A Report Program.
- INITIALIZATION Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN OUTPUT Event - Introduction With A Sample Code.
- AT SELECTION-SCREEN ON VALUE REQUEST- Introduction With A Sample Code.
- AT SELECTION-SCREEN ON HELP REQUEST- Introduction With A Sample Code.
- AT SELECTION-SCREEN ON - Introduction With A Sample Code.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 1.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 2.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 3.
- Sample Program On AT SELECTION-SCREEN OUTPUT - 4.
- Sample Program On AT SELECTION-SCREEN ON VALUE REQUEST FOR field - 1.
- Sample Program On AT SELECTION-SCREEN ON VALUE REQUEST FOR field - 2.
- Sample Program On AT SELECTION-SCREEN ON HELP REQUEST FOR field- 1.
Your suggestions and comments are welcome in this section.
Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.