Application Development 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: 

maintaining paratmeter Obligatory and mandatory

Former Member
0 Kudos

Hi,

I have a select-option s1 and the parameter p1.

if select -option s1 is blank , then the parameter p1 needs to be obligatory, else if select-option s1 has some values ,then the parameter p1 needs to be mandatory.

how do i specify this conditions?

Any help is rewarded.

Regds

Gautam

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

Hi,

obligatory = mandatory, so I assume you want p1 to be obligatory when s1 is emtpy, and not obligatory when s1 is filled.

add a section like this in your code:

at selection-screen.
  if s1[] is initial and p1 is initial.
    message e...    (e.g. "please fill p1 when s1 is empty")
  endif.

6 REPLIES 6

Former Member
0 Kudos

Hi Gautam,

You cannot make the fields mandatory.

You have to write this logic as a CHAIN ENDCHAIN and then do your logic check. If one of them is not filled, put in the E message explaining one of the two has to be filled.

Regards,

Frank Umans

Former Member
0 Kudos

Is there anything like MANDATORY?

JozsefSzikszai
Active Contributor
0 Kudos

hi Gautam,

you have to check this in AT SELECTION-SCREEN event, but you have to rethink what do you want, obligatory and mandatory mean the same thing in my dictionary....

"the parameter <b>p1 needs to be obligatory</b>, else if select-option s1 has some values ,then the parameter <b>p1 needs to be mandatory</b>."

if you want p1 to be a must field all the time, than it is simple:

PARAMETERS : p1 TYPE ... OBLIGATORY.

hope this helps

ec

ThomasZloch
Active Contributor
0 Kudos

Hi,

obligatory = mandatory, so I assume you want p1 to be obligatory when s1 is emtpy, and not obligatory when s1 is filled.

add a section like this in your code:

at selection-screen.
  if s1[] is initial and p1 is initial.
    message e...    (e.g. "please fill p1 when s1 is empty")
  endif.

Former Member
0 Kudos

Hi,

i am sorry, i ment obligatory and optional.

sorry for inconvenience.

Regds

Gautam

former_member386202
Active Contributor
0 Kudos

Hi,

do like this

At selection-screen.

if s1 is initial.

message 'p1 is mandatory' type 'E'.

leave list-processing.

endif.

Regards,

Prashant