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: 

How to add new item in PO? BAPI_PO_CREATE1 ?

Former Member
0 Kudos
515

Hi Gurus,

I wanna add a new item in an existing PO, what BAPI can help me ?

I saw some information that BAPI_CHANGE can only change existing item, while adding a new item need to use BAPI_PO_CREATE1.

But when I use BAPI_CREATE1, it returns a new PO or shows that there is error in PO HEDADER.

the message shows that the new item need CO assignment but I did enter a wbs element in the new PO Account line.

10 REPLIES 10

Former Member
0 Kudos
170

Hi,

Please ref: this like will help you

<Link farm removed>

Regards/Ali

Message was edited by: Suhas Saha

Former Member
0 Kudos
170

Hi,

First you have to get the details for the PO using the bapi.

BAPI_PO_GETDETAIL

Then pass the data obtained from the above bapi to the BAPI_PO_CHANGE and pass the relevant item data to the structure...

Most of the structures in the above two bapi are same and hence you can directly pass/modify relevant field if required

Hope it wrks..

kesavadas_thekkillath
Active Contributor
0 Kudos
170

BAPI_PO_CHANGE ca be used to add a new line item.

In POITEM pass a unique no to PO_ITEM

In POITEMX pass this unique no to PO_ITEM and PO_ITEMX = X

Former Member
0 Kudos
170

thanks.

But I get an error message when assign CO objects to the new-added item.

It shows that there is no CO objects assigned to this item, But in fact it was.

The data is like the following: ( 00020 is new-added item )

item_no = 00010

serial_no = 01

wbs_element = P.2012-001

item_no = 00020

serial_no = 02

wbs_element = P.2012-001

item_no = 00010

serial_no = 01

item_nox = X

serial_nox = X

wbs_element = X

item_no = 00020

serial_no = 02

item_nox = X

serial_nox = X

wbs_element = X

0 Kudos
170

Try to add it through me22n and check if the error message populates, If it displays error then ask your functional consultant for help.

0 Kudos
170

no, the operation is ok in ME22N.

0 Kudos
170

Hi,

Please check if you fill  BAPIMEPOITEM-ACCTASSCAT.

Regards,

Pole

0 Kudos
170

Thanks.

But the AccAsscat was assigned P, and the indicator valued 'X'.

Is there any rule about the SERIAL_NO in the POACCOUNT?

0 Kudos
170

Please check in ME21N , fill the item as the same in your program , and then go to item detail, tab"account assigment", see if any GL account or cost center was auto-determinated by the system, if yes, fill the same GL account or cost center in your program.

0 Kudos
170

thanks Pole li.

I tried this also.

Someone said this is the code error of BAPI, and can be correct by modify the SAP code.

But there is no more detail about how to modify it.