cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

patch/create Account Assignment M for a existing Purchase order in S/4Hana Public Cloud

Phil_P
Participant
0 Likes
308

hello there lovely SAP Community, 

 

id like to create a Account Assignment "M" with a reference for a Sales Order and Sales Order item for an already existing Sales order. it needs to be done with a Odata API. 

 

Currently im Struggling with that on Item level a Update on Item lvl needs to be done to Change AccountAssignment Category to "M" and on Account Assingment lvl a Account assingment needs to be Created. 

 

Kinda Like: 

 

A Patch on item lvl. 

 

{
"AccountAssignmentCategory": "M",
      "_PurOrdAccountAssignment": [
        {
          "PurchaseOrderItem": "10",
          "AccountAssignmentNumber": "1",
          "SalesOrder": "335",
          "SalesOrderItem": "000100"
}
]
 
 
}
 
i cant get it work. 
 
Problem: on Item lvl its kinda a Patch of AccountAssignmentCategory... but on Account assignment lvl its a create.
 
So my Question: How to Create a Account Assignment on a already existing Purchase Order via Odata. 
 
kind regards, 
Philipp 

Accepted Solutions (1)

Accepted Solutions (1)

Chris1973
Active Contributor
0 Likes

Hello @Phil_P 

Thank you for your question.

To summarise, account assignment handling in public cloud for purchase order through OData follows a two-step logic because of how the manage transactional consistency works within the clean-core framework.

You are correct that the system treats the Item-level “AccountAssignmentCategory” as an update to the item entity. The account assignment line itself as a create (POST) under the nested entity set _PurOrdAccountAssignment.

However, OData service for purchase Orders does not support performing both actions in a single payload or PATCH call. You are required to perform these operations sequentially. First you need to update the item category, then create the account assignment line.

Have a look at the following references for further details.

APIs in Sourcing and Procurement, Operations for Purchase Order, Display Purchasing Documents by Account Assignment, Account assignment in purchasing document

 

Let me know if you have further questions.

 

Best regards

Chris

Answers (0)