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: 

how to make selection-screen block as unvisible?

Former Member
0 Kudos
2,087

hi,

in report program there are two selection screen blocks like this.

SELECTION-SCREEN BEGIN OF BLOCK b1.

	parameters: rb1 as radiobutton group r1 user-command ucomm,
	    	rb2 as radiobutton group r1,
	    	rb3 as radiobutton group r1,
	    	rb4 as radiobutton group r1,

	SELECTION-SCREEN BEGIN OF BLOCK b2.
		parameters: ip1 type string.
		select-options: date for pernr-begda.
	SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OD BLOCK b1.

Now when i clicked on rb4 the selecetion screen block b2 has to be visible.

And rest of things i.e for rb1, rb2, rb3 it should not visible. it should be disabled.

Regards,

Shankar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
787

Hi Shankar,

Use the following code. This is working for your requirement:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS : rb1 RADIOBUTTON GROUP r1 USER-COMMAND m2 MODIF ID m1,

rb2 RADIOBUTTON GROUP r1 MODIF ID m1,

rb3 RADIOBUTTON GROUP r1 MODIF ID m1,

rb4 RADIOBUTTON GROUP r1 MODIF ID m2.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

PERFORM modify_screen.

&----


*& Form modify_screen

&----


  • text

----


FORM modify_screen.

IF rb4 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'RB4'.

screen-invisible = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'M1'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDFORM. "modify_screen

Hope this will help.

Regards,

Nitin.

10 REPLIES 10

Former Member
0 Kudos
787

Hi,

you can do this through Modigying the screen elements,using LOOP AT SCREEN.

in this you can assign rb1,rb2,rb3 to the same modification group usng command MODIF ID

like data : rb1 as radiobutton group r1 modif id 123,

rb2 as radiobutton group r1 modif id 123,

rb3 as radiobutton group r1 modif id 123,

.............................................................

at the event

at selection-screen output.

perform modify_screen.

form modify_screen.

if rb4 = x.

loop at screen.

if screen-name = 'b2'. "Block's name

screen-invisible = '0'.

modify screen.

endif.

if screen-group1 = 123. "Modification Group assigned

screen-invisible = '1'.

modify screen.

endif.

endloop.

endif.

endform.

***you can know more about the SCREEN table by double clicking on it

0 Kudos
787

hi,

thanks for ur reply.

and wat about rb4. this one also has to be group with r1 like this.

like data : rb1 as radiobutton group r1 modif id 123,

rb2 as radiobutton group r1 modif id 123,

rb3 as radiobutton group r1 modif id 123,

rb4 as radiobutton group r1.

Regards,

Shankar.

0 Kudos
787

HI,

i tried with ur loginc but it's not working.

it's not taking that block name b1.

is there any other logic...

Regards,

Shankar.

Former Member
0 Kudos
787

Hi,

Please refer the following code.

LOOP AT SCREEN.
   IF rb_head = c_x  AND screen-group1 = c_aa.
    screen-output = 0.
    screen-active = 0.
    screen-input  = 0.
   ENDIF.
   IF rb_item = c_x  AND screen-group1 = c_ab.
    screen-output = 0.
    screen-active = 0.
    screen-input  = 0.
   ENDIF.
   MODIFY SCREEN.
  ENDLOOP.

here the screen group1 is one group that is block.

Regards,

Nandha

0 Kudos
787

hi nanda,

can tel me littile bit more in ur code.

rb_head and rb_item

Regards,

Shankar.

0 Kudos
787

pass the group name that u have assigned to the fields and disable them not the block name...

form modify_screen.

if rb4 = x.

loop at screen.

if screen-name = 'b2'. "Block's name---->dont pass the block name

screen-invisible = '0'.

modify screen.

endif.

if screen-group1 = 123. "Modification Group assigned

screen-invisible = '1'.

modify screen.

endif.

endloop.

endif.

endform.

use below coding

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 DEFAULT 'X',

r2 RADIOBUTTON GROUP rad1,

r3 RADIOBUTTON GROUP rad1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: r4 RADIOBUTTON GROUP rad2 DEFAULT 'X',

r5 RADIOBUTTON GROUP rad2,

r6 RADIOBUTTON GROUP rad2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP rad1.

IF r1 = 'X'.

loop at screen.

if screen-group1 = (pass the group name of the field that u want disable/enable)

screen-invisible = '0'.

modify screen.

endif.

if screen-group1 = 123. "Modification Group assigned

screen-invisible = '1'.

modify screen.

endif.

endloop.

endif.

ENDIF.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP rad2.

IF r4 = 'X'.

MESSAGE w888(sabapdocu) WITH text-001.

ENDIF.

Former Member
0 Kudos
788

Hi Shankar,

Use the following code. This is working for your requirement:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS : rb1 RADIOBUTTON GROUP r1 USER-COMMAND m2 MODIF ID m1,

rb2 RADIOBUTTON GROUP r1 MODIF ID m1,

rb3 RADIOBUTTON GROUP r1 MODIF ID m1,

rb4 RADIOBUTTON GROUP r1 MODIF ID m2.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

PERFORM modify_screen.

&----


*& Form modify_screen

&----


  • text

----


FORM modify_screen.

IF rb4 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'RB4'.

screen-invisible = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'M1'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDFORM. "modify_screen

Hope this will help.

Regards,

Nitin.

0 Kudos
787

hi,

i am doing like this.

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

  SELECTION-SCREEN SKIP 1.

  SELECT-OPTIONS: pernr FOR person-pernr.

  SELECTION-SCREEN SKIP 1.

  PARAMETERS: tempname LIKE rlgrap-filename.

  SELECTION-SCREEN SKIP 1.

  PARAMETERS: rb_p1 TYPE c RADIOBUTTON GROUP r1 USER-COMMAND rbg,
              rb_p2 TYPE c RADIOBUTTON GROUP r1,
              rb_p3 TYPE c RADIOBUTTON GROUP r1,
              rb_p4 TYPE c RADIOBUTTON GROUP r1.

  SELECTION-SCREEN SKIP 1.

    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text1.
        PARAMETERS: country(25) TYPE c MODIF ID ccc.
        SELECT-OPTIONS:Fromdate FOR person-begda NO-EXTENSION MODIF ID ccc.
    SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

IF rb_p4 = ' ' .
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'COUNTRY'
      OR SCREEN-NAME = 'FROMDATE-LOW'
      OR SCREEN-NAME = 'FROMDATE-HIGH'
      OR SCREEN-GROUP1 = 'CCC'.
          screen-input = 0. "Disable
      ENDIF.
      MODIFY SCREEN.
  ENDLOOP.
ENDIF.

IF rb_p4 = 'X' .
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'COUNTRY'
      OR SCREEN-NAME = 'FROMDATE-LOW'
      OR SCREEN-NAME = 'FROMDATE-HIGH'
      OR SCREEN-GROUP1 = 'CCC'.
          screen-input = 1. "Disable
      ENDIF.
      MODIFY SCREEN.
  ENDLOOP.
ENDIF.

Now it's making as disabled the fields which are in block B2.

Acutually my requirement is when i ever user selects RB_P4 then only that screen has to appear. and for rest of 3 RB it should not visible. it should be invisible.

for this wat to do....

Regards,

Shankar.

0 Kudos
787

Hi,

Just use invisible like this...


IF rb_p4 = ' ' .
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'COUNTRY'
      OR SCREEN-NAME = 'FROMDATE-LOW'
      OR SCREEN-NAME = 'FROMDATE-HIGH'
      OR SCREEN-GROUP1 = 'CCC'.
          screen-input = 0. "Disable
          screen-INVISIBLE = 1."invisible
      ENDIF.
      MODIFY SCREEN.
  ENDLOOP.
ENDIF.

IF rb_p4 = 'X' .
  LOOP AT SCREEN.
      IF SCREEN-NAME = 'COUNTRY'
      OR SCREEN-NAME = 'FROMDATE-LOW'
      OR SCREEN-NAME = 'FROMDATE-HIGH'
      OR SCREEN-GROUP1 = 'CCC'.
          screen-input = 1. "Disable
          screen-INVISIBLE = 0. "visible
      ENDIF.
      MODIFY SCREEN.
  ENDLOOP.
ENDIF.

0 Kudos
787

hi,

thanks alot man. my problem got solved....

Regards,

Shankar.