Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection Screen Modification

Former Member
0 Likes
3,148

Hi ABAP er's,

Please help me in below issue,

My Requirement is in selection screen i have one check box and in another selection block(With few fields),initially it has to come with that selection screen block but when user select the check box that time only that selection screen block should be eable please give the example if you have. My requirement is not only field but total selection screen block.

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,033

Hi Vipin,

Try this way,


ELECTION-SCREEN BEGIN OF LINE.
PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                        USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
SELECTION-SCREEN COMMENT 5(35) text-003.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                         DEFAULT 'c:\temp\parbmat.xls',
            p_werks     like t001w-werks MODIF ID a,              "Plant
PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                         DEFAULT 'c:\temp\Success.xls'.
SELECTION-SCREEN : END OF BLOCK 001.
 
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
SELECTION-SCREEN COMMENT 5(35) text-004.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
PARAMETERS     : p_lgort  LIKE mard-lgort MODIF ID b.                "Storage Location
PARAMETERS     : p_vkorg  LIKE mvke-vkorg MODIF ID b.                "Sales Organization
PARAMETERS     : p_vtweg  LIKE mvke-vtweg MODIF ID b.                "Distribution Channel
SELECT-OPTIONS : s_mat FOR  mara-matnr MODIF ID b.                  "Material No No
SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
 
PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                  DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
SELECTION-SCREEN : END OF BLOCK 002.
 
AT SELECTION-SCREEN OUTPUT.
*Inactive Fields depending on the radio button
  LOOP AT SCREEN.
    IF p_r1 = 'X'.
      IF screen-group1 = 'B'.
        screen-active = 0.
      ENDIF.
    ELSEIF p_r2 = 'X'.
      IF screen-group1 = 'A'.
        screen-active = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

11 REPLIES 11
Read only

Former Member
0 Likes
2,033
SELECT-OPTIONS s_matnr FOR mard-matnr.
 
AT SELECTION-SCREEN OUTPUT.
  IF r1 = 'X'.
    LOOP AT SCREEN.
      IF screen-name = 'S_MATNR-HIGH'.
        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-name = 'S_MATNR-HIGH'.
        screen-active = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
Read only

sridhar_meesala
Active Contributor
0 Likes
2,033

Hi,

In AT SELECTION SCREEN OUTPUT write the following

IF <check box is selected>.
LOOP AT SCREEN.
IF screen-group = 'G1'.
  screen-input = 0.
  screen-invisible = 1.
  MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Thanks,

Sri.

Read only

Former Member
0 Likes
2,033

Hi Vipin,

Use these links.

Regards,

Vijay

Read only

Former Member
0 Likes
2,033

Hi,

Please check this


SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    PARAMETERS: 
                P_CHECK AS CHECKBOX USER-COMMAND FLAG.
SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-T02.
  PARAMETERS: P_MATNR TYPE MARA-MATNR MODIF ID S1,
              P_WERKS TYPE EKPO-WERKS MODIF ID S1.
SELECTION-SCREEN END OF BLOCK B2.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
      IF P_CHECK EQ 'X'.
       IF SCREEN-GROUP1 = 'S1'.
         SCREEN-INPUT = '0'.
         MODIFY SCREEN.
       ENDIF.
      ELSE.
       IF SCREEN-GROUP1 = 'S1'.
         SCREEN-INPUT = '1'.
         MODIFY SCREEN.
       ENDIF.
      ENDIF.
    ENDLOOP.

Read only

0 Likes
2,033
selection-screen begin of block b1 with frame title text-001.
parameters : p1  radiobutton group r1 default 'X' user-command ac,
             p2  radiobutton group r1,
selection-screen end of block b1 .
 
selection-screen begin of block b2 with frame title text-002.
select-options : s1 for mara-matnr modif id mra.
parameters :  s2 like mara-matnr modif id mrc.
selection-screen end of block b2.
 
 
at selection-screen output.
 
  if p1 = 'X'.
 
    loop at screen.
      if screen-group1    = 'MRC'.
        screen-input     = '0'.
        screen-invisible = '1'.
        modify screen.
      endif.
    endloop.
 
 
  elseif p2 = 'X'.
    loop at screen.
      if screen-group1    = 'MRA'.
        screen-input     = '0'.
        screen-invisible = '1'.
        modify screen.
      endif.
    endloop.
  endif.
Read only

0 Likes
2,033

Check


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p1  AS CHECKBOX user-command ac.
SELECTION-SCREEN END OF BLOCK b1 .

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s1 FOR mara-matnr MODIF ID mra,
s2 for mara-mtart modif id mrc.
SELECTION-SCREEN END OF BLOCK b2.


AT SELECTION-SCREEN OUTPUT.

  IF p1 = 'X'.

    LOOP AT SCREEN.
      IF screen-group1    = 'MRC'.
        screen-input     = '0'.
*        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ENDIF.

Regards.

Read only

venkat_o
Active Contributor
0 Likes
2,033

Hi Vipin, Try this way.

REPORT ztest_notepad.

PARAMETERS p_check AS CHECKBOX USER-COMMAND uc1.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS p_1 TYPE char10.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

  IF p_check NE 'X'.
    LOOP AT SCREEN.
      IF screen-name = 'P_1' or screen-name = '%_P_1_%_APP_%-TEXT'.
        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-name = 'P_1' or screen-name = '%_P_1_%_APP_%-TEXT'..
        screen-active = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
Thanks Venkat.O

Read only

Former Member
0 Likes
2,033

hi..

Consider you defined a selection screen as follows

SELECTION-SCREEN BEGIN OF BLOCK SL WITH FRAME TITLE TEXT-001.

PARAMETERS : P_R1 TYPE C USER-COMMAND R1 RADIOBUTTON GROUP R1 DEFAULT 'X'.

SELECT-OPTIONS S_AUFNR FOR AUFK-AUFNR.

PARAMETERS : P_R2 TYPE CHAR1 RADIOBUTTON GROUP R1.

SELECTION-SCREEN END OF BLOCK SL.

if you want to display when you click on the radio button pa_r1, you can do as follows

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE C_X.

WHEN P_R2.

IF SCREEN-NAME = 'S_AUFNR' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-TEXT' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-OPTI_PUSH'

OR SCREEN-NAME = 'S_AUFNR-LOW' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-TO_TEXT'

OR SCREEN-NAME = 'S_AUFNR-HIGH' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-VALU_PUSH'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDCASE.

ENDLOOP.

if you need any more clarification let me know

Read only

Former Member
0 Likes
2,033

Hello Vipn ,

i am pasting the code ...which doing the same ...Please cut and paste this code and excute ...

SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS:rb1 RADIOBUTTON GROUP rbf DEFAULT 'X' USER-COMMAND xxx .

PARAMETERS:rb2 RADIOBUTTON GROUP rbf .

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.

SELECTION-SCREEN : BEGIN OF LINE .

SELECTION-SCREEN COMMENT 1(16) text-006 FOR FIELD rb3.

PARAMETERS:rb3 RADIOBUTTON GROUP Gbf DEFAULT 'X' .

SELECTION-SCREEN COMMENT 25(15) text-007 FOR FIELD rb4 .

PARAMETERS:rb4 RADIOBUTTON GROUP Gbf .

SELECTION-SCREEN : END OF LINE .

SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT . "

LOOP AT SCREEN .

IF rb1 = 'X' AND ( screen-name = 'RB3'

OR screen-name = 'RB4' or screen-name = '%B002003_BLOCK_1000').

screen-active = '0'.

MODIFY SCREEN .

ENDIF.

IF rb2 = 'X' AND ( screen-name = 'RB3'

OR screen-name = 'RB4' or screen-name = '%B002003_BLOCK_1000').

screen-active = '1'.

MODIFY SCREEN .

ENDIF.

ENDLOOP.

Thanks and Regards.

Priyank dixit

Read only

Former Member
0 Likes
2,033

hii dear,

try this code.. It is working to your needs

REPORT  ZTEST_AP1.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
  PARAMETERS: EMPNO TYPE ZEMPNO MATCHCODE OBJECT ZSH_EMPHDR.
SELECTION-SCREEN END OF BLOCK B1.

parameter chc as CHECKBOX.

AT SELECTION-SCREEN .
AT SELECTION-SCREEN output.
if chc ne 'X'.
LOOP AT SCREEN.

   if screen-name = 'EMPNO'.
    screen-active = '0'.
    modify screen.
  ENDIF.
ENDLOOP.
else.    "If Checkbox is selected
  LOOP AT SCREEN.

   if screen-name = 'EMPNO'.
    screen-active = '1'.
    modify screen.
  ENDIF.
ENDLOOP.
endif.

Regards,

Apoorv

Edited by: Apoorv Sharma on Jul 29, 2009 9:48 AM

Edited by: Apoorv Sharma on Jul 29, 2009 9:50 AM

Read only

Former Member
0 Likes
2,034

Hi Vipin,

Try this way,


ELECTION-SCREEN BEGIN OF LINE.
PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                        USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
SELECTION-SCREEN COMMENT 5(35) text-003.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                         DEFAULT 'c:\temp\parbmat.xls',
            p_werks     like t001w-werks MODIF ID a,              "Plant
PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                         DEFAULT 'c:\temp\Success.xls'.
SELECTION-SCREEN : END OF BLOCK 001.
 
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
SELECTION-SCREEN COMMENT 5(35) text-004.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
PARAMETERS     : p_lgort  LIKE mard-lgort MODIF ID b.                "Storage Location
PARAMETERS     : p_vkorg  LIKE mvke-vkorg MODIF ID b.                "Sales Organization
PARAMETERS     : p_vtweg  LIKE mvke-vtweg MODIF ID b.                "Distribution Channel
SELECT-OPTIONS : s_mat FOR  mara-matnr MODIF ID b.                  "Material No No
SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
 
PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                  DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
SELECTION-SCREEN : END OF BLOCK 002.
 
AT SELECTION-SCREEN OUTPUT.
*Inactive Fields depending on the radio button
  LOOP AT SCREEN.
    IF p_r1 = 'X'.
      IF screen-group1 = 'B'.
        screen-active = 0.
      ENDIF.
    ELSEIF p_r2 = 'X'.
      IF screen-group1 = 'A'.
        screen-active = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.