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

Problem with ERROR MESSAGE

Former Member
0 Likes
1,251

Hi,

i need some help plz,

i'm working in a user exit for transaction va41, the goal is to right an error message if the user tries to create more than one OTP element in the same Order of sale. Here is my program:


DATA : BEGIN OF EOTP OCCURS 0,    
        OTP TYPE  vbap-PS_PSP_PNR,
        END OF EOTP.
DATA : BEGIN OF NOTP OCCURS 0,    
       OTP TYPE  vbap-PS_PSP_PNR,
       END OF NOTP.


LOOP AT xvbap. 
APPEND xvbap-PS_PSP_PNR TO EOTP.
APPEND xvbap-PS_PSP_PNR TO NOTP.

delete ADJACENT DUPLICATES FROM notp.


describe table eotp lines no_lines.
describe table notp lines n_lines.

if no_lines <> n_lines.

   MESSAGE W011(zmap)  DISPLAY LIKE 'W'.

endif.

The problem is: when it writes the error message in the va41, it throws me out of the transaction.

How can i avoid that? i would like to be able to change the OTP without having to set again the order of sale.

thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,109

try with the syntax

MESSAGE E 011(zmap) .

5 REPLIES 5
Read only

Former Member
0 Likes
1,110

try with the syntax

MESSAGE E 011(zmap) .

Read only

0 Likes
1,109

Hi,

Use E in place of W

E for error

and W is used for warning

first u deside which type of message u want to display than use the letter.

Thanks & Regards,

D T K

Read only

0 Likes
1,109

hi,

i did that, but it doesn't work

Read only

Former Member
0 Likes
1,109

the pb was the place of the progrm in the user exit

At first i wrote the program in FORM USEREXIT_SAVE_DOCUMENT.

Then i moved it to FORM USEREXIT_SAVE_DOCUMENT_PREPARE and now it's all right.

thanks all for seeing my pb,

Read only

0 Likes
1,109

hi,

i also using the exit(USEREXIT_SAVE_DOCUMENT_PREPARE) to loop through the xlips table and do a checking upon user click the PGR button in VL02N.

When i want to throw a error message with message e001(zxxx). it does not throw to the standard error log screen we have in the vl01n/vl02n. (the one which prompt up when we don't key in location,pick qty, batch...etc)

it simply throw the error message at the bottom bar of the screen. And once i click any button in screen, it will throw another error message "Risk of posting several mat.documents for one delivery->long text" and exit from the transaction.

Please advise how to avoid this and get the standard error log screen.

thanks.