cancel
Showing results for 
Search instead for 
Did you mean: 

ASSOCIATION inside AMDP

shubham_banerjee
Participant
0 Kudos

Dear Experts,

Can we use ASSOCIATION inside AMDP methods or only JOIN is permissible ? In other case, Table Function being a CDS artifact when implemented by an AMDP method, can it perform any operations other than returning a result set ? In which type of requirements shall we use a Table Function implemented by and AMDP method ?

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member1716
Active Contributor

Hello Shubham Banerjee,

Kindly go through the below Link, I have explained the concepts.

POST

Regards!

GK817
Active Contributor

Very good post satishkumarbalasubramanian . Other answers are also very insightful. Thanks.

former_member1716
Active Contributor

Hello Shubham Banerjee,

To keep it Simple,

1) CDS Objects has Advantages over traditional Data base objects.

2) AMDB methods has advantages over traditional methods.

Now when two Objects that has advantages over traditional objects combine together and yield results imagine how fruitful they can be.

Regards!

GK817
Active Contributor

Hi Shubham,

1. AMDP primarily uses SQLSCRIPT as language. As far as i know, 'ASSOCIATION' syntax won't be allowed in SQL script.

2. AMDP is used to get filtered data from database. It was introduced to enable code push-down which happens when script executes at DB level. You can perform calculations as well, but all calculations and extraction should happen in one step.

3. CDS table functions has its own uses ( passing parameters to get result). AMDP has its own use cases ( code push down). CDS table functions are used with AMDP if you want to push select-options to DB level. SQL script has no concept of select-options/ranges. Below blog:

https://blogs.sap.com/2018/03/21/select-options-in-cds-using-table-function/

I am sure there is more to above information. Looking forward to other answers.

GK

shubham_banerjee
Participant
0 Kudos

Hi Both,

I found a post that indicates as following. If the same is permissible, then it's the solution of my doubt.

1. Create a TABLE FUNCTION, B with Parameters and without SELECT-OPTIONS and implement the same in an AMDP method.

2. Inside the AMDP method use Database Table A as the data source.

2. Create a CDS view and use the TABLE FUNCTION as a data source or as one of the data sources. Also perform JOIN/ ASSOCIATION between A and B in the CDS if needed.

shubham_banerjee
Participant
0 Kudos

Hi gaurav.karkara3,

Really appreciate your effort for sharing such a useful link. I have gone through the link before and still came up with the doubt as I had two confusions with the same,

1. If we are using SELECT-OPTIONS, then why don't we call an AMDP straight in an ABAP report and get the desired result set out of a method using CL_SHDB_SELTAB=>COMBINE_SELTABS.

2. If we want to use a CDS feature along with a SELECT-OPTION, then we are basically follow the following order,

a. create a TABLE FUNCTION with parameters and implement in an AMDP method.

b. we call the TABLE FUNCTION from a report and pass the SELECT-OPTION values as a string using CL_SHDB_SELTAB=>COMBINE_SELTABS.

c. ultimately we'll be calling an AMDP method which supports only SQL Script and we are not able to use any Open SQL features.

My doubt is, then why do we involve the Table Function, instead we can follow step 1 straight forward.

Please help me to understand and do clarify me if I am doing a mistake in understanding something.

GK817
Active Contributor
0 Kudos

Hi Shubham,

I believe it would be best if you go through the post shared by Satish. Please go through the links and others' answers as well. That should help you to answer these questions.

If that much information is not enough, i suggest you to create some objects yourself and try.

If you still have doubts, please comment here. I will be happy to answer.

GK