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: 

Message error in standard screen but after error screen allow to continue.

0 Kudos
1,856

Hi. I want to give a error with message in a standard screen F-02.

MESSAGE 'Error' TYPE 'I' DISPLAY LIKE 'E'.

"When used this message but this one allows to continue to next screen.

MESSAGE 'Error' TYPE 'I' DISPLAY LIKE 'E'.

"When I used this one, this one locks the field which I want user to change.

"Then I used STOP keyword but program crashed.
"Then I used LEAVE TO CURRENT BLAH BLAH but then It goes screen to start screen.  

I want to give message like type 'E' but it locks field. What can I do?

3 REPLIES 3

Sandra_Rossi
Active Contributor
1,257

Sorry, both statements are identical. But I guess the second statement is:

MESSAGE 'Error' TYPE 'E'.

If it doesn't work, probably it's because you don't trigger your message at the right moment. It's only in the PAI of the screen where the screen field is, that you can send the error message.

former_member736527
Active Participant
0 Kudos
1,257

If you want users to be able to change the fields after error, then you need to include those fields in the CHAIN-ENDCHAIN block. Below link might help you.

https://answers.sap.com/questions/3782316/what-is-chain-and-endchain.html

If it is an ABAP report with normal SELECTION-SCREEN event, then you'd need to specify the fields in the AT SELECTION-SCREEN event. Below link will help you.

https://answers.sap.com/questions/4407481/regarding-the-event-at-selection-screen-on-field-.html

Considering you want this in standard tcode F-02, I am guessing you will have to go with the first option. Although, since it IS a standard tcode, I am assuming you are doing it through some customer exits or BAdIs? In that case, it depends on the implementation. For example, in PO BAdI, the VALIDATE method has a certain way of passing error message to SAP screen; it is not done through a simple MESSAGE statement. If you are using a BAdI, go through the documentation on how to implement validations.

Prashant_Patil
Participant
0 Kudos
1,257

MESSAGE 'Warning' TYPE 'W' DISPLAY LIKE 'W'.

Thanks,

Prashant