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: 

User-Exit: Show an error Message and go to specified screen field

Former Member
0 Kudos
227

Hi All,

I need to trigger an error message when a field does not contain a specified value and move the processing to the specified screen-field while saving a Vendor using User-Exit: EXIT_SAPMF02K_001.

Please advice how to achieve going from user -exit to screen-field.

Thanks in advance.Jr.

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos
55

No you can't move the cursor to the field, just send the error message. The message needs to mention the field name so that the user knows what is the problem.

There is an old and deprecated technology which is called field exit (Note 29377 - FAQs: field exits + search the forum) that would answer your question, but I don't advise you to use it.

Former Member
0 Kudos
55

Hi,

After error message, you can move the cursor to the specific field by using the statement

SET CURSOR FIELD 'Field name'.

Regards,

Aravind J M

0 Kudos
55

Aravind is right, I apologize for my bad answer! I made this little program which changes the position to P_Y screen field and sends the error message (do it in this sequence of course):

REPORT  Z_ERROR_MESSAGE_AND_CURSOR.
parameters p_x type c.
parameters p_y type c.
at selection-screen.
  if p_x = 'B'.
    set cursor field 'P_Y'.
    message e001(00) with 'error on P_Y'.
  endif.