cancel
Showing results for 
Search instead for 
Did you mean: 

Standard API's Extension

02-03-2025 7:12 PM
srinivastaduka Explorer
1173 views 0 comments
0 Likes
SAP Managed Tags
Labels
ABAP
Subscribe

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'.

 

srinivastaduka_0-1738606323471.png

 

 

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:

srinivastaduka_1-1738606323477.png

 

 

srinivastaduka_2-1738606323482.png

 

 

again, open SE11 and check 'R_FunctionalLocationTP'.

 

srinivastaduka_3-1738606323481.png

 

 

 

again open SE11 and check if any view is available under I_FUNCTIONALLOCATION.

 

srinivastaduka_4-1738606323506.png

 

 

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:

srinivastaduka_5-1738606323873.png

 

Create the extended view for 2 upper levels (in my case 

srinivastaduka_6-1738606323338.png

 

**************************************************************************************

 

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 

srinivastaduka_7-1738606323621.png

 

 

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.

0 Likes

Accepted Solutions (0)

Answers (0)