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

Radio Buttons + Required Input/Output Fields in Dialog Programming

Former Member
0 Likes
564

Hi All,

Please find the below issue.

I have 2 Radio buttons

RB1 and RB2 defined in group RG.

And by default RB1 is selected.

I also have 3 Input.Output Fields.

F1 , F2 & F3.

Now before displaying the Screen for the end user,

I need to display as follows:

A)

RB1 = X -


> Selected.

RB2 = Space -


>Not Selected.

F1 -


> Visible.

F2 & F3 -


>Invisible.

***********************************************

B)

RB1 = space -


> Not Selected.

RB2 = X -


>Selected.

F1 -


>Invisible.

F2 -


>Visible.

F3 -


>Visible.

When i am debugging, the value of RB1 is not X though it is selected on the screen (by default due to Radio Button Group) & hence the below code is not working.

*_PBO:_*
LOOP AT SCREEN.
IF RB1 = 'X' AND ( SCREEN-NAME = 'TXT2' OR SCREEN-NAME = 'TXT3' ). 
         SCREEN-INVISIBLE = 1.
ELSEIF RB1 = 'X' AND ( SCREEN-NAME = 'F2' OR SCREEN-NAME = 'F3 ). 
         SCREEN-ACTIVE = 0.
ENDIF.
Modify Screen.
ENDLOOP.

But when i select RB2 = X on the screen.

Value is getting populated .

.

Waiting for your hints/ideas/suggestions

Thanks

Sri.

Hi All,

Please find the below issue.

I have 2 Radio buttons

RB1 and RB2 defined in group RG.

And by default RB1 is selected.

I also have 3 Input.Output Fields.

F1 , F2 & F3.

Now before displaying the Screen for the end user,

I need to display as follows:

A)

RB1 = X -


> Selected.

RB2 = Space -


>Not Selected.

F1 -


> Visible.

F2 & F3 -


>Invisible.

***********************************************

B)

RB1 = space -


> Not Selected.

RB2 = X -


>Selected.

F1 -


>Invisible.

F2 -


>Visible.

F3 -


>Visible.

When i am debugging, the value of RB1 is not X though it is selected on the screen (by default due to Radio Button Group) & hence the below code is not working.

*_PBO:_*
LOOP AT SCREEN.
IF RB1 = 'X' AND ( SCREEN-NAME = 'TXT2' OR SCREEN-NAME = 'TXT3' ). 
         SCREEN-INVISIBLE = 1.
ELSEIF RB1 = 'X' AND ( SCREEN-NAME = 'F2' OR SCREEN-NAME = 'F3 ). 
         SCREEN-ACTIVE = 0.
ENDIF.
Modify Screen.
ENDLOOP.

But when i select RB2 = X on the screen.

Value is getting populated .

.

Waiting for your hints/ideas/suggestions

Thanks

Sri.

2 REPLIES 2
Read only

Former Member
0 Likes
519

If its Module pool : Have you have created the radio buttons with "Get from program" option ? Also, have you defined the radio button group? It doesnt ask any group name. You have mentioned group RG ?

If your issue is in report, give USER-COMMAND <FCODE> for the first radio button in the group.

Edited by: Suman Jagu on May 26, 2011 4:52 PM

Read only

former_member191735
Active Contributor
0 Likes
519

Alright, you defined the radio buttons and grouped them. Did you also assign Fcode to the radio button group? if not already assigned the assign something to FctCode to the radio button. If you can double click on one and assign a name, this will automatically assign to other one. If you already did that... just ignore it.

Next, by defualt, RB1 will not be having 'X' though it shows selected but you can always make it by just writing the following statement in PBO (If you dont want to mislead anybody)

if RB1 = space and RB2 = space.

RB1 = 'X'.

endif.

If you have already done that the next step would be.... Assign a screen group value to the fields F1, F2 and F3.

for example, double click on the field F1, add GR1 in groups in first box and do the same for field text/label if any. Same way, assign GR2 to F2 and F3.

Then add the following code in PBO. (Someone or you can write it better. This is just an example)

LOOP AT SCREEN.

if RB1 = 'X'.

if screen-group1 = 'GR2'.

screen-input = 0.

screen-invisible = 1.

endif.

endif.

if RB2 = 'X'.

if screen-group1 = 'GR1'.

screen-input = 0.

screen-invisible = 1.

endif.

endif.

MODIFY SCREEN.

ENDLOOP.

Good luck... It is working code.,