Skip to Content

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

User Exit for ME21n

Dear all,

I have some problems with ME21n for MM user exits.

I create a customized table to store user name, company code, order type, and purch. group.

User Exit used is

EXIT_SAPMM06E_006

Using the customised table, system will automatically defaulted the purchasing group for the user for Purchase Order.

Only users in the customised table are allowed to create Purchase Order

I able to run my written code in the above user exit, however, the value output for purchasing group is still the value that i key in. I want the value change according the value in the customized table

CODE SAMPLE

if i_cekko-bukrs = 'XXXX'.

if i_cekko-bsart ne 'XXXX'.

MESSAGE e000(ZMM).

else.

clear itab.

select * from XXXX INTO CORRESPONDING FIELDS OF itab

where uname = sy-uname.

  • and ekgrp = i_ekko-ekgrp.

endselect.

if sy-subrc ne 0.

MESSAGE e001(ZMM).

else.

  • clear itab.

  • select * from XXXXX INTO CORRESPONDING FIELDS OF itab

  • where uname = sy-uname

  • and ekgrp = i_ekko-ekgrp.

  • endselect.

  • if sy-subrc ne 0.

  • MESSAGE w002(ZMM) WITH itab-ekgrp.

  • i_ekko-ekgrp = itab-ekgrp.

  • else.

e_cekko-ekgrp = itab-ekgrp.

  • endif.

endif.

endif.

Anyone know the solution? What user exits is more suitable?

Pls help

Thanks

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