‎2007 Jun 11 11:20 AM
Hi,
i have two select-options. could any one tell me how to make one select-option obligatory if the other select-option is empty . i mean if one of the select-option is empty then compulsorily i have to make the other select-options as obligatory.
thanks and regards
reena
‎2007 Jun 11 11:26 AM
Hi,
TABLES:kna1.
SELECT-OPTIONS:s_land FOR kna1-land1,
s_kunnr FOR kna1-kunnr.
AT SELECTION-SCREEN.
IF s_land IS INITIAL AND s_kunnr IS INITIAL.
MESSAGE w000(zz) WITH 'Enter value in atleast one select-option'.
stop.
ENDIF.
‎2007 Jun 11 11:24 AM
hi,
try this
if select-option1 is initial.
if select-option2 is initial.
give error message with ' you have to enter either one '.
endif.
endif.
reward points if helpful
regards,
venkatesh
‎2007 Jun 11 11:26 AM
Hi,
TABLES:kna1.
SELECT-OPTIONS:s_land FOR kna1-land1,
s_kunnr FOR kna1-kunnr.
AT SELECTION-SCREEN.
IF s_land IS INITIAL AND s_kunnr IS INITIAL.
MESSAGE w000(zz) WITH 'Enter value in atleast one select-option'.
stop.
ENDIF.
‎2007 Jun 11 11:27 AM
hi reena,
sopt1 n sopt 2 are two select options.
then
if sopt1 is initial and screen-name = 'sopt2'.
screen-required = 1.
modify screen.
else.
if sopt2 is initial and screen-name = 'sopt1'.
screen-required = 1.
modify screen.
endif.
if helpful reward some points.
with regards,
suresh.
‎2007 Jun 11 11:34 AM
Hi Suresh ,
u mean should i creat two diff screens for this . please can u be clear on this . here is my mail id . meetreenadorthy@gmail.com
thanks
reena
‎2007 Jun 11 11:48 AM
Hi reena
suresh answer is right, it does not mean that you have to create two screen.
in event at selection screen output one internal table name screen is formed . it contains all the content of selection screen like select-options, parameters, checkbox. radio button etc.
now if you have to validate it. you have use loop at screen in event at selection screen output . in your case you are modifying screen table using two select-options.
regards,
Ruchika
reward if useful.........
‎2007 Jun 11 11:31 AM
hi,
let us suppose
two select options
tables : t001,bkpf.
SELECT-OPTIONS: s_bukrs for t001-bukrs, "Company Code
s_belnr for bkpf-belnr. "Document No
at selection-screen on s_bukrs.
if s_belnr is initial.
while s_bukrs is initial.
message e001(zdev).
endwhile.
endif.
at selection-screen on s_belnr.
if s_bukrs is initial.
while s_belnr is initial.
message e001(zdev).
endwhile.
endif.
check this
‎2007 Jun 11 11:32 AM
HI,
see thi simple code.
PARAMETERS:a(10).
PARAMETERS:b(10).
write:/ a,b.
AT SELECTION-SCREEN on A.
LOOP AT SCREEN.
if screen-name = 'B' and A is initial.
screen-REQUIRED = '1'.
MODIFY SCREEN.
endif.
ENDLOOP.
rgds,
bharat.
‎2007 Jun 11 11:38 AM
Hi,
SELECT-OPTIONS: opt1 for xxx2,
op2 for xxx1.
DATA: flag.
you have to put codel like this.
AT SELECTION SCREEN ON opt1-low and opt1-high.
if opt1-low is initial and opt-high is initial.
flag = 'X'.
else.
clear flag.
endif.
AT SELECTION-SCREEN OUTPUT.
if flag = 'X'.
loop at screen.
if screen-name = 'OPT2-LOW' or 'OPT2-HIGH'.
screen-required = '1'.
modify screen.
endloop.
Regards,
Sesh
‎2007 Jun 11 11:50 AM
Hi, like this
sopt1 n sopt 2 are two select options.
then
at selection-screen output.
loop at screen.
if sopt1 is initial and screen-name = 'sopt2'.
screen-required = 1.
modify screen.
else.
if sopt2 is initial and screen-name = 'sopt1'.
screen-required = 1.
modify screen.
endif.
endloop.
regards,
Ruchika
reward if useful..........
‎2007 Jun 11 11:53 AM
Hi Reena,
You can put the condition at the event 'AT SELECTION SCREEN OUTPUT'. This event is called everytime before the screen is displalyed. Just check the condition and give the error message if condition not met.
Hope it helps.
Regards,
Johnny