While working with Multi Origin in service URL we have to pass additional parameter SAP_Origin (i.e. nothing but your system alias pointing to corresponding ECC) in filter and Get entity operation.
When working on same scenarios i found one interesting possibility of passing the System ID (SID) and Client (of ECC) and fetch data from particular system.
What is Multi Origin?
Multiple origin is used to fetch data from different back-end systems, collect them in one single service and updating different back-end systems using the same user.
Why System ID and Client?
- When creating OData requests you might not have information on any SAP NetWeaver Gateway system alias.
- You might wish to refrain from exposing the system name of your SAP NetWeaver Gateway system in the URL of your service for security reasons. In this case, instead of the system name you can also use the system ID (SID) together with the corresponding client.
Pre-Requisite :
- Gateway system is connected to all back end system
- System alias is available for all back end system
- GW Project is created in all the back end system
- Add all system alias in T-code /n/IWFND/MAINT_SERVICE for the ZPROJECT_SRV in GW system
- Using the URL sap/opu/odata/sap/ZPROJECT_SRV;mo/$metadata expected output is coming.
Alias eg.
FIORI_ECC1 : Backend System Alias 1 (SID - ABC, Client -100)
FIORI_ECC2 : Backend System Alias 2 (SID - XYZ, Client -100)
How to Use System ID and Client in URL ?
- In Gateway system Open SAP Reference IMGin transaction SPROand navigate toSAP NetWeaverSAP GatewayOData ChannelConfigurationConnection SettingSAP Gateway to SAP SystemManage SAP System Aliases
- Check for System Alias FIORI_ECC1 and FIORI_ECC2 in list.
- Maintain SID and Client against System Alias
Now we are all set to test the scenario of using SID and Client in Gateway Service URl
Syntax for using SID and Client:
/sap/opu/odata/sap/ZPROJECT_SRV;o=sid(SID.Client)/EnitySet
In our case it will be:- /sap/opu/odata/sap/ZPROJECT_SRV;o=sid(ABC.100)/EnitySet
See the result which refrains output results only from system ABC-100.
Syntax for using System Alias:
/sap/opu/odata/sap/ZPROJECT_SRV;o=SystemAlias/EnitySet
or /sap/opu/odata/sap/ZPROJECT_SRV;mo/EnitySet?$filter=SAP_Origin eq 'SystemAlias'
In our case it will be:- /sap/opu/odata/sap/ZPROJECT_SRV;o=FIORI_ECC1/EnitySet
See the result which refrains output results only from system alias FIORI_ECC1.
Similarly it works for create and deep create operation also.
Below I am showing an example working with create deep entity.
The processing of request is as follows:
1. The SAP NetWeaver Gateway system searches for all existing system aliases for the user and the specified service.
2. The SAP NetWeaver Gateway system checks if one from above system aliases equals sid(ABC.100). If this is the case, this system will be used.
3. If no such system exists underneath the specified service, then SAP NetWeaver Gateway checks whether one of the above system aliases has defined a system ID ABCand client 100.
4. If this is the case, this system ID will be used. Otherwise an error message is displayed.
Hope this fills new developments.