OData Channel offers a way for applications to delegate handling of conversion exits, currency, currency amount, unit of measurement, and unit amount conversions to the SAP Gateway framework.
Note that conversion handling functionality is only available in the OData Channel framework that is part of the SAP Business Suite backend system where IW_BEP is deployed, not on the SAP Gateway hub system. If your system is based on SAP NetWeaver 7.4 or higher, you do not need to install component IW_BEP since the SAP Gateway Foundation component SAP_GWFND is installed as standard and includes the functionality of IW_BEP.
Conversions for the following operations in inbound and outbound flow are available:
Create entity
Update entity
Read entity
Read entity set
At present, there is no support for conversion of URL parameters.
For example, for a Read operation the Id fields with a conversion exit have to be converted by application coding. If you have an outbound conversion of Id 0100000000 to 100000000 and try out the input conversion by executing /sap/opu/odata/sap/my_test/Id('100000000') then the method GetEntity can not find the instance, because the Id is 100000000 instead of 0100000000. The self link you get in the feed then has the external representation /sap/opu/odata/sap/my_test/Id('100000000'). For this the application has to provide conversion handling.
The following types conversions are covered:
Conversions exits (for example, ALPHA)
Conversion of currency/unit code between SAP internal and external (ISO) ones
Conversion of currency amounts (for example, a currency amount stored internally as 100.00 may de-facto mean 10.000 if it is about Japanese Yen)
API
In the model provider class the programming interfaces are available for the application to specify that an automatic call of conversion routines is desired. Either a direct API or an indirect API can be used.
Direct API
For each entity field the following methods are available in the /IWBEP/IF_MGW_ODATA_PROPERTY interface:
SET_CONVERSION_EXIT
Sets the name of conversion exit to be called for the property.
SET_SEMANTIC
Marks the property as currency code or unit of measurement field.
SET_UNIT
Sets the relation between the amount field and the field containing currency or unit code.
Enables the conversion for the property.
Disables the conversion for the property.
Indirect API
Alternatively, applications can use method BIND_STRUCTURE either for an entity type or for a complex type ( /IWBEP/IF_MGW_ODATA_CMPLX_TYPE) to tell the framework to take over the conversion information from the corresponding ABAP Dictionary structure. The optional parameter IV_BIND_CONVERSIONS has to be set to X.
If you use conversion exits for services created with the Service Builder according to OData version 2 (V2), note the following: If a conversion exit exists for a property and if the edm.Type of the property has the value edm.String, then we recommend to set the internal type of the property (/IWBEP/IF_MGW_ODATA_PROPERTY~SET_INTERNAL_TYPE ) to String in order to avoid possible conversion issues.
For general information on conversion functionality see Input and Output Conversions.