Application Development 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: 

interial table read error

Former Member
0 Kudos

in this form. im moving the itab4 to itab

but my error in itab4 first row is move to itab, but second row is not moving.

why?

give a solution for me.

FORM FETCH_READ.

LOOP AT ITAB0.

READ TABLE ITAB1 WITH KEY EBELN = ITAB0-EBELN.

READ TABLE ITAB2 WITH KEY matnr = ITAB0-matnr.

READ TABLE ITAB3 WITH KEY lifnr = ITAB1-lifnr.

READ TABLE ITAB4 WITH KEY EBELN = ITAB0-EBELN.

READ TABLE ITAB5 WITH KEY EBELN = ITAB0-EBELN.

IF SY-SUBRC = 0.

MOVE ITAB0-EBELN TO ITAB-EBELN.

MOVE ITAB0-EBELP TO ITAB-EBELP.

MOVE ITAB0-MENGE TO ITAB-MENGE.

MOVE ITAB0-MEINS TO ITAB-MEINS.

MOVE ITAB1-BEDAT TO ITAB-BEDAT.

MOVE ITAB2-MATNR TO ITAB-MATNR.

MOVE ITAB2-MAKTX TO ITAB-MAKTX.

MOVE ITAB3-LIFNR TO ITAB-LIFNR.

move ITAB3-NAME1 TO ITAB-NAME1.

MOVE ITAB4-BELNR TO ITAB-BELNR.

MOVE ITAB4-MENGE TO ITAB-MENG1.

MOVE ITAB4-BUDAT TO ITAB-BUDAT.

MOVE ITAB4-DMBTR TO ITAB-DMBTR.

MOVE ITAB5-BELNR TO ITAB-1BELNR.

MOVE ITAB5-MENGE TO ITAB-1MENGE.

MOVE ITAB5-BUDAT TO ITAB-1BUDAT.

MOVE ITAB5-DMBTR TO ITAB-1DMBTR.

ENDIF.

APPEND ITAB.

ENDLOOP.

ENDFORM. "READ

by

karthi.

3 REPLIES 3

Former Member
0 Kudos

Hi

You need to check SY-Subrc for all the READs and then move then finally modify ITAB

Here since SY-SUBRC is checked after ITAB5 which may return >0

Regards

Shiva

Former Member
0 Kudos

Hi,

Check whether all read statements are not failing. You have only checked for all read statement. Before moving the data from one internal table to another internal table using read statement you have to check whether read statement is successful or not and then move the data.

Former Member
0 Kudos

Hi,

if second record of itab4 is not moving to itab and first record is moving then(as per ur code) the reason could be ...there is no record in itab0 with EBELN = itab4's second rows EBELN.................

Cheers,

jose