Skip to main content
Version: Classic

SAP C4C (Cloud for Customer)

With the SAP C4C address provider you can access your contact data in the SAP Cloud for Customer. This requires a "Service Account" in the corresponding SAP C4C Cloud.

Configuration​

<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C">
<EndpointUrl>https://{SAPC4CUrl}/{ApiBasepath}/v{APIVersion}/{APIEndpoint}</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="firstName" Label="First name/Name" Type="String" Length="100" Sort="1" />
</SearchParameters>
<Query><![CDATA[$filter=FirstName eq '{firstName}']]></Query>
<!-- Mandatory mapping -->
<Mapping>
</Mapping>
<Icon></Icon>
</AddressProvider>
</AddressProvider>
note

NOTE
This configuration is only the basic configuration and cannot be used alone. Since any endpoint of the SAP C4C service can be connected via this address provider, a lot of different configurations exist. After the parameters, three example configurations are listed for the three most important endpoints in relation to address data.

Parameters​

  • id 91d36523-bae9-424e-9618-fae6162d20f7
  • Title Title of the address provider. Default: "SAP C4C"
  • EndpointUrl Url of the SAP C4C service endpoint.
  • UserName The user with which the provider logs on to the SAP C4C service.
  • Password The password with which the provider logs on to the SAP C4C service (can be encrypted).
  • SearchParameter List with all possible entries.
    • *Name__ Unique id for the parameter. Corresponds to the placeholder in the Odata Query. Label Displayed text in front of the input field Type Input type: String (text), Long (number), Boolean (Yes/No) or Date (date) Length Maximum length for strings
    • Sort Sort value against the other parameters
  • Query The query for the request at the service is written using OData v2. The search parameters can be referenced using {SearchParamId} within the query. At this point, further documentation of the query is omitted, as three examples of configuration are shown below.
  • Mapping The mapping to be defined is a default contact mapping, which must contain the name of the property of the corresponding entity as SourceAttribute. The mapping must be configured. There is no default mapping that takes effect if one has not been explicitly defined.
  • Icon Base64 icon that is displayed to the user in the recipient dialog.

The ODataQuery can also be used to load dependent entities. It must be noted that dependent entities are always returned as an array by the service. This means that for the SourceAttribute the index of the array must also be specified: RelatedEntityCollection[0].RelatedEntityPropertyName.

note

NOTE
Via the url https://{SAPC4CUrl}/sap/c4c/odata/v1/c4codataapi/$metadata all entities contained in the service can be viewed with their properties and navigation properties. This is especially helpful for the query as well as the mapping.

Examples​

These examples refer to the entities of the Api V2.

CorporateAccount​

<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="0" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C – Kunden">
<EndpointUrl>https://{SAPC4CUrl}/sap/c4c/odata/v1/customer/CorporateAccountCollection</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="company" Label="Firma" Type="String" Length="100" Sort="1" />
<SearchParameter Name="street" Label="Strasse" Type="String" Length="100" Sort="3" />
<SearchParameter Name="plz" Label="PLZ/Ort" Type="String" Length="6" Sort="4" />
<SearchParameter Name="city" Label="" Type="String" Length="100" Width="130" Sort="4" />
<SearchParameter Name="country" Label="Land" Type="String" Length="100" Sort="5" />
</SearchParameters>
<Query><![CDATA[$filter=substringof('{company}', Name) and substringof('{street}', Street) and substringof('{city}', City) and substringof('{plz}', StreetPostalCode) and substringof('{country}', CountryCodeText)]]></Query>
<Mapping>
<Map Source="Name" Target="Company_Name"/>
<Map Source="CountryCode" Target="Company_CountryShortCode" />
<Map Source="City" Target="Company_City"></Map>
<Map Source="StreetPostalCode" Target="Company_ZipCode"></Map>
<Map SourceExpression="source('Street') + source('HouseNumber')" Target="Company_Street"></Map>
<Map Source="Phone" Target="Company_PhoneCentral"></Map>
<Map Source="Floor" Target="Company_Floor"></Map>
<Map Source="Email" Target="Company_EmailCentral"></Map>
<Map Source="WebSite" Target="Company_Homepage"></Map>
<Map Source="Fax" Target="Company_FaxCentral"></Map>
<Map Source="POBox" Target ="Company_PostOfficeBox" ></Map>
<Map Source="POBoxPostalCode" Target="Company_PostOfficeBoxCity_ZipCode"></Map>
<Map Source="POBoxDeviatingCity" Target="Company_PostOfficeBoxCity"></Map>
<Map Source="CareOfName" Target="Company_CareOf"></Map>
<Map SourceValue="CompanyData" Target="AddressType"></Map>
</Mapping>
</AddressProvider>
</AddressProvider>

IndividualCustomer​

<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="0" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C – Privatkunden">
<EndpointUrl>https://{SAPC4CUrl}/sap/c4c/odata/v1/customer/IndividualCustomerCollection</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="90" Sort="0" />
<SearchParameter Name="lastName" Type="String" Length="90" Width="90" Sort="0" />
<SearchParameter Name="street" Label="Strasse" Type="String" Length="100" Sort="3" />
<SearchParameter Name="plz" Label="PLZ/Ort" Type="String" Length="6" Sort="4" />
<SearchParameter Name="city" Label="" Type="String" Length="100" Width="130" Sort="4" />
<SearchParameter Name="country" Label="Land" Type="String" Length="100" Sort="5" />
</SearchParameters>
<Query><![CDATA[$filter=substringof('{firstName}', FirstName) and substringof('{lastName}', LastName) and substringof('{street}',Street) and substringof('{city}', City) and substringof('{plz}', StreetPostalCode) and substringof('{country}', CountryCodeText)]]></Query>
<Mapping>
<Map Source="FirstName" Target="Person_FirstName"/>
<Map Source="AcademicTitleCodeText" Target="Person_Title"></Map>
<Map Source="LastName" Target="Person_LastName"></Map>
<Map Source="CountryCode" Target="Person_CountryShortCode" />
<Map Source="City" Target="Person_City"></Map>
<Map Source="StreetPostalCode" Target="Person_ZipCode"></Map>
<Map SourceExpression="source('Street') + source('HouseNumber')" Target="Person_Street"></Map>
<Map Source="Phone" Target="Person_PhoneDirect"></Map>
<Map Source="Mobile" Target="Person_Mobile"></Map>
<Map Source="Fax" Target="Person_FaxDirect"></Map>
<Map Source="Email" Target="Person_EmailDirect"></Map>
<Map Source="POBox" Target="Person_PostOfficeBox" ></Map>
<Map Source="POBoxPostalCode" Target="Person_PostOfficeBoxCity_ZipCode"></Map>
<Map Source="POBoxDeviatingCity" Target="Person_PostOfficeBoxCity"></Map>
<Map Source="CareOfName" Target="Person_CareOf"></Map>
<Map SourceValue="PersonData" Target="AddressType"></Map>
</Mapping>
</AddressProvider>
</AddressProvider>

Contact​

<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="0" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C – Ansprechpartner">
<EndpointUrl>https://{SAPC4CUrl}/sap/c4c/odata/v1/contact/ContactCollection</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="90" Sort="0" />
<SearchParameter Name="lastName" Type="String" Length="90" Width="90" Sort="0" />
<SearchParameter Name="street" Label="Strasse" Type="String" Length="100" Sort="3" />
<SearchParameter Name="plz" Label="PLZ/Ort" Type="String" Length="6" Sort="4" />
<SearchParameter Name="city" Label="" Type="String" Length="100" Width="130" Sort="4" />
<SearchParameter Name="country" Label="Land" Type="String" Length="100" Sort="5" />
</SearchParameters>
<Query><![CDATA[$filter=substringof('{firstName}', FirstName) and substringof('{lastName}', LastName) and substringof('{street}', BusinessAddressStreet) and substringof('{city}', BusinessAddressCity) and substringof('{plz}', BusinessAddressStreetPostalCode) and substringof('{country}', BusinessAddressCountryCodeText)]]></Query>
<Mapping>
<Map Source="FirstName" Target="Person_FirstName"/>
<Map Source="LastName" Target="Person_LastName"></Map>
<Map Source="AcademicTitleCodeText" Target="Person_Title"></Map>
<Map Source="FunctionCodeText" Target="Person_Position"></Map>
<Map Source="JobTitle" Target="Person_Profession"></Map>
<Map Source="BusinessAddressCountryCode" Target="Company_CountryShortCode" />
<Map Source="BusinessAddressCity" Target="Company_City"></Map>
<Map Source="AccountFormattedName" Target="Company_Name"></Map>
<Map Source="DepartmentCodeText" Target="Company_Department" ></Map>
<Map Source="BusinessAddressStreetPostalCode" Target="Company_ZipCode"></Map>
<Map SourceExpression="source('BusinessAddressStreet') + source('BusinessAddressHouseNumber')" Target="Company_Street"></Map>
<Map Source="Phone" Target="Company_PhoneDirect"></Map>
<Map Source="Mobile" Target="Company_Mobile"></Map>
<Map Source="Fax" Target="Company_FaxDirect"></Map>
<Map Source="Email" Target="Company_EmailDirect"></Map>
<Map SourceValue="CompanyAndPersonData" Target="AddressType"></Map>
</Mapping>
</AddressProvider>
</AddressProvider>