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: 

Using BAPI_PO_CHANGE to update PO with item actegory B

Former Member
0 Kudos

Hi Experts,

I have a requirement to update the PO with item category B which is created by referring PR having account assignment category N(.( So I have a PO with Acc assignment N now have to update the item category with B ). I am using BAPI_PO_CHANGE to update the item category with B .in me22n system will prompt the Limits ( overall limit , expected value) and Network details ( like GL acc and Network and activity code) so i am passing lt_poitem,lt_poitemx,lt_polimits,lt_poaccount,lt_poaccountx,lt_POSRVACCESSVALUES. System is issuing a message Buffer table is not up-to-date . Please let me know if any one updated the PO with item category B using BAPI_PO_CHANGE and please provide sample code for the same if possible. Thanks in advance.

Thanks

Pravee

5 REPLIES 5

Former Member
0 Kudos

Hi,

Try changing the purchase order for the same set of data in ME22N and check whether you are getting the same message.

If so then check the below mentioned SAP notes.

SAP Note 872825 - Message SE001 in Transaction ME22N/ME23N (PO from PReq)

SAP Note 786736 - General problems in purchase order with reference documents

Regards,

Harish

0 Kudos

Hi Harish,

Thanks for your reply. I am able to update the PO with item category B and network details successfully in ME22n. The issue that i am facing is with BAPI. I am not able to change the document. It would be great if someone provide the code where you have updated the limits/item category with B using the BAPI_PO_CHANGE.

Thanks

Pravee.

0 Kudos

Hi Experts,

I am passing the required structure as below .

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = v_po

TABLES

return = lt_return

poitem = lt_poitem

poitemx = lt_poitemx

polimits = lt_polimits

poaccount = lt_poaccount

poaccountx = lt_poaccountx

POSRVACCESSVALUES = lt_POSRVACCESSVALUES

POCONTRACTLIMITS = lt_POCONTRACTLIMITS

POSERVICES = lt_POSERVICES.

Now i am getting a message below messages from BAPI :

S 06 023 Indirect PO (ZSTA) 4506000481 changed

I ME 664 Change Item Category could not be effected

I ME 664 Change Item Category could not be effected

I can see that the PO is not got updated with any of values.Please help me to resolve this issue.

Thanks

PRavee.

0 Kudos

Hi,

´

Use "BAPI_PO_GETDETAIL1" and pass one known PO number which is created in ME21N and then execute the FM from SE37 and check the output, the output gives an idea what values to be filled up in parameters required to be passed to BAPI_PO_CHANGE.

Pass the same values by filling the desired tables required for BAPI_PO_CHANGE and then use this in code. And also call BAPI_TRANSACTION_COMMIT. You can use statement " SET UPDATE TASK LOCAL." before calling FM bapi transaction commit. Hope this might be helpful. Let me know, If you still face problems in filling the values required for BAPI_PO_CHANGE

Srikanth.

0 Kudos

Hi Srikanth,

Thanks for your reply. I did read of PO details from getdetail1 and passed the same values to change BAPI, but nothing has worked out. Anyway I achieved this functionality through BDC( during PO create).

Thanks

Pravee.