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: 

Regarding selection screen

Former Member
0 Kudos

Hi all,

I have two parameters in the selection screen lets say p_name and p_number.

these are not obligatory parameters.

If I enter a value in the parameter p_name then the parameter p_number must become mandatory that is obligatory.

how can i do this?

Regards,

shravan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi shravan,

<b>

Just copy and paste this code........to get your desired functionality</b>

PARAMETERS:

P_NAME(30) TYPE C,

P_NUMBER TYPE I.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_NUMBER' AND P_NAME IS NOT INITIAL.

SCREEN-REQUIRED = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

<b>

I am Sure that your problem is solved.Bcz, I test this in my SAP sytem.</b>

<b>

Reward all helpful answers.</b>

Regards,

V.Raghavender.

9 REPLIES 9

Former Member
0 Kudos

Hi,

In the AT selection-screen Event write the code such that it asks for other field to enter when data is entered in one field.

if not p_name is initial.

if p_number is initial.

message e000 with 'Enter the number'.

endif.

endif.

reward if useful

regards,

ANJI

Former Member
0 Kudos

Hi,

You can do this,

At-selection-screen event you juz loop at screen.

If the first parameter is not blank then make the second one as mandatory >if the user tries to execute ,then give some error message.

Former Member
0 Kudos

well by Hand

in your program you need to check wheter if the first field is filled, if the second field is filled as well.

if not reprocess selection screen, if you like with an additional status message promting the user to fill either none or both your fields.

Former Member
0 Kudos
TABLES : SSCRFIELDS.
parameters : p_field1 like ztable-field1,
                   p_field2 like ztable-field2.


at selection-screen.
CHECK SSCRFIELDS-UCOMM = 'ONLI'.
if not p_field1 is initial.
   if p_field2 is initial.
          message e001...........
   endif.
endif.

Former Member
0 Kudos

Hi Shravan,

In the <b>At selection screen output</b> , change the p_number attrubute to mandataour once you enter p_name. You can access these information using Screen information table and there you can make the changes.

I hope you got an idea. Right?

Warm Regards,

Vijay

Former Member
0 Kudos

parameters: p_name(10) type c,

p_num(10) type n modif id GD1.

at selection-screen output.

loop at screen.

if not p_name is initial.

if screen-group1 = 'GD1'.

screen-required = 1.

else.

screen-required = 0.

endif.

endif.

endloop.

Former Member
0 Kudos

Hi Shravan,

If you dont want to give any message and just wants to make it obligatory then at selection-screen event write LOOP at SCREEN and then make input mandetory in SCREEN table.

Reward if useful.

Former Member
0 Kudos

Use At-selction screen.

if not p_name is initial.

check p_number is initial.

error message

endif.

Former Member
0 Kudos

Hi shravan,

<b>

Just copy and paste this code........to get your desired functionality</b>

PARAMETERS:

P_NAME(30) TYPE C,

P_NUMBER TYPE I.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_NUMBER' AND P_NAME IS NOT INITIAL.

SCREEN-REQUIRED = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

<b>

I am Sure that your problem is solved.Bcz, I test this in my SAP sytem.</b>

<b>

Reward all helpful answers.</b>

Regards,

V.Raghavender.