10-07-2008 9:58 AM
I am trying to use the BAPI_PO_CHANGE routine to add new lines to an existing service order but it always returns error 518
3 Instance 4700073564 of object type PurchaseOrder could not be changed
0 Purchase order still contains faulty items
518 No account assignment exists for service line 0000000000
This is my data structure, any help will be much appreciated as I am totally stuck.
SAP is R6 and the interface is via PHP5
[name] => BAPI_PO_CHANGE
[POACCOUNT] => SAPTable Object
[PO_ITEM] => 20
[QUANTITY] => 1
[GL_ACCOUNT] => 0060010000
[GR_RCPT] => gnm
[CO_AREA] => TD00
[WBS_ELEMENT] => 3413PF115.6
[POACCOUNTX] => SAPTable Object
[PO_ITEM] => 20
[PO_ITEMX] => X
[QUANTITY] => X
[GL_ACCOUNT] => X
[GR_RCPT] => X
[CO_AREA] => X
[WBS_ELEMENT] => X
[POADDRDELIVERY] => SAPTable Object
[PO_ITEM] => 20
[NAME] => confirmation
[COUNTRY] => GB
[POITEM] => SAPTable Object
[PO_ITEM] => 20
[SHORT_TEXT] => test2
[PLANT] => 3413
[MATL_GROUP] => YZ900
[QUANTITY] => 1
[PO_UNIT] => LE
[PO_UNIT_ISO] => C62
[ORDERPR_UN] => LE
[ORDERPR_UN_ISO] => C62
[CONV_NUM1] => 1
[CONV_DEN1] => 1
[NET_PRICE] => 1.000000
[PRICE_UNIT] => 1
[ITEM_CAT] => 1
[ACCTASSCAT] => P
[PREQ_NAME] => Gavin Miller
[PCKG_NO] => 20
[POITEMX] => SAPTable Object
[PO_ITEM] => 20
[PO_ITEMX] => X
[SHORT_TEXT] => X
[PLANT] => X
[MATL_GROUP] => X
[QUANTITY] => X
[PO_UNIT] => X
[PO_UNIT_ISO] => X
[ORDERPR_UN] => X
[ORDERPR_UN_ISO] => X
[CONV_NUM1] => X
[CONV_DEN1] => X
[NET_PRICE] => X
[PRICE_UNIT] => X
[TAX_CODE] => X
[ITEM_CAT] => X
[ACCTASSCAT] => X
[PREQ_NAME] => X
[PCKG_NO] => X
[POLIMITS] => SAPTable Object
[PCKG_NO] => 20
[LIMIT] => 1.000000
[EXP_VALUE] => 1.000000
[POSCHEDULE] => SAPTable Object
[PO_ITEM] => 20
[DELIVERY_DATE] => 20081031
[QUANTITY] => 1
[POSCHEDULEX] => SAPTable Object
[PO_ITEM] => 20
[PO_ITEMX] => X
[DELIVERY_DATE] => X
[QUANTITY] => X
[POSERVICES] => SAPTable Object
[PCKG_NO] => 20
[LINE_NO] => 20
[QUANTITY] => 1
[GR_PRICE] => 1.000000
[RETURN] => SAPTable Object
[TYPE] => E
[ID] => SE
[NUMBER] => 518
[MESSAGE] => No account assignment exists for service line 0000000000
[LOG_MSG_NO] => 0
[MESSAGE_V1] => 0000000000
[PARAMETER] => POITEM
[ROW] => 2
[SYSTEM] => IT2_400
10-07-2008 10:08 AM
hi check this:
With this function module, it is not possible to:
Create subcontracting components (you can only use existing ones)
Create configurations (you can only use existing ones)
Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
Attach documents to the purchase order
Change foreign trade data
Change service data " this point says you cannot change service data.
Change or reexplode BOMs
Got the above data from FM documentation.
Regards,
Vishwa.
10-07-2008 10:14 AM
Thanks but I saw the help text regarding changing service data, but I'm trying to add a new line to an existing service order. Does this count as the same thing?
10-07-2008 11:46 AM
Hi
Yes u can create new line item.. but you have to make sure you are creating a new service line for the item which has both account assignment and item category also...
Please check if the values there are passed correctly.
Regards.
Vishwa.
10-07-2008 12:03 PM
I am passing the item category and account assignment and they work for non-service orders.
But the error keeps moaning about "service line 0000000000" when there isn't a line 0.
10-07-2008 12:06 PM
I think in the place of 00000000, I think you have to pass an value for the service line item...Like if there is an already service line item, then ur new service should hold the immediate value.
Like.. first one has "00000010", then the one ur creating should have "000000020" or whatever is the next one in the series.
Regards,
Vishwa.
10-07-2008 12:11 PM
I am already setting the line number and package number to the item number so this new item is 0020 and the sevice package is 0020 and the service line is 0020.
[POITEM] => SAPTable Object
[PO_ITEM] => 20
[ITEM_CAT] => 1
[ACCTASSCAT] => P
[PCKG_NO] => 20
[POLIMITS] => SAPTable Object
[PCKG_NO] => 20
[LIMIT] => 1.000000
[EXP_VALUE] => 1.000000
[POSERVICES] => SAPTable Object
[PCKG_NO] => 20
[LINE_NO] => 20
[QUANTITY] => 1
[GR_PRICE] => 1.000000
10-07-2008 12:36 PM
OK. I think it is not taking the value 0020.
You may have to add more zeroes.
Pass it through the Fm conversion_exit_alpha_input..and then give it to the BAPI..just by chance sometimes it happens with BAPI.
Regards,
Vishwa.
10-07-2008 1:18 PM
just tried paddings the numbers out with 0's but the same error was produced.
10-07-2008 1:22 PM
Hi
I see that acct assignment is P, could u please change that and check? Also, in Item Category is the value D? I think only then services come.
Regards,
Vishwa.
10-07-2008 1:36 PM
The account assginment is 'P' for WBS Elements.
The Item Category has always been set to 1 for this type of order just check the order on SAP and it's a 'B' so I changed the code to use 'B' instead but the same error came back.
When using 'D' an extra error was returned saying category 'D' not allowed for the order type.
Also tried assignment 'K' with a cost centre with the same results
Edited by: Gavin Miller on Oct 7, 2008 2:37 PM
10-07-2008 1:40 PM
OK.
Nothing is working unfortunately..
Can u just check with the previous PO's when services was created what was the account assignment and item category given... and just try to give the same values here...
Just feeling we missed something else.
Regards,
Vishwa.
10-07-2008 1:51 PM
The original PO was created using BAPI_PO_CREATE
I am now trying to add an extra line using the same details as the first line (except item number) using BAPI_PO_CHANGE
So it is using the same account assignment, same item category, same material group