In VA01, If the purchase order and purchase order item is blank then error message will be displayed for the user to input these values .
I have writtwen below code in MV45AFZZ, USEREXIT_SAVE_DOCUMENT_PREPARE. The problem is that when purchase order or purchase order item is not entered, the field is greyed out . Please suggest
If VBAK-BSTNK is initial.
message e000(ZMSG). " Enter Purchase Order
ELSE.
Read table xvbap with key POSEX = ' '.
* If VBAP-POSEX is initial.
IF sy-subrc = 0 .
SHIFT xvbap-POSNR LEFT DELETING LEADING '0'.
message e001(ZMSG) with xvbap-POSNR . " In Order data Tab, Enter Purchase order item
ENDIF.
ENDIF.