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 problem

Former Member
0 Likes
645

Hi,

I have one query regarding selection screen.

Suppose I have two radiobuttons r1 & r2.

If i select r1 then the field kunnr should be mandatory & if r2 is selected then the kunnr should become optional field.

as per my logic i wrote the code for this but i m getting error here.

parameters: c1 radiobutton group g1 default 'X'.

c2 radiobutton group g1.

if not c1 is initial.

parameters: kunnr like kna1-kunnr obligatory.

else.

parameters: kunnr like kna1-kunnr.

endif.

Will u let me know how to write the logic for this??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
610

you can do something like this :

parameters : r1 radiobutton grorp r1 user-command ucom,

r2 radiobutton group r1,

kunnr like kna1-kunnr.

at selection-screen output.

if r1 = 'X'.

loop at screen.

if screen-name = 'KUNNR'.

screen-required = '0'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-name = 'KUNNR'.

screen-required = '0'.

modify screen.

endif.

endif.

5 REPLIES 5
Read only

Former Member
0 Likes
610

Use Event AT SELECTION SCREEN.

Here you can check the radio button and validate if Kunnr is blank, give the appropriate message.

if not c1 is initial.

IF Kunnr is initial.

MESSAGE E000 - 'KUNNR is Mandetory'.

endif.

endif.

-Vishal

**Hope it will help

Read only

Former Member
0 Likes
611

you can do something like this :

parameters : r1 radiobutton grorp r1 user-command ucom,

r2 radiobutton group r1,

kunnr like kna1-kunnr.

at selection-screen output.

if r1 = 'X'.

loop at screen.

if screen-name = 'KUNNR'.

screen-required = '0'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-name = 'KUNNR'.

screen-required = '0'.

modify screen.

endif.

endif.

Read only

0 Likes
610

you can do something like this :

parameters : r1 radiobutton grorp r1 user-command ucom,

r2 radiobutton group r1,

kunnr like kna1-kunnr.

at selection-screen output.

if r1 = 'X'.

loop at screen.

if screen-name = 'KUNNR'.

*required

screen-required = '1'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-name = 'KUNNR'.

*not required

screen-required = '0'.

modify screen.

endif.

endif.

Read only

Former Member
0 Likes
610

Hi SS ,

u have to put like this.

if not c1 is initial.

loop at screen.

screen-name = KUNNR.

screen-required = '1'.

modify screen.

endif.

Regards

Prabhu

Read only

0 Likes
610

hi,

before evrything try to understand the sequence ofa reprot programming.

thn next time u can solve ur issue by urself.

chk this.

First event -

Initialization : triggered when the report is loaded in memory.

At selection-screen output : triggered when the selection screen is loaded in memory before being displayed.

At selection-screen : before leaving the selection screen.

so where do u want to do the validaion.

ya in

At selection-screen

if c1 is not initial and KUNNR is initial.

give ur message.

endif.

hope u undrstud.

rgds

anver

if helepd mark points