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: 

Issue in BAPI_PO_CHANGE

Former Member
0 Kudos
230

Hi Gurus,

I am using the BAPI_PO_CHANGE to change the account assignment categeory from blank to cost center 'K'. The BAPI is throwing an error :

"Account 50010101 requires an assignment to a CO object".

but I have already passed the CO objects.

BTW,

1: i have simulate the data which passed via ME22N,it work perfectly.

2:i also check the data in debug mode.it has been passed into the function correctly

3:i also populated the parameters into the BAPI import parameters poaccountx

4:i try to change the other datas such as delivery schedule,price,quantity.the BAPI also work.

does anybody have any hints to solve this issue? kindly thanks in heart.

8 REPLIES 8

chaiphon
Contributor
0 Kudos
60

This problem may be as easy as missing leading zeros in front of G/L account or cost center.

Regards,

Chaiphon

Former Member
0 Kudos
60

Hi Chaiphon Pulnitiporn :

thanks for your answer.i have called the CONVERSION_EXIT_ALPHA_INPUT function and i have debug the code that the GL account has been filled with the leading zero .so was costcenter.

BR

Sam

nirajgadre
Active Contributor
0 Kudos
60

HI,

what all paramters aer you passing to the BAPI...?

0 Kudos
60

Hi niraj gadre:

for the account data,i passed the below:

MOVE-CORRESPONDING it_po_account TO lt_po_account.

lt_po_accountx-po_item = it_po_account-po_item.

lt_po_accountx-serial_no = it_po_account-serial_no.

lt_po_accountx-po_itemx = 'X'.

lt_po_accountx-serial_nox = 'X'.

lt_po_accountx-delete_ind = 'X'.

lt_po_accountx-quantity = 'X'.

lt_po_accountx-net_value = 'X'.

lt_po_accountx-gl_account = 'X'.

lt_po_accountx-costcenter = 'X'.

lt_po_accountx-co_area = 'X'.

lt_po_account-asset_no = 'X'.

lt_po_account-orderid = 'X'.

0 Kudos
60

HI Sam,

Try to show this error to your functional people. [http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm|http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm] This link for deletion of po. Check if it is useful.

Regards,

Madhu.

Edited by: madhurao123 on Mar 17, 2011 5:39 AM

0 Kudos
60

Hi madhurao:

thanks for your suggestions.

actually, i am the function consultant too.

all the configuration was work normally from the persepcts of functional consultant.

again, thanks for your effort, i have raised a ticket to SAP and hope get the answer soon.

any update i will keep you all posted.

BR

Sam

Former Member
0 Kudos
60

Hi All:

althought i still do not receive the reply from SAP, I am sure i rooted the caused that was the program error.

correct the program

L2012F25 Line 502

replace with " IF sy-subrc IS INITIAL. "

correct the program

L2012I03 line 35

insert "lo_acct TYPE REF TO if_purchase_order_account_mm,"

line 74

insert " mmpur_dynamic_cast1 lo_acct io_model."

after that.the BAPI work perfectly.

hope it can help you all and the other persons.

BR

Sam

0 Kudos
60

Hi sam,

I have countered the same error,  when appending a new item with account assignment WBS , error message shows I didn't input a CO object. But the replacement line no. you gave is wrong in my system, because there is patch notes in the code, so I cannot check why the code goes wrong and convince the team to change code.

Could you give me some more information?