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

code on Selection-screen radio button

Former Member
0 Likes
1,480

Hi all,

I am having two radiobuttons in selection-screen, if i check one radiobutton , another selectio-screen has to display in that standard selection-screen only.

send me the code.

BALU.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,415

just check this

PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(40) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.

*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F006' or
   screen-group1 = 'DEF'.
screen-active = '0'.                   "check this
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F002' or
   screen-group1 = 'ABC'.
screen-active = '1'.           "check this
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

regards,

vijay

17 REPLIES 17
Read only

anversha_s
Active Contributor
0 Likes
1,414

hi,

chk this sample.

report abc.


*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(20) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.

*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'DEF'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

rgds

Anver

Read only

0 Likes
1,414

Hi anversha,

thnx for ur code,

but i dont want that second block when i executed the program,it has to come when i clicked on the second radio button.

plz send me the code for that.

BALU.

Read only

0 Likes
1,414

Hi you can modify the above code like this :

use <b>screen-ACTIVE = '0'</b> instead of <b>screen-input = '0'</b>

This will hide the second screen.

Read only

0 Likes
1,414

H iravi thnk u for the code,

But the first block is going, it has to be there only.

BALU.

Read only

Former Member
0 Likes
1,414

Hi Bala,

chk this code and select 2nd radio button , the same selection-screen will open in popup , u can modify the same to ur requirement

REPORT  ychatest.                             .


PARAMETERS : r1 RADIOBUTTON GROUP rad USER-COMMAND new,
             r2 RADIOBUTTON GROUP rad.

AT SELECTION-SCREEN.

  IF r2 = 'X'.
    CALL SCREEN 1000 STARTING AT 50 50 ENDING AT 100 100.
  ENDIF.

Read only

0 Likes
1,414

No i dont want in popup, i want the screen in that standard screen only.

Plz Can any body help me.

BALU.

Read only

0 Likes
1,414

then try this...

REPORT ychatest. .

PARAMETERS : r1 RADIOBUTTON GROUP rad USER-COMMAND new,

r2 RADIOBUTTON GROUP rad.

AT SELECTION-SCREEN.

IF r2 = 'X'.

CALL SCREEN 100 .

ENDIF.

where 100 is ur another screen number

Read only

0 Likes
1,414

In anversha's code just do the following changes :

use <b>screen-ACTIVE = '0'</b> instead of <b>screen-input = '0'</b>

This will hide the second screen.

Read only

0 Likes
1,414

hi sekhar,

it will come, but the clicked radio buttons block will not come, so when i clcked on the second radio button, another screen has to come into that standard selection-screen and the clicked radiobutton group has to be there only for clicking.

BALU.

Read only

0 Likes
1,414
check this , small modification to Anvershas code


report abc.


*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(40) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.



*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F006' or
   screen-group1 = 'DEF'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F002' or
   screen-group1 = 'ABC'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Read only

0 Likes
1,414

Hi sekhar really thanku for ur coding,

But again the first block is overwriting with second block, i dont want like that, the second block has to come below the first block immediately.

BALU.

Read only

0 Likes
1,414

Hi,

Try this.

PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.

PARAMETERS : R2 RADIOBUTTON GROUP RG .

*----


selection-screen begin of block b1 with frame.

parameters : a(10) type c modif id abc.

parameters : b(10) type c modif id abc.

selection-screen end of block b1.

selection-screen begin of block b2 with frame.

parameters : c(40) type c modif id def.

parameters : d(20) type c modif id def.

selection-screen end of block b2.

*----


<b>INitialization.</b>

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-name = '%B%_F006' or

screen-group1 = 'DEF'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

<b>at selection-screen output.</b>

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-name = '%B%_F002' or

screen-group1 = 'ABC'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Read only

0 Likes
1,414

i am just changing anver's code it works

have look,

*----


PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.

PARAMETERS : R2 RADIOBUTTON GROUP RG .

*----


selection-screen begin of block b1 with frame.

parameters : a(10) type c modif id abc.

parameters : b(10) type c modif id abc.

selection-screen end of block b1.

selection-screen begin of block b2 with frame.

parameters : c(40) type c modif id def.

parameters : d(20) type c modif id def.

selection-screen end of block b2.

*----


at selection-screen output.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-name = '%B%_F006' or

screen-group1 = 'DEF'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-name = '%B%_F002' or

screen-group1 = 'ABC'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

santhosh

Message was edited by:

Kaluvala Santhosh

Read only

0 Likes
1,414
hope this should solve ur problem


report abc.


*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(40) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.



*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F006' or
   screen-group1 = 'DEF'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Read only

Former Member
0 Likes
1,416

just check this

PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


*-------------------------------------------
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.


selection-screen begin of block b2 with frame.
parameters : c(40) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.

*-------------------------------------------
at selection-screen output.


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F006' or
   screen-group1 = 'DEF'.
screen-active = '0'.                   "check this
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-name = '%B%_F002' or
   screen-group1 = 'ABC'.
screen-active = '1'.           "check this
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

regards,

vijay

Read only

0 Likes
1,414

Hi vijay,

Thnx for ur code, it solved my problem, really am very thank full to u,

Bye.

BALU.

Read only

Former Member
0 Likes
1,414

Hi Bala

If I have understood your requirement right, u want two different selection screens to appear on the same screen. their appearance is determined by a radio button. if this is the case then there is definitely one way of doing it.

Unfortunately code for this method cant be given coz its a small procedure by itself. so i am listing the steps involved in doing this -

<b>Note:</b> this requires some fundamental knowledge on Module pool

1) Create a normal screen , say screen 100.

2) Add three objects in the screen

- Two Radio buttons with same group , say R1 and R2

- A subscreen container which fills rest of the screen

3) Now define two selection screens(as per your requirement). this can be done using the following syntax -

"SELECTION-SCREEN BEGIN OF SCREEN scr AS SUBSCREEN."

in the above syntax u can give ur prefered screen numbers in place of 'scr'

4) Now you have two selection screens (say, with numbers 200 & 300)

5) In PBO and PAI of screen 100, write code to call the selection screen(s) to fill the sub screen area that you have added using screen painter. the code will be some thing similar to -

"CALL SUBSCREEN b INCLUDING prog dynnr "

Here u can dynamically feed the value of 'b' with either 200 or 300 as per your radio button selection.

By this method, u can alternate between selection screen on some user action.

Technically speaking, we are embedding a selection screen as subscreen inside a normal screen.

Hope this helps u in ur requirement.

Regards

Mukundhan