Skip to Content
0
Former Member
May 14, 2008 at 01:44 PM

Tax code check in ME59n

295 Views

Hi everyone,

I have a requirement where while creating POs using the transaction ME59n i have to check for thetax code field and see if it is blank for particular company codes and item categories. If it is blank then i have to stop the creation of the PO and display and error message. I have written the code in User exit EXIT_SAPMM06E_016 and the transaction does not create the PO when tax code is left empty, but the problem is now i am getting an Update termination error after the transaction has completed executing. The update error occurs even when there is no tax code error below is the code i have written in the exit and also the update error. please advice on how to proceed, or if there is any other way to do this. Waiting for your replies.

Thank you all.

IF sy-tcode = 'ME59'.

IF i_ekpo-bukrs EQ '0967' OR

i_ekpo-bukrs EQ '0968' OR

i_ekpo-bukrs EQ '1098' OR

i_ekpo-bukrs EQ '1120'.

IF NOT ( i_ekpo-pstyp EQ '2' OR

i_ekpo-pstyp EQ '7' OR

i_ekpo-pstyp EQ '6' ).

*If tax code field is empty give error

IF i_ekpo-mwskz EQ space.

SET CURSOR FIELD 'EKPO-MWSKZ'.

MESSAGE e000(ZTMM_FRTINV) WITH 'Please enter TAX Code'.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

update error

Update was terminated

System ID.... TB1

Client..... 510

User..... SHETTYVK

Transaction.. ME59

Update key... 48289310AFFC200B020000009974F230

Generated.... 14.05.2008, 13:34:57

Completed.... 14.05.2008, 13:34:57