cancel
Showing results for 
Search instead for 
Did you mean: 

How to Insert BusinessPartnerRole With /A_BusinessPartner API

YuAkiyama
Explorer
0 Kudos

With the payload below, I could create single business partner without a role.However, I want to create BusinessPartnerRole along with same API call by using "to_BusinessPartnerRole" property.

Can someone tell me a sample payload to create BusinessPartnerRole along with a business partner by using /A_BusinessPartner API?

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
   xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
   xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
    <content type="application/xml">
        <m:properties>
            <d:BusinessPartner>99999999</d:BusinessPartner>
            <d:BusinessPartnerCategory>1</d:BusinessPartnerCategory>
            <d:CorrespondenceLanguage>JA</d:CorrespondenceLanguage>
            <d:FirstName>TEST</d:FirstName>
            <d:LastName>API</d:LastName>
            <d:Industry>string</d:Industry>
            <d:IsMale>true</d:IsMale>
            <d:Language>JA</d:Language>
            <d:LegalForm></d:LegalForm>
        </m:properties>
    </content>
</entry>

Thank you.

JulianoRomanato
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello cct.yu.akiyama.

How are you? I have excluded the Tag "SAP S/4HANA Cloud" and included the Tag "SAP S/4HANA Cloud Extensibility" for this question, as it works with SAP APIs.

Regards.

Juliano Romanato.

Accepted Solutions (1)

Accepted Solutions (1)

daviddasilva
Active Contributor
0 Kudos

Hello,

You can create a role for a business that already exists by using the URL: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('BP Number')/to_BusinessPartnerRole

and with the payload:

{

"BusinessPartner": "string",

"BusinessPartnerRole": "string",

"ValidFrom": "/Date(1492098664000)/",

"ValidTo": "/Date(1492098664000)/",

"AuthorizationGroup": "string"

}

You can always check other methods by using the API Business Hub.

Kind regards,

David

YuAkiyama
Explorer
0 Kudos

Hi David.

I was thinking only xml format is allowed. By using json, I could create BusinessPartner and BusinessPartnerRole at one time.

Thank you.

Answers (0)