Skip to Content
-2

The database field or the result type of the aggregate function are not compatible

Aug 11, 2017 at 09:21 AM

1.8k

avatar image
Former Member

Error analysis The compiler returned a warning about the terminated OpenSQL command with the following text: "The database field or the result type of the aggregate function KUNNR and the component "ERDAT" of "IT_PROJ" are not compatible."

am working in ALV report (OOP) am facing this error with

the select statement:

Select VBELN BUKRS_VF KUNNR
from VBAK INTO TABLE it_proj

WHERE KUNNR IN S_KUNNR.

TOP Module:

TYPES: BEGIN OF ty_proj,
        VBELN type VBAK-VBELN, "SD NO
        ERNAM type vbak-ERNAM,
        ERDAT type VBAK-ERDAT, "SD Date
        BUKRS_VF type VBAK-BUKRS_VF, "CCoD
        KUNNR type VBAK-KUNNR, "Cust No
        BNAME type VBAK-BNAME, "Cust Name
        BSTNK type VBAK-BSTNK,  " PO No
       END OF ty_proj,
DATA: wa_proj TYPE ty_proj,
      wa_prps TYPE ty_prps,
      it_proj TYPE STANDARD TABLE OF ty_proj,
      it_prps TYPE STANDARD TABLE OF ty_prps.

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

1 Answer

Best Answer
Horst Keller
Aug 11, 2017 at 11:17 AM
1

Don't you see that the structure of the target table is different to the structure of the result set?

Use

INTO CORRESPONDING FIELDS OF TABLE ...

(and please take the time to remove the SPAM from the source code in your post)

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

"(and please take the time to remove the SPAM from the source code in your post)"

Agree, but that's most likely caused by our lovely platform. It has happened to me a few times too, especially after going back and editing code. If someone doesn't go back into their post after posting they won't notice it.

0

Right click in your browser, choose "paste as plain text".

0
Matthew Billingham

It wasn't the pasting.

Paste -> Looks OK.
Post -> Looks OK.
Edit -> looks OK.
Save -> html nonsense.

I haven't seen it happen for some time, so I guess it's fixed. But the usual rule applies: Re-read what you've just written/posted.

0
Matthew Billingham

Good Hint.

I always copy first to Notepad and then to the lovely platform.

0
Former Member

Thanku sir.

0