‎2006 Sep 19 5:13 AM
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??
‎2006 Sep 19 5:17 AM
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.
‎2006 Sep 19 5:17 AM
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
‎2006 Sep 19 5:17 AM
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.
‎2006 Sep 19 5:18 AM
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.
‎2006 Sep 19 5:19 AM
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
‎2006 Sep 19 5:51 AM
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