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

select-options

Former Member
0 Likes
1,045

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
995

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.

10 REPLIES 10
Read only

Former Member
0 Likes
995

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

Read only

Former Member
0 Likes
996

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.

Read only

Former Member
0 Likes
995

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.

Read only

0 Likes
995

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

Read only

0 Likes
995

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.........

Read only

Former Member
0 Likes
995

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

Read only

Former Member
0 Likes
995

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.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
995

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

Read only

Former Member
0 Likes
995

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..........

Read only

Former Member
0 Likes
995

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