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 obligatory

Former Member
0 Likes
1,334

HI,

I have two select options fields. at initial stage both r optional. for example matnr and werks.

in selection screen if user enetered matnr then werks shud be obligatory.

i tried with at selection-screen output. but it is making werks obligatory only when i press enter after entering matnr.

if there any other way to do it?

Regards

Giri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,170

Hi Giri,

I am not aware any other way.

Basically, you need to press enter in order to execute at selection-screen output event.

Regards,

Ferry Lianto

Hi Giri,

I am not aware any other way.

Basically, you need to press enter in order to execute at selection-screen output event.

Regards,

Ferry Lianto

7 REPLIES 7
Read only

Former Member
0 Likes
1,170

U can use variations in AT SELECTION-SCREEN event..I think that is the only way !!

Regards

Anurag

Read only

Former Member
0 Likes
1,171

Hi Giri,

I am not aware any other way.

Basically, you need to press enter in order to execute at selection-screen output event.

Regards,

Ferry Lianto

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,170

You can not use the OBLIATORY extension, if you want to turn the functionality on/off at runtime. You need to check the values in the AT SELECTION-SCREEN event manually.

at selection-screen.

  if  not s_matnr[] is initial.
      and s_werks[] is initial.
          message e001(00) with 'Please enter plant'.
  endif.

Regards,

Rich Heilman

Read only

0 Likes
1,170

hI RICH,

i already did with At selection-screen.

i just want to know is it possible with At selection-screen output. So the user knows immediately by seeing check in werks field after entering the matnr.

Regards

Giri

Read only

Former Member
0 Likes
1,170

Hi giri,

Obviously the validation will work only when press enter or execute key , without pressing enetr the event will not trigger.

you have to write the validation in AT SELECTION-SCREEN and when u press execute or enter this will get triggered

AT SELECTION-SCREEN.

  if s_matnr[] is not initial.
     if s_werks[] is initial.
       * trigger error message her
     endif.
endif.

Read only

Former Member
0 Likes
1,170

Giri,

I believe what you are trying to achieve is that as soon as users enters something in Material Number field, the mandatory-entry checkmark should appear in Plant field WITHOUT user pressing any other key (ENTER etc).

This is not possible in SAP GUI. You would have to press some function or enter-key to send the screen control to ABAP code for the program to figure out whether to make Plant field mandatory or not. Taking action as soon as user enters something in Material Number and presses Tab key etc - it is possible in Oracle using triggers etc or in NetWeaver screens using Java, but not in SAP GUI.

Hope that clearly explains your query.

Regards,

Chetan

Read only

Former Member
0 Likes
1,170

Hi,

AT SELECTION-SCREEN is the best place to do..Because if the user enters material and without pressing enter key..If he presses F8..Then the AT SELECTION-SCREEN OUTPUT will not be triggered..

Thanks,

Naren