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: 

How to display error message in selection screen or in same screen in sap oops concept.

former_member846556
Discoverer
0 Kudos
269

I have an input field as date range, In that input field, If I give incorrect date or data not found on the date means, It should throw an error called ' Data not found', It is coming but Error was showing in the next page, It is not showing on the selection screen itself.

The error message should come in the selection screen itself.

Please do needful.

Thanks.

3 REPLIES 3

matt
Active Contributor
196

How about sharing the relevant code. Use the CODE button in the editor to nicely format it.

raymond_giuseppi
Active Contributor
196

Execute the checks and first selection of data in some AT SELECTION-SCREEN event and not in the START-OF-SELECTION block. For performance only execute some tests when user click on execution

AT SELECTION-SCREEN ON SO_DATE.
  IF SSCRFIELDS-UCOMM EQ 'ONLI'  " only process when execution 
OR SSCRFIELDS-UCOMM EQ 'PRIN'. " required, not when ENTER SELECT * FROM SOMETABLE INTO TABLE SOMEITAB WHERE DATE IN SO_DATE. IF SY-SUBRC NE 0. MESSAGE 'Data not found' TYPE 'E'. ENDIF. ENDIF.

Blume
Advisor
Advisor
0 Kudos
196

Additionally to Matthew's comment, let us know in case you are referring to any document for this.