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

Data Transfer problem from cursor to table

Former Member
0 Likes
382

Hi ,

I created one Extract FM to extract data through a Datasource by RAS3. When i run the FM directly the cursor value (S_CURSOR) is displayed as 3850 and when i try to transfer using FETCH NEXT to a internal table (E_T_DATA) 498 entries populated but if i open the table all lines are blank. Pls help me. i.e. E_T_DATA[] = 498


 OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT MATNR
    FROM MARA AS A "INNER JOIN MARC AS C
    "ON A~MATNR = C~MATNR
    "INTO TABLE E_T_DATA
    WHERE MATNR IN L_R_MATNREAN
      AND MTART IN ('ZPLU','ZPAK',
                      'ZCOM','ZTIN',
                      'ZSCR','ZEXW',
                      'ZCOU','ZGVR')
      AND EAN11 = ''
      AND ATTYP = '00'.

FETCH NEXT CURSOR S_CURSOR
             APPENDING CORRESPONDING FIELDS
             OF TABLE E_T_DATA
             PACKAGE SIZE S_S_IF-MAXSIZE.

  IF SY-SUBRC <> 0.
    CLOSE CURSOR S_CURSOR.
    RAISE NO_MORE_DATA.
  ENDIF.


1 REPLY 1
Read only

franois_henrotte
Active Contributor
0 Likes
330

first of all you have to put your FETCH into a DO ... ENDDO