Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BW endroutine

Hi ABAP experts

I wrote this endroutine, a lookup from a DSO into an infocube.

syntax checks says: E:"WA" cannot be converted to the line type of "ITAB".

What's wrong?

Thanks for any help.

Regards

Thomas

TYPES : BEGIN OF CFM,
          CFM_SEC_ID TYPE /BI0/OICFM_SEC_ID,
          COMP_CODE TYPE /BI0/OICOMP_CODE,
          CALDAY TYPE /BI0/OICALDAY,
          FS_BDATE TYPE /BI0/OIFS_BDATE,
        END OF CFM.

    DATA: ITAB_TARGET TYPE STANDARD TABLE OF _TY_S_TG_1.
    DATA : ICOUNT TYPE RSARECORD.
    DATA: ITAB TYPE TABLE OF CFM, WA type TABLE OF CFM.


    IF NOT RESULT_PACKAGE[] IS INITIAL.

      SELECT CFM_SEC_ID COMP_CODE CALDAY FS_BDATE
        FROM /BIC/AZXYZ_O0100 INTO CORRESPONDING FIELDS OF TABLE ITAB
            FOR ALL ENTRIES IN RESULT_PACKAGE WHERE
            CFM_SEC_ID EQ RESULT_PACKAGE-CFM_SEC_ID
            AND COMP_CODE EQ RESULT_PACKAGE-COMP_CODE AND
            CALDAY EQ RESULT_PACKAGE-CALDAY.

      IF SY-SUBRC EQ 0.
        SORT ITAB BY CFM_SEC_ID COMP_CODE.
      ENDIF.

      LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.


        READ TABLE ITAB INTO WA
        WITH KEY CFM_SEC_ID = <result_fields>-CFM_SEC_ID.
        COMP_CODE = <result_fields>-COMP_CODE.
        CALDAY = <result_fields>-CALDAY.
       

        IF SY-SUBRC EQ 0.
          <RESULT_FIELDS>-FS_BDATE = WA-FS_BDATE.
        ENDIF.


        APPEND <RESULT_FIELDS> TO ITAB_TARGET.
      ENDLOOP.
        REFRESH RESULT_PACKAGE.
    RESULT_PACKAGE[] = ITAB_TARGET[].
  ENDIF.

Former Member
replied

Hi thomas,

READ TABLE ITAB INTO WA

        WITH KEY CFM_SEC_ID = <result_fields>-CFM_SEC_ID.

     

COMP_CODE = <result_fields>-COMP_CODE.

        CALDAY = <result_fields>-CALDAY.


Please remove a full stop after '<result_fields>-CFM_SEC_ID.' and <result_fields>-COMP_CODE. there should be only full stop at the end because read is one statement  so it should be like this


READ TABLE ITAB INTO WA

        WITH KEY CFM_SEC_ID = <result_fields>-CFM_SEC_ID

      COMP_CODE = <result_fields>-COMP_CODE

        CALDAY = <result_fields>-CALDAY.


just copy paste this code it will work.




0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question