2014 Mar 12 1:51 PM
Hi Experts,
As there are 2 options to get the input from the user. When I use select options because I need to make the field mandatory, it displays the output(blank) whenever there is no input/irrelevant input. When I use parameters, I cannot make it mandatory.
I need to display text boxes in the selection screen which should be mandatory and should only proceed when the user enters relevant data.
Please note that I have put the validation in the select options for a field like month as:
if s_month-low > '12' or s_month < '1'.
MESSAGE 'Please enter a valid month' type 'E'.
endif.
but for a id, there is a search help. If the user do not enter the value from a search help, it displays the blank output. How to put validation on this?
Regards
Mani
Hi Experts,
As there are 2 options to get the input from the user. When I use select options because I need to make the field mandatory, it displays the output(blank) whenever there is no input/irrelevant input. When I use parameters, I cannot make it mandatory.
I need to display text boxes in the selection screen which should be mandatory and should only proceed when the user enters relevant data.
Please note that I have put the validation in the select options for a field like month as:
if s_month-low > '12' or s_month < '1'.
MESSAGE 'Please enter a valid month' type 'E'.
endif.
but for a id, there is a search help. If the user do not enter the value from a search help, it displays the blank output. How to put validation on this?
Regards
Mani
2014 Mar 12 2:31 PM
Hi Mani,
You could use a list box to select values.
You can also have a AT SELECTION SCREEN on S_ID.
In this event, check if the ID lies in the check table. In case it doesn't, you can raise an error. The system will generate an error and the control will still be on the ID field for a valid value.
Let me know if it helped.
Thanks,
Anupam
2014 Mar 12 2:50 PM
Oi Mani
PARAMETERS: p_carrid TIPO spfli-carrid.
At selection screen ON-SCREEN p_carrid.
(Here you write your validation)
SEE THIS LINK
https://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
2014 Mar 12 2:59 PM
Hi Mani,
You can do a validation at AT Selection Screen.Basically it will do a select single and try to fetch any line item.
A sample example as follows..
At Selection-Screen on S_DATE.
if S_date is not initial.
Perform validatedate.
Endif.
Form Validatedate.
Select single date
from DB table
where date in S_date.
endform.
if Sysubrc ne 0.
MESSAGE 'Please enter a valid month' type 'E'.
endif.
Regards,
Kannan
2014 Mar 12 3:01 PM
Use below code
at selection on s_selection_option.
*"Write logic to validate selet option data.
Or if you want that if user has not entered anything and you want to select complete data then check select option before select.
If s_id IS NOT INITIAL .
select * from sflight INTO table it_sflight where field1 IN s_id .
ELSE.
select * from sflight INTO table it_sflight .
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |