Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using CDS Table function/AMDP

0 Kudos

Hi Experts

I have created a CDS cube which has Company Code and GL Account as dimensions and EndingBalance as Measure. Now we need one more field called Average Monthly balance(which is calculated using a SAP Standard ABAP FM). To do it at the database level is it possible to wrap this as a CDS Table function implemented using AMDP method. If so can you direct me to sample code snipped where we call the ABAP FM Inside the AMDP Method.

(I did look up similar queries but did not find anything that had a code snippet for calling an ABAP FM. If there is one and i have missed it pls to post the link). Thanks.

1 ACCEPTED SOLUTION

former_member1716
Active Contributor

Hello Meera R Corera,

CDS functionalities are part of Database layer, their purpose is to reflect the definition of an SQL View.

An ABAP FM belongs to the application Layer.

Hence it is not possible to for a database layer to call the FM from application layer.

Regards!

2 REPLIES 2

maheshpalavalli
Active Contributor

You cannot call an FM inside an AMDP. Rewriting the code in hana SQL inside the AMDP is the only option.

BR,

Mahesh

former_member1716
Active Contributor

Hello Meera R Corera,

CDS functionalities are part of Database layer, their purpose is to reflect the definition of an SQL View.

An ABAP FM belongs to the application Layer.

Hence it is not possible to for a database layer to call the FM from application layer.

Regards!