2007 Jun 27 8:06 AM
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?
2007 Jun 27 12:46 PM
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.
2007 Jun 27 8:36 AM
Hi,
Remove EXIT statement.
Hope this helps you. Reply for queries, shall post the updates.
Regards.
Kumar.
2007 Jun 27 9:54 AM
2007 Jun 27 12:46 PM
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.
2007 Jun 27 12:51 PM
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
2007 Jun 27 12:54 PM
Hi,
You may use FORM USEREXIT_SAVE_DOCUMENT_PREPARE instead of FORM USEREXIT_SAVE_DOCUMENT if possible.
Regards
Raju Chitale
2007 Jun 28 4:47 AM
Some condition must judge by item ,and use Save_prepare ,the same not work