Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error Message in User Exit

Hi,

I have written an user exit (program 'MV45AFZZ') ( user exit 'FORM USEREXIT_SAVE_DOCUMENT_PREPARE'). Here I want to give an error message (before save the doc) if the user did enter the correct order reason. It is giving error message properly but during the message system is showing all the fields (VA01) in display mood.After displaying the error message when user press enter system should be able to show Order Reason field as input parameter not display parameter. Pls suggest how to handle this situation. Code is given below :

-


if xvbak-auart = 'ZFRE'.

IF XVBAK-VKORG = TVAUK-VKORG AND

XVBAK-VTWEG = TVAUK-VTWEG AND

XVBAK-SPART = TVAUK-SPART AND

XVBAK-AUDAT GT TVAUK-DATAB.

if xvbak-augru ne tvauk-augru.

SET CURSOR FIELD 'VBAK-AUGRU'.

message E000(zsd01) with

'Please select correct Order Reason'.

exit.

endif.

ELSE.

SET CURSOR FIELD 'VBAK-AUGRU'.

message e000(zsd01) with

'Please select correct Order Reason'.

ENDIF.

ELSE.

if xvbak-augru eq tvauk-augru.

SET CURSOR FIELD 'VBAK-AUGRU'.

message E000(zsd01) with

'Please select Order Reason not assigned to Cost Center'.

endif.

ENDIF.

-


Thanks,

Pradeep

Tags:
Not what you were looking for? View more on this topic or Ask a question