Skip to Content
9
Mar 05 at 09:59 AM

Reuse of S/4HANA Backend Translations in CAP

329 Views

Hello CAP Team,

when creating a side-by-side extension for SAP S/4HANA we consume quite some OData APIs. As the side-by-side extension in most cases should keep the same terminology I would think that it should be possible to reuse the translations that are already available in the Backend also in the CAP project.

Here is an example with the API for Sales Organization. When I request the OData Metadata for this API in English with the following path:

/sap/opu/odata/sap/API_SALESORGANIZATION_SRV/$metadata?sap-language=en

I get i.e. the SalesOrganization property with sap:label "Sales Organization":

<PropertyName="SalesOrganization"Type="Edm.String"Nullable="false"MaxLength="4"sap:display-format="UpperCase"sap:label="Sales Organization"/>

When I do the same request for German with:

/sap/opu/odata/sap/API_SALESORGANIZATION_SRV/$metadata?sap-language=de

I get i.e. the SalesOrganization property with sap:label "Verkaufsorganisation":

<Property Name="SalesOrganization" Type="Edm.String" Nullable="false" MaxLength="4" sap:display-format="UpperCase" sap:label="Verkaufsorganisation"/>

So the needed information for Internationalization (i18n) would be already available. So my expectation would be to re-use an external definition in my own entities:

using { API_SALESORGANIZATION_SRV as externalSalesOrganization } from './external/API_SALESORGANIZATION_SRV';

entity SalesArea : cuid, managed { SalesOrganization: externalSalesOrganization.A_SalesOrganization : SalesOrganization; }

And that should cause the resulting Metadata to be populated with the labels based on the available information from the backend.

Best regards
Gregor