Skip to Content

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

SELECT Fetch issue when append itab

Hi folks.

I tryied to find help but didn't find exactly my case.

I'm developeing in ECC 6.0 and want to select in oracle external database. The connection is already configured by BASIS team in DBCO.

The issue is about a Fetch command that give a dump ONLY when I try to use command APPEND itab.

DATA: GT_TEST TYPE STANDARD TABLE OF XPTO. " XPTO IS A STRUCTURE CREATED IN SE11

DATA: GS_TEST TYPE XPTO.

This works:

DO.
    EXEC SQL.
      FETCH NEXT C
             INTO  :GS_TEST-NUM_CONTRACT,
                        :GS_TEST-NAME
    ENDEXEC.
  EXIT.
  ENDDO.

This doesn't work:

DO.
      FETCH NEXT C
             INTO  :GS_TEST-NUM_CONTRACT,
                        :GS_TEST-NAME
    ENDEXEC.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
    APPEND GS_TEST to GT_TEST.
  ENDDO.

Any tip ?

thanks.

Glauco

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