Skip to Content
0

ABAP CDS table with complex AMDP coding

Dec 05, 2017 at 04:26 AM

137

avatar image

Hi Expert,

I am trying to create an ABAP CDS table, but I need to do some row-level processing in AMDP implementation, but I don't know how to return the result table variable in this AMDP implementation. the AMDP code as below:

as above, the final result table variable is VAR_OUT, I want to return this table variable, is it possible? how to code this return statement in AMDP procedure?

Many Thanks,

p1.png (33.1 kB)
p2.png (43.2 kB)
p3.png (52.7 kB)
p4.png (22.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
Horst Keller
Dec 06, 2017 at 06:43 AM
0

"still have the issue, which some data type inconsistent between table definition and AMDP code."

Check the mapping tables.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

hi horst keller,

I have seen many of ur blogs and I am following of it.Sir I have started using AMDP but only with select statements with joins.I wanted know what all functions does amdp support which are supported in ABAP.Please give me a reference regarding the same.

thanks

Regard's

uday

0

AMDP isn't implemented in ABAP but in Hana's SQLScript.

ABAP just manages the procedures, creation, lifetime etc.

You must read the SQLScript reference.

For simple queries you don't need AMDP at all.

0
Jörgen Lindqvist Dec 05, 2017 at 06:15 AM
-1

Hi!

It need to be specified in the AMDP method definition. This can be implicitly for instance from your CDS table function or explicitly in the method definition in the AMDP class. Then use the RETURN statement in the AMDP or popupate the defined export parameter.

Check this out: https://blogs.sap.com/2015/10/21/abap-news-for-release-750-cds-table-functions-implemented-by-amdp/

Show 3 Share
10 |10000 characters needed characters left characters exceeded

You know you gave the same link I gave?

0

I did not even know there was another reply. I see you beat me with 3 min posting your answer. :)

Well, then it must be a good link, right?

1

:). It is so good that even the writer of that linked blog answered the question.

1
Iftah Peretz
Dec 05, 2017 at 06:12 AM
0

Hey,

Can this help?

Share
10 |10000 characters needed characters left characters exceeded
Iftah Peretz
Dec 05, 2017 at 07:45 AM
0

Also, refer to this (pages 7-9 of the PDF).

Share
10 |10000 characters needed characters left characters exceeded
Bo Zhang Dec 05, 2017 at 05:59 PM
0

Thanks all for quick respond.

after adjusting the code, finally I put return statement into the code below:

and there is no error for the AMDP procedure any more:

but when I try to preview the data for the ABAP CDS table, I get following error:

can you pleas help how to fix the issue?

I try to debug the code, but I can't put break-point into the code with following error:

am I wrong with some concepts or operations?

finally after run OPEN sql for this ABAP CDS table, I get following error message:

but compare the data type for the fields of the ABAP CDS table with array types below in the code, I don't find any different, is the error message pointing to other meaning?


p5.png (1.1 kB)
p6.png (2.1 kB)
p7.png (30.9 kB)
p8.png (26.6 kB)
p9.png (10.9 kB)
p10.png (25.3 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

What happens if you SELECT with Open SQL.

0
Horst Keller
Dec 05, 2017 at 07:46 AM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Horst, if I understand correctly, I fill the data into corresponding field in AMDP procedure, but still have the issue, which some data type inconsistent between table definition and AMDP code.

0