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

selection screen query

Former Member
0 Likes
931

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
881

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.

6 REPLIES 6
Read only

Former Member
0 Likes
882

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.

Read only

0 Likes
881

Hi,

I am using the SELECT-OPTIONS.

s_ktokd FOR kna1-ktokd.

Read only

0 Likes
881

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.

Read only

0 Likes
881

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.

Read only

0 Likes
881

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.

Read only

naimesh_patel
Active Contributor
0 Likes
881

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