Application Development 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: 

add a new line item in existing PO once we add a new item in SO in VA02

0 Kudos
1,080

Hi Experts,

We developed an automation process for third party orders. i.e., Once we create the SO it is automatically creating the PR and with that PR we have used Z-copy of me59n program to convert the open PRs into POs in SO user-exit.

Now the requirement is if the user added a new line item in SO through VA02, that item is adding into existing PR but a new PO is generating. We need to add it in existing PO. I tried with BAPI_PO_CHANGE but I can not able to achieve it.

Anyone worked on the same ?Please help.

Thanks,

Geetha.

7 REPLIES 7

SimoneMilesi
Active Contributor
0 Kudos
370

How your z-copy is called? Under which circumstances?

How the update code looks like?

Without any detail at all, we can only shot in the dark and guess, not help you.

0 Kudos
370

in the exit USEREXIT_REFRESH_DOCUEMENT Iam calling the Z-program as below.

submit ZMM_RM06BB30

with s_ekgrp = 'XXX'

      s_ekorg = 'XXXX'

     s_flief = 'XXXX'

    s_werks = 'XXXX'

   p_gbanfn = 'X'

0 Kudos
370

I think I was not clear enough but I do not know how to explain better

You have to give us all the relevant informations in order to get any valueable help.

For what I know your ZMM_RM06BB30 has only one line with "write:/1 'dummy'."

How do you retrieve the SO data? (calling a massive report for each SO is crazy!)

How do you fill the BAPI's structures?

And so on.

0 Kudos
370

Hi Simone,

I mentioned that its a Zcopy of ME59N(Automatic conversion of PR into PO) program and Iam calling this in user-exit of VA01/VA02 under some conditions (particular vendor, plant, pur,group,pur.org etc) for third party orders. PO creation is worked fine and went into production.

Now the new requirement is if we can add a new line item to SO through VA02, same line item should be automatically added to PO.

0 Kudos
370
We need to add it in existing PO. I tried with BAPI_PO_CHANGE but I can not able to achieve it.

What did you try?! That poor BAPI, how and where and when it's called?!

0 Kudos
370

Hi Simone,

Iam calling it in the same exit with sy-tcode = 'VA02'. In this exit I have the new item data of PR and SO. Through EBAN data Iam checking EKPO whether the PO line item exists or not. If not then Iam passing the data to the structures of BAPI_PO_CHANGE

poitem,poitemx,poaddrdelivery,poaccount,poaccountx,extensionin

JL23
Active Contributor
0 Kudos
370

you should read the OSS note 550192 - FAQ: Changing third-party items and individual purchase order items