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

ODATA Deep insert to_Customer not working

raja-47679
Discoverer
0 Likes
815

Hi All,

I am trying to use SAP ODATA v2 API to create a business partner (customer) in SAP S/4 HANA On-Prem. The ODATA service for Business Partner was activated by SAP admin and I can access the APIs. My understanding is if we create a business partner with role FLCU01 and provide to_Customer level fields, API will create a customer business partner. I guess I am mostly wrong so please correct me.

When I hit the API with the attached payload, I am getting success response, business partner gets created successfully and I can see the business partner fields in UI (HTML UI in browser). When I switch the role to 'FLCU01 Customer' to see the customer fields, I cannot see any to_Customer level fields or to_CustomerSalesArea level fields. Even in the attached API response, you can see only 'BusinessPartner' field is populated with value but 'Customer' field is empty. I confirmed with GET calls that customer is not created.

I also referred this page and used the sample request provided here, did minor changes and hit the API. Again, BP got created, no customer / vendor got created.

What am I doing wrong? Anything needs to be done by SAP admin to allow this deep entity insert (to_Customer)? Or my request is wrong? Could you please help?

Accepted Solutions (0)

Answers (2)

Answers (2)

marciniakb
Newcomer
0 Likes

https://me.sap.com/notes/3567506

Cause

As the synchronization from business partner to supplier/customer takes place only after the OData response is generated, even in a separate logical unit of work, the response is not capable of returning the new supplier/customer number during creation.

Resolution

 In this case, the only solution is to execute a new get request to receive the supplier/customer number.

pagarwal997
Participant
0 Likes

Have you tried passing the validity dates in the to_BusinessPartnerRole?

"to_BusinessPartnerRole" : [
    {
      "BusinessPartnerRole" : "FLCU01",
      "ValidFrom" : "\/Date(1451606400000+0000)\/",
      "ValidTo" : "\/Date(253402300799000+0000)\/"
    }
  ],
raja-47679
Discoverer
0 Likes

Thanks for the response, Pranay. I tried it and it is still not working.