10-06-2008 8:32 PM
I have one filed on selection screen KNA1-KTOKD.
for that field I have two values 0001( Sold to Party)
0002 (Ship to Party).
On Selection scree I have two radio buttons
1) Sold To Party
2) Ship To Party
Based on Selction of Radio Button the corresponding values it should show.
for Sold to Party it should show 0001
Ship to Party it should show 0002
Could please guide me how to overcome my problem.
-Kumar
10-06-2008 8:41 PM
try this sample code. if you are looking for parameter then you can try this. if it is list box then you may have to use the function VRM_SET_VALUES
parameters: p_ktok type kna1-ktokd.
parameters: r_sol radiobutton group g1 user-command abc default 'X',
r_shp radiobutton group g1.
at selection-screen output.
if r_sol = 'X'.
p_ktok = '0001'.
else.
p_ktok = '0002'.
endif.
10-06-2008 8:41 PM
try this sample code. if you are looking for parameter then you can try this. if it is list box then you may have to use the function VRM_SET_VALUES
parameters: p_ktok type kna1-ktokd.
parameters: r_sol radiobutton group g1 user-command abc default 'X',
r_shp radiobutton group g1.
at selection-screen output.
if r_sol = 'X'.
p_ktok = '0001'.
else.
p_ktok = '0002'.
endif.
10-06-2008 8:44 PM
10-06-2008 8:48 PM
you can change the above code to this..
AT SELECTION-SCREEN OUTPUT.
IF r_sol = 'X'.
CLEAR s_ktok[].
s_ktok-low = '0001'.
s_ktok-sign = 'I'.
s_ktok-option = 'EQ'.
APPEND s_ktok.
ELSE.
CLEAR s_ktok[].
s_ktok-low = '0002'.
s_ktok-sign = 'I'.
s_ktok-option = 'EQ'.
APPEND s_ktok.
ENDIF.
10-06-2008 8:58 PM
Hi,
Thnx for your quick response.
I facing one problem here in both cases it is taking 0002 only.
Pls find the below code
SELECT-OPTIONS : s_ktokd FOR kna1-ktokd.
AT SELECTION-SCREEN OUTPUT.
IF sop = 'X'.
CLEAR s_ktokd[].
s_ktokd-low = '0001'.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
APPEND s_ktokd.
ELSE.
CLEAR s_ktokd[].
s_ktokd-low = '0002'.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
APPEND s_ktokd.
ENDIF.
10-06-2008 9:01 PM
check now , i think you are not using the user-commnad addition in the radiobutton.
check now.
SELECT-OPTIONS : s_ktokd FOR kna1-ktokd.
parameters: sop radiobutton group g1 user-command abc default 'X',
shp radiobutton group g1.
AT SELECTION-SCREEN OUTPUT.
IF sop = 'X'.
CLEAR s_ktokd[].
s_ktokd-low = '0001'.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
APPEND s_ktokd.
ELSE.
CLEAR s_ktokd[].
s_ktokd-low = '0002'.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
APPEND s_ktokd.
ENDIF.
10-06-2008 8:47 PM
Check This code:
PARAMETERS: p_001 RADIOBUTTON GROUP rd1 USER-COMMAND usr1,
p_002 RADIOBUTTON GROUP rd1.
PARAMETERS: p_ktokd TYPE kna1-ktokd.
INITIALIZATION.
p_ktokd = '0001'. "Since P_001 is default
AT SELECTION-SCREEN.
IF p_001 = 'X'.
p_ktokd = '0001'.
ELSEIF p_002 = 'X'.
p_ktokd = '0002'.
ENDIF.
You can check this on [how to access the radiobutton using the CASE.|http://help-abap.blogspot.com/2008/09/radiobutton-values-using-case.html]
Regards,
Naimesh Patel