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

VA01 USER EXIT PROBLEM

Former Member
0 Likes
800

When I used the EXIT in PRG ‘MV45AFZZ ’,

FORM USEREXIT_SAVE_DOCUMENT,

“READ TABLE XVBKD WITH KEY "VBELN = YVBAK-VBELN

POSNR = '000000'.

IF SY-SUBRC = 0 AND XVBKD-IHREZ IS INITIAL.

MESSAGE ID 'ZSDBCD' TYPE 'E' NUMBER '014' .

EXIT.

ENDIF.”

if the condition is ringht ,the display the message,but can not jump form the form,so display the message always,what can i do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
742

Hi,

Try doing like this:

FORM USEREXIT_SAVE_DOCUMENT,

“READ TABLE XVBKD WITH KEY "VBELN = YVBAK-VBELN

POSNR = '000000'.

IF SY-SUBRC <> 0 AND NOT XVBKD-IHREZ IS INITIAL.

EXIT.

ELSE.

MESSAGE ID 'ZSDBCD' TYPE 'E' NUMBER '014' .

ENDIF.”

Hope this helps!!!

Regards,

Krithiga.

6 REPLIES 6
Read only

Former Member
0 Likes
742

Hi,

Remove EXIT statement.

Hope this helps you. Reply for queries, shall post the updates.

Regards.

Kumar.

Read only

Former Member
0 Likes
742

it did not work use the method.

Read only

Former Member
0 Likes
743

Hi,

Try doing like this:

FORM USEREXIT_SAVE_DOCUMENT&#65292;

“READ TABLE XVBKD WITH KEY "VBELN = YVBAK-VBELN

POSNR = '000000'.

IF SY-SUBRC <> 0 AND NOT XVBKD-IHREZ IS INITIAL.

EXIT.

ELSE.

MESSAGE ID 'ZSDBCD' TYPE 'E' NUMBER '014' .

ENDIF.”

Hope this helps!!!

Regards,

Krithiga.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
742

Hi,

When you raise an error message the control will not goto the next statement after the Error message.

So if you want to exit and still want the message to appear your message type 'S'.

READ TABLE XVBKD WITH KEY "VBELN = YVBAK-VBELN

POSNR = '000000'.

IF SY-SUBRC = 0 AND XVBKD-IHREZ IS INITIAL.

MESSAGE S014(ZSDBCD).

EXIT.

ENDIF

Regards,

Sesh

Read only

Former Member
0 Likes
742

Hi,

You may use FORM USEREXIT_SAVE_DOCUMENT_PREPARE instead of FORM USEREXIT_SAVE_DOCUMENT if possible.

Regards

Raju Chitale

Read only

0 Likes
742

Some condition must judge by item ,and use Save_prepare ,the same not work