Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change PO doc type at the time PO creation w.r.t PR numbers

jayasankar_goud3
Explorer
0 Kudos
405

Hi Friends,

I have a problem to find out the exact Exit/BADI/Enhancement Spot to change PO type 'NB' to other PO type when at the time of PO creation (ME21N)

w.r.t PR number.

After entering PR number in ME21N item row and user click enter then the data will be fetched from PR and based on item catagory indicator that PO doc type has to be changed as per his requirement.

Suppose if the item category of PR is 'S" then PO doc type has to be changed from 'NB" to other PO doc type.

So here getting error change PO type to other. if we change manually that issue will resolve.

For that checking Exit/BADI/Enhancement Spot to change PO doc type,after entering PR and click enter.

If any one having idea to find out exact Exit/BADI/Enhancement Spot to complete this requirement please let me know.

Thanks & Regards,

Goud

2 REPLIES 2

RaymondGiuseppi
Active Contributor
0 Kudos
226

Try now classic BAdI ME_PROCESS_PO_CUST.

Hint: you can handle the event in  PROCESS_ITEM method comparing results of GET_DATA and GET_PREVIOUS_DATA, then get reference to header with IM_ITEM->GET_HEADER, and use GET/SET_DATA on header reference to update header. (Only use SET_DATA when you actually change some value to prevent endless loop even if SAP monitors it)

Regards,

Raymond

Former Member
0 Kudos
226

Hi Jayasankar,

Try using BADI ME_PROCESS_PO_CUST.

Regards,

Swati