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: 

keeping Validations in a user exit

Former Member
0 Kudos

Hi folks,

I am trying to keep some validations for attachments in ME51N Tcode. Before saving the document, system will check for the attachment.If it is empty it will prompt a error message saying its mandatory.After seeing the message when user attach the attachment and try to save the screen again it showing a system error.Can we use error message in the user exits.If not what is the alternative for that.Could any suggest me..

Thanks in advance,

Shyam.

3 REPLIES 3

former_member404244
Active Contributor
0 Kudos

HI,

U can use error messages in an user exit.. However as per ur issue it seems ur code is called twice ....Please see the okcode for the same..

When ever u press save button , u r validating....once ur validation is fine u should allow to save it...otherwise throw error message... Make sure that u satisf the conditions in the validation for saving..

Regards,

Nagaraj

0 Kudos

Hi Nagaraj,

Actually my code is calling only once. when i save it for the first time it throwing the custom error message.After making the corrections and again if we try to save then it showing the system error.

Thanks,

Shyam.

0 Kudos

HI,

If that is the case then put a break point in the code..While saving please debug and see why it is throwing error

Regards,

nagaraj