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

hideing the select options in selection screen

Former Member
0 Likes
1,382

I have 2 radio buttons in the selection screen.

SELECTION-SCREEN BEGIN OF BLOCK b2 with frame title text-018.

parameters : GR1 Radiobutton group rg1 default 'X',

GR2 Radiobutton group rg1.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b1 with frame title text-017.

Select-options : z_s_werk for t001w-werks obligatory,

z_s_matn for marc-matnr,

z_s_bdat for mkpf-budat obligatory.

z_s_lifn for mseg-lifnr.

z_s_sgtx for mseg-sgtxt.

z_s_bwar for mseg-bwart.

SELECTION-SCREEN END OF BLOCK b1.

if GR1 = 'X'.

i have to hide z_s_sgtx for mseg-sgtxt.

if GR2 = X.

I have to hide z_s_lifn for mseg-lifnr.

is there any way for hideing this.

Regards,

Selvapriya S.

12 REPLIES 12
Read only

Former Member
0 Likes
1,346

Hi Priya,

Use No-Display option.

Syntax:

SELECT-OPTIONS <selcrit> FOR <f> ... NO DISPLAY

Regards,

Swapna.

Read only

Former Member
0 Likes
1,346

Hi Selvapriya,

yes u can hide using at selection-screen output.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF gr1 = 'X'.

IF screen-name = 'Z_S_SGTX-LOW' or screen-name = 'Z_S_SGTX-HIGH' .

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

IF gr2 = 'X'.

IF screen-name = 'Z_S_LIFN-LOW' or screen-name = 'Z_S_LIFN-HIGH' .

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

ENDIF.

Read only

Former Member
0 Likes
1,346

Hi Selvapriya ,

assign user command to radio button group,

Using the event at selection-screen output set the fields for no display.

Select-options : z_s_werk for t001w-werks obligatory,

z_s_matn for marc-matnr,

z_s_bdat for mkpf-budat obligatory.

z_s_lifn for mseg-lifnr MODIF ID S1.

z_s_sgtx for mseg-sgtxt MODIF ID S2.

z_s_bwar for mseg-bwart.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF gr1 = 'X' and screen-group1 ne 's2'.

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

IF gr2 = 'X' and screen-group1 ne 's1'.

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

ENDIF.

ENDLOOP.

hope it will be useful.

Regards,

Lakshman.

Edited by: Lakshman N on Mar 17, 2009 7:49 AM

Read only

Former Member
0 Likes
1,346

Sorry

also add ENDLOOP at the end.

missed to write.

Read only

Former Member
0 Likes
1,346

Hi Priya,

Sorry, I did not read the question properly. Try this way:

At selection-screen output.

      loop at screen.
          if gr1 = 'X'.
             if screen-name = 'Z_S_SGTX'.
                  screen-active = 0.
                  modify screen.
             endif.
          else.
             if screen-name = 'Z_S_LIFN'.
                 screen-active = 0.
                 modify screen.
          endif.
       endloop.

Hope this helps.

Regards,

Swapna.

Read only

0 Likes
1,346

Hi

the internal table SCREEN will not have the value screen-name = 'Z_S_SGTX'.

it will have Z_S_SGTX-low or Z_S_SGTX-high.

else can use screen-name CS 'Z_S_SGTX'.

Read only

0 Likes
1,346

And please give a note here when ur problem is solved.

Guru

Read only

Former Member
0 Likes
1,346

Hi,

Use the code given below...

"As No one has mentioned above, While declaration dont forget to assign user-command for the radio button otherwise it will not work

parameters : GR1 Radiobutton group rg1 default 'X' USER-COMMAND RAD,
GR2 Radiobutton group rg1 USER-COMMAND RAD.

AT SELECTION-SCREEN OUTPUT.

if GR1 = 'X'.
loop at screen.
 if screen-name CS 'Z_S_SGTX'               "   Giving '=' would not work and it will not hide it... you have to use 'CS'
   screen-active = 0.
   modify screen.
 endif.
endloop.
if GR2 = X.
loop at screen.
 if screen-name CS 'Z_S_LIGN'        "   Giving '=' would not work and it will not hide it... you have to use 'CS'
   screen-active = 0.
   modify screen.
 endif.
endloop.

Regards,

Siddarth

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,346

hi,


SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-018.
PARAMETERS : gr1 RADIOBUTTON GROUP rg1 DEFAULT 'X' USER-COMMAND ud,
             gr2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-017.
" Remove obligatory and do validations for the fileds which have OBLIGATORY at EVENT 
" AT SELECTION-SCREEN .

SELECT-OPTIONS : z_s_werk FOR t001w-werks ,"(OBLIGATORY) 
                 z_s_matn FOR marc-matnr,
                 z_s_bdat FOR mkpf-budat," OBLIGATORY,
                 z_s_lifn FOR mseg-lifnr,
                 z_s_sgtx FOR mseg-sgtxt,
                 z_s_bwar FOR mseg-bwart.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

  IF gr1 = 'X'.
    LOOP AT SCREEN.
     IF screen-name = 'Z_S_SGTX-LOW'                 OR 
         screen-name = 'Z_S_SGTX-HIGH'                OR
         screen-name = '%_Z_S_SGTX_%_APP_%-VALU_PUSH' OR 
         screen-name = '%_Z_S_SGTX_%_APP_%-VALU_PUSH' OR
         screen-name = '%_Z_S_SGTX_%_APP_%-TO_TEXT'   OR
         screen-name = '%_Z_S_SGTX_%_APP_%-OPTI_PUSH' OR
         screen-name = '%_Z_S_SGTX_%_APP_%-TEXT'.

        screen-active = 0.
      ELSE.
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

  ELSE.
    LOOP AT SCREEN.
   IF screen-name = 'Z_S_LIFN-LOW'                 OR 
         screen-name = 'Z_S_LIFN-HIGH'                OR
         screen-name = '%_Z_S_LIFN_%_APP_%-VALU_PUSH' OR
         screen-name = '%_Z_S_LIFN_%_APP_%-VALU_PUSH' OR
         screen-name = '%_Z_S_LIFN_%_APP_%-TO_TEXT'   OR
         screen-name = '%_Z_S_LIFN_%_APP_%-OPTI_PUSH' OR
         screen-name = '%_Z_S_LIFN_%_APP_%-TEXT'.

        screen-active = 0.
      ELSE.
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

for example.

AT SELECTION-SCREEN on Z_S_SGTX.

if Z_S_SGTX is initial.
" Raise an error message here
Endif.

Thanks & REgards

Read only

sarbajitm
Contributor
0 Likes
1,346

SELECTION-SCREEN BEGIN OF BLOCK b2 with frame title text-018.

parameters : GR1 Radiobutton group rg1 USER-COMMAND radio default 'X',

GR2 Radiobutton group rg1.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b1 with frame title text-017.

Select-options : z_s_werk for t001w-werks obligatory,

z_s_matn for marc-matnr,

z_s_bdat for mkpf-budat obligatory.

z_s_lifn for mseg-lifnr.

z_s_sgtx for mseg-sgtxt.

z_s_bwar for mseg-bwart.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF gr1 = 'X'.

IF screen-name = 'Z_S_SGTX-LOW' or screen-name = 'Z_S_SGTX-HIGH' .

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

IF gr2 = 'X'.

IF screen-name = 'Z_S_LIFN-LOW' or screen-name = 'Z_S_LIFN-HIGH' .

screen-active = '0'.

endif.

MODIFY SCREEN

endif.

ENDIF.

ENDLOOP.

Paste the above code in your SE38 an run it.Hope it solve your problem.

Thanks and Regards.

Sarbajit.

Read only

Former Member
0 Likes
1,346
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-018.

PARAMETERS : gr1 RADIOBUTTON GROUP rg1 
                  DEFAULT 'X' 
                  USER-COMMAND rg1,
             gr2 RADIOBUTTON GROUP rg1.

SELECTION-SCREEN END OF BLOCK b2.


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

SELECT-OPTIONS : z_s_werk FOR t001w-werks OBLIGATORY,

z_s_matn FOR marc-matnr,

z_s_bdat FOR mkpf-budat OBLIGATORY,

z_s_lifn FOR mseg-lifnr,

z_s_sgtx FOR mseg-sgtxt,

z_s_bwar FOR mseg-bwart.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF ( screen-name CS  'Z_S_SGTX'
      AND gr1 = 'X' )
      OR ( screen-name CS  'Z_S_LIFN'
      AND gr2 = 'X' ).
      screen-active = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
Read only

sarbajitm
Contributor
0 Likes
1,346

Hi Selvapriya,

If your problem is solved,then please mark the thread as answered.

regards.

Sarbajit.