10-12-2010 2:51 PM
Hello guys,
I have a question regarding radiobutton event.
I have created a group of 4 radiobuttons and sucessfully linked them in screen painter so there can be only one selected.
But I would like to know if it's possible to generate an event where I could insert some code, when I change the selected radio button?
I found on this forum that when you create a group of radiobutton by code, you can give a name to this group. And then use the event "At Selection-Screen on Radiobutton Group XXX" but how can I define the name of the group when creating the radiobuttons in the screen painter?
Thank you for your help.
Olivier.
10-12-2010 3:10 PM
Hi,
Try to assign Fcode for your radio button, then implement in user_command module. More information please check sample report DEMO_DYNPRO_CHECK_RADIO.
Thanks,
10-12-2010 3:10 PM
Hi,
Try to assign Fcode for your radio button, then implement in user_command module. More information please check sample report DEMO_DYNPRO_CHECK_RADIO.
Thanks,
10-12-2010 3:43 PM
Hi Joskin,
simply create radio button group, and then there is option to add FctCode for this group.
Then you can switch ok_code in PAI of given screen and check when ok_code = fctcode ...
you need also define variables for radio buttons as follows:
DATA: ok_code type syucomm.
DATA: rb_1 type c,
rb_2 type c,
rb_3 type c,
rb_4 type c.
then in PAI (selected rb is marked with 'X'):
CASE ok_code.
WHEN 'RADIO'. "this is FctCode for our radio button group
IF rb_1 IS NOT INITIAL.
...
ELSEIF rb_2 IS NOT INITIAL.
...
ELSEIF rb_3 IS NOT INITIAL.
...
ELSEIF rb4 IS NOT INITIAL.
...
ENDIF.
ENDCASE.
Edited by: Matus Misak on Oct 12, 2010 4:44 PM
10-12-2010 4:19 PM
Check this,
Create a subscreen sub1 in screen 100. Then execute it
Report test.
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
PARAMETERS : r1 radiobutton group A user-command abc,
r2 radiobutton group A .
SELECTION-SCREEN END OF SCREEN 300 .
CALL SCREEN 100 .
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
break-point.
endmodule. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.
Break-point.
endmodule. " USER_COMMAND_0100 INPUT
In flow logic
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN sub1 INCLUDING sy-repid '0300'.
PROCESS AFTER INPUT.
MODULE user_command_0100.
10-12-2010 5:09 PM
the same example that keshav posted in selection-screen would be like this:
PARAMETERS : r1 radiobutton group A user-command abc,
r2 radiobutton group A .
at selection-screen on radiobutton group A.
break-point.
10-12-2010 6:03 PM
Hi Olivier,
You can do this by assigning USER-COMMAND extension to first radiobutton and then use AT SELECTIO-SCREEN ON RADIOBUTTON GROUP event.
Try this code.
TABLES : SSCRFIELDS.
PARAMETERS : a RADIOBUTTON GROUP rd1 USER-COMMAND RCOMMAND,
b RADIOBUTTON GROUP rd1 ,
c RADIOBUTTON GROUP rd1 .
at SELECTION-SCREEN ON RADIOBUTTON GROUP RD1.
IF SSCRFIELDS-UCOMM = 'RCOMMAND'.
"your code
ENDIF.
Thanks,
Anmol.
06-19-2013 10:50 AM