Application Development and Automation 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: 
Read only

Display Error Message In Same Screen?

Former Member
0 Likes
17,181

Dear Abapers,

                        I am displaying a error message in info type 6 like 'PLEASE MAINTAIN THE CORRECT BUS ROUTE' but message is displaying in empty screen and again i need to come back to 'PA30' Tcode i want error message to be displayed on same info type screen i.e. on info type 6.

I have tried these methods

                                         1.message 'Please Enter Correct Bus Route' Type 'E'.

                                         2.message 'Please Enter Correct Bus Route' Type 'I' Display Like 'E'.

                                         3.message 'Please Enter Correct Bus Route' Type 'S' Display Like 'E'.

                                              But nothing of the above method are working please suggest me the perfect solution.

8 REPLIES 8
Read only

asim_isik
Active Participant
0 Likes
5,545

Hi Matala ,

Have you tried below code ;

message 'Please Enter Correct Bus Route' Type 'E' Display Like 'I'.

leave list-proccesing.

Read only

Former Member
0 Likes
5,545

It's Not working Bro the screen coming back to PA30 main screen from infotype 6.

Read only

Former Member
0 Likes
5,545

Hi,

Try this

message 'Please Enter Correct Bus Route' Type 'I' Display Like 'E'.

Leave to screen 0.



or


message 'Please Enter Correct Bus Route' Type 'I' Display Like 'E'.

leave to transaction 'PA30'.


R

Read only

asim_isik
Active Participant
0 Likes
5,545

where did you write the code ? Is it HRPBAS01 exit ?

Read only

Former Member
5,545

Hi,

Basic functionality of the Error messages in SAP is to throw the error message and stop the current processing and leave. So if you are using the below statements

  1.message 'Please Enter Correct Bus Route' Type 'E'.

  2.message 'Please Enter Correct Bus Route' Type 'I' Display Like 'E'.

  3.message 'Please Enter Correct Bus Route' Type 'S' Display Like 'E'.

The above statements will not work.

Better you can try with the following statement :

MESSAGE I(208) WITH 'Please Enter Correct Bus Route'.

STOP.

Above statement will show message in pop up and will return to your previous screen. No further processing will be done.

Thanks.

Regards,

Suniel.

Read only

0 Likes
5,545

Thank you so much for your answer.

Read only

5,545

For this, you can try like this.

MESSAGE 'Input is not valid' TYPE 'S' DISPLAY LIKE 'E'.
STOP.

This solution has worked for me. It displays the error message and stays on the same screen.

Read only

0 Likes
5,545

Thank you so much for your answer. It worked for me.