Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

How to Hide Parameters on Selection Screen

REPORT ZSACHIN_ALV_DEEP27. *----------------------------------------------------------------------* *TABLES* *----------------------------------------------------------------------* tables: mara, skb1, BSEG. *----------------------------------------------------------------------* *SELECTIONSCREEN* *----------------------------------------------------------------------* selection-screen: Begin of block b1 with frame title text-001. parameters : R1 radiobutton group g1 default 'X' user-command AA. select-options : s_bukrs for skb1-bukrs MODIF ID AA. parameters : p_GJAHR type bseg-GJAHR MODIF ID AA. parameters : p_MONAT type bkpf-MONAT MODIF ID AA. select-options : s_SEG for BSEG-SEGMENT MODIF ID AA. parameters : R2 radiobutton group g1. select-options: s1_bukrs for skb1-bukrs MODIF ID CC. parameters: p1_GJAHR type bseg-GJAHR MODIF ID CC. parameters: p1_MONAT type bkpf-MONAT MODIF ID CC. select-options: s1_SEG for bseg-SEGMENT MODIF ID CC. select-options: s1_PRCTR for bseg-PRCTR MODIF ID CC. selection-screen: end of block b1. *----------------------------------------------------------------------* * AT S E L E C T I O N S C R E E N O U T P U T * *----------------------------------------------------------------------* At selection-screen output. If R1 = 'X'. loop at screen. if screen-group1 = 'AA'. screen-input = '1'. modify screen. endif. if screen-group1 = 'CC'. screen-input = '0'. modify screen. endif. endloop.

elseif R2 = 'X'. loop at screen. if screen-group1 = 'AA'. screen-input = '0'. modify screen. endif. if screen-group1 = 'CC'. screen-input = '1'. modify screen. endif. endloop. endif.

Example of Report having all events


REPORT ZKA_REPORT MESSAGE-ID ZKA LINE-SIZE 255 LINE-COUNT 10(2). TABLES: ZKA_EMP,ZKA_COM. DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE. DATA: JTAB LIKE ZKA_COM OCCURS 0 WITH HEADER LINE. SELECT-OPTIONS: EMP_NO FOR ZKA_EMP-EMPNO. SET PF-STATUS 'ZKA_MENU'. INITIALIZATION. EMP_NO-LOW = '1'. EMP_NO-HIGH = '10'. EMP_NO-SIGN = 'I'. EMP_NO-OPTION = 'BT'. APPEND EMP_NO. CLEAR EMP_NO. AT SELECTION-SCREEN. IF EMP_NO-LOW < '1'. MESSAGE S000(ZKA). ELSEIF EMP_NO-HIGH > '10'. MESSAGE S001. ENDIF.

START-OF-SELECTION. SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO IN EMP_NO. LOOP AT ITAB. WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE, 29 ITAB-EMPPHONE,39 SY-VLINE. HIDE: ITAB-EMPNO. ENDLOOP. WRITE:/5 SY-ULINE(35). TOP-OF-PAGE. WRITE:/5 SY-ULINE(35). WRITE:/5 SY-VLINE,6 'EMPNO',17 SY-VLINE,18 'EMPNAME',28 SY-VLINE, 29 'EMPPHONE',39 SY-VLINE. WRITE:/5 SY-ULINE(35). END-OF-PAGE. WRITE:/5 SY-ULINE(35). WRITE:/ 'THE PAGE NO IS',SY-PAGNO. END-OF-SELECTION. WRITE:/ 'THE RECORD IS CLOSED'. AT LINE-SELECTION. IF SY-LSIND = 1. SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO. LOOP AT ITAB. WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE, 29 ITAB-EMPPHONE,39 SY-VLINE. ENDLOOP. WRITE:/5 SY-ULINE(35). ELSEIF SY-LSIND = 2. SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO. LOOP AT JTAB.

WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE, 29 JTAB-COMPHONE,39 SY-VLINE. ENDLOOP. WRITE:/5 SY-ULINE(35). ENDIF. AT PF7. IF SY-LSIND = 1. SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO. LOOP AT ITAB. WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE, 29 ITAB-EMPPHONE,39 SY-VLINE. ENDLOOP. WRITE:/5 SY-ULINE(35). ELSEIF SY-LSIND = 2. SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO. LOOP AT JTAB. WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE, 29 JTAB-COMPHONE,39 SY-VLINE. ENDLOOP. WRITE:/5 SY-ULINE(35). ENDIF. AT USER-COMMAND. IF SY-UCOMM = '0001'. IF SY-LSIND = 1. SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO. LOOP AT ITAB. WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE, 29 ITAB-EMPPHONE,39 SY-VLINE.

ENDLOOP. WRITE:/5 SY-ULINE(35). ELSEIF SY-LSIND = 2. SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO. LOOP AT JTAB. WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE, 29 JTAB-COMPHONE,39 SY-VLINE. ENDLOOP. WRITE:/5 SY-ULINE(35). ENDIF. ENDIF. Output is Given Below :

System fields used in interactive Reporting


The SY-LSIND system field contains the index of the list currently created. While creating a basic list, SYLSIND equals 0. With each interactive event, the system automatically sets the following system fields: System field Information SY-LINCT total line count of a list SY-LINNO current line no where cursor is placed. SY-LSIND Index of the list currently created during the current event (basic list = 0) SY-LISTI Index of the list level from which the event was triggered SY-LILLI Absolute number of the line from which the event was triggered SY-LISEL Contents of the line from which the event was triggered SY-CUROW Position of the line in the window from which the event was triggered (counting starts with 1) SY-CUCOL Position of the column in the window from which the event was triggered (counting starts with 2) SY-UCOMM Function code that triggered the event SY-PFKEY Always contains the status of the current list.

---------------------

You might also like