2021 Jun 21 3:28 PM
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?
2021 Jun 21 5:18 PM
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.
2021 Jun 22 10:01 AM
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.
2021 Jun 22 12:17 PM
MESSAGE 'Warning' TYPE 'W' DISPLAY LIKE 'W'.
Thanks,
Prashant