
Introduction: This document describes that if the standard API is not available to fulfil any integration requirement, then how to create an external API using standard or custom CDS view in S/4HANA cloud so that we can get the required data via created external API
Here I will take one example where i want to fetch the address details of a supplier, the standard CDS view of supplier does not provide the address details of the supplier, it only provides the AddressID of the supplier and another CDS view can provide the address details using that AddressID as a filter in join condition.
**Standard API is available to full fill this requirement
but here I am taking this example for explaining purpose.
Click on create for a new CDS view.(Figure 2)
Select scenario as External API(Figure 3)
Here, I have added “I_Supplier” which gives the supplier details including supplier AddressID.(Figure 4)
Figure 4
After adding associated data source, set the join condition.(Figure 5)
Figure 5
Here we can choose any field on associated data source and then select operator like equals, set value type as parameter, field(from primary data source) or constant(Figure 6)
Here I am adding AddressID field from associated data source, condition equals to AddressID field of primary data source (Figure 7)
So, let’s move to the next step which is adding elements from both or all data sources.(Figure 😎
After Successful Publishing, now we can check the result in terms of data.(Figure 10)
Now, we need to create Custom Communication Scenario for the created Custom CDS View so that same CDS view can be used as an External API
Click on new(Figure 12)
Put any name for scenario ID.(Figure 13)
Now add CDS view (Figure 14 and 15)
Publish it (Figure 16)
After successful publishing on custom communication scenario, we can add it to Communication Arrangement.(Figure 17)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |