Skip to Content
0

AMDP - SQLSCRIPT message: Return type mismatch error on sum of currency field

Mar 11, 2017 at 07:50 AM

330

avatar image

Hi Friends,

I am getting below error when i try to activate AMDP class.

DescriptionResourcePathLocationType SQLSCRIPT message: return type mismatch: Procedure YCL_DEMO_AMDP_1=>GET_TOP_VENDOR: Attribute name "DMBTR" different from Attribute name: "SUM(DMBTR)"YCL_DEMO_AMDP_1 (Global Class)[DR1] YCL_DEMO_AMDP_1line 41ABAP Syntax Check Problem .

CLASS Defination

CLASS Implementation

Error Details

I Tried changing the DMBTR type to ( P LENFTH 13 DECIMAL 3 ) but still getting the same error.

But if i don't use SUM function it is working fine.

Why it is not allowing for SUM but allowing without some ?

How to get the sum of DMBTR ?

Thank you ALL :)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Florian Pfeffer
Mar 11, 2017 at 09:09 AM
0

Use an alias name for your summed field:

...
sum(dmbtr) as dmbtr
...
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Thanks for your reply .

It is working find now . Could you explain why alias name is required here ?

0
Horst Keller
Mar 11, 2017 at 09:14 AM
0

You have to take the mapping rules into account

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenamdp_hdb_sqlscript.htm

SUM has type DOUBLE, I guess. It must be mapped to f.

Either use ABAP type f or cast SUM to DECIMAL in SQLScript.

Share
10 |10000 characters needed characters left characters exceeded