Dear SAP Members,
We recently worked on API extension's. Please see the steps below.
In my case we needed to add 2 additional fields in the output
1) Find service definition name from sap.api.com. Go to hana studio, search->'ABAP Search Object'.
Enter the service name ''API_FUNCTIONALLOCATION'.
2) in my case, i need to add 2 fields under 'A_FunctionalLocation'.
you need to find the lower level view to add the fields.
Go to SE11, enter the view name:
again, open SE11 and check 'R_FunctionalLocationTP'.
again open SE11 and check if any view is available under I_FUNCTIONALLOCATION.
A_FunctionalLocation
R_FunctionalLocationTP
I_FUNCTIONALLOCATION
So we need to extend the lower level view : I_FUNCTIONALLOCATION.
1) Extend the CDS view using HANA.
sample logic below:
@AbapCatalog.sqlViewAppendName: 'ZXXXXXX'
@EndUserText.label: 'Functional Location Service Extension'
extend view I_FunctionalLocation with ZXXXXXXXX
association [1..1] to Jest as _jest on $projection.MaintObjectInternalID = _jest.objnr and _jest.inact = ''
{
_jest.stat as stat,
_jest.inact as inact
}
Nest step is extend the view entity option while creating the CDS view for upper levels:
Create the extended view for 2 upper levels (in my case
**************************************************************************************
extend view entity R_FunctionalLocationTP with {
I_FunctionalLocation.stat,
I_FunctionalLocation.inact
}
*****************************************************************************************
extend view entity A_FunctionalLocation with {
_FunctionalLocationTP.stat,
_FunctionalLocationTP.inact
}
***********************************************************************************
Once CDS views extended, Add & activate the service using t.code '/IWFND/MAINT_SERVICE'.
select 'Add service' and find service 'API_FUNCTIONALLOCATION'.
Once it is activated, check in SICF if it is activated or not. If not activate
Mandatory thing here is, select the service and 'Load the metadata' in '/IWFND/MAINT_SERVICE'.
Test the service, IN my case it is GET method.
Thank You,
SRini.
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.