Application Development and Automation 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: 
Read only

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

Yasin
Active Participant
22,549

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.

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
5,817

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)

7 REPLIES 7
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
5,818

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)

Read only

0 Kudos
5,817

"(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.

Read only

0 Kudos
5,817

Thanku sir.

Read only

matt
Active Contributor
0 Kudos
5,817

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

Read only

0 Kudos
5,817

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.

Read only

5,817

Good Hint.

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

Read only

5,817

There are better ways to communicate, especially when we are providing assistance.