‎2008 Aug 04 11:19 AM
Hello,
I have a custom screen with a radiobutton group consisting of 4 buttons. Function code for the radio button is 'SEARCHOP'. I have four I/O fields next to each radiobutton on the screen. I want that all I/O fields should be invisible except the one for which the current radiobutton is selected.
E.g.
On screen:
RB1 IOField1 (Status: Visible)
RB2 IOField2 (Status: Invisible)
RB3 IOField3 (Status: Invisible)
RB4 IOField4 (Status: Invisible)
User Input: Click on radiobutton RB3
On screen:
RB1 IOField1 (Status: Invisible)
RB2 IOField2 (Status: Invisible)
RB3 IOField3 (Status: Visible)
RB4 IOField4 (Status: Invisible)
I am using the following code in PAI but it doesn't work.
MODULE USER_COMMAND_9501 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'SEARCHOP'.
IF RBN_SEARCH_FOLIO EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'IOFIELD1'
SCREEN-ACTIVE = 'X'.
MODIFY SCREEN.
ELSEIF SCREEN-NAME EQ 'IOFIELD2' OR
SCREEN-NAME EQ 'IOFIELD3' OR
SCREEN-NAME EQ 'IOFIELD4'
SCREEN-ACTIVE = ''.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF RBN_SEARCH_CERT EQ 'X'.
...
ELSEIF RBN_SEARCH_DIST EQ 'X'.
...
ELSEIF RBN_SEARCH_RECEIPT EQ 'X'.
...
ENDIF.
ENDCASE.
ENDMODULE.
Suggestions are app[reciated. Thanks.
Regards
‎2008 Aug 04 2:26 PM
Try doing the setting of fields "active" in the PBO, not the PAI.
Jonathan
‎2008 Aug 04 11:29 AM
Hi,
on click on radio button you have to loop at screen:
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'IOFIELD1'.
IF RB1 = 'X'.
SCREEN-INVISIBLE = 0.
ELSE.
SCREEN-INVISIBLE = 1.
ENDIF.
MODIFY SCREEN.
WHEN 'IOFIELD2'.
IF RB2 = 'X'.
SCREEN-INVISIBLE = 0.
ELSE.
SCREEN-INVISIBLE = 1.
ENDIF.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
you have to do case for all 4 radio buttons in the way mentioned above.
‎2008 Aug 04 12:46 PM
Hi,
At first, you should set a radiobutton for the four radiobutton,
And then, set a funciton code for each radiobutton.
The last, use the loop at screen statement to control the input field like the above reply.
BR
Bob
‎2008 Aug 04 12:48 PM
Hi,
Try the code given below.
Regards,
Wajid Hussain P.
* * * *
CASE ok_code.
WHEN 'SEARCHOP'.
IF rbn_search_folio EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'IOFIELD1'.
screen-active = 'X'.
screen-invisible = ' '.
ELSEIF screen-name EQ 'IOFIELD2' OR
screen-name EQ 'IOFIELD3' OR
screen-name EQ 'IOFIELD4'.
screen-active = ' '.
screen-invisible = 'X'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF rbn_search_cert EQ 'X'.
...
ELSEIF rbn_search_dist EQ 'X'.
...
ELSEIF rbn_search_receipt EQ 'X'.
...
ENDIF.
ENDCASE.
‎2008 Aug 04 2:26 PM
Try doing the setting of fields "active" in the PBO, not the PAI.
Jonathan