Skip to Content
avatar image
-2
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 11, 2017 at 11:17 AM

    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)

    Add comment
    10|10000 characters needed characters exceeded