04-20-2007 10:10 AM
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
04-20-2007 10:22 AM
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.
04-20-2007 10:12 AM
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
04-20-2007 10:13 AM
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.
04-20-2007 10:14 AM
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.
04-20-2007 10:14 AM
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.
04-20-2007 10:14 AM
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
04-20-2007 10:17 AM
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.
04-20-2007 10:17 AM
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.
04-20-2007 10:18 AM
Use At-selction screen.
if not p_name is initial.
check p_number is initial.
error message
endif.
04-20-2007 10:22 AM
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.