02-25-2008 6:45 AM
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.
02-25-2008 6:48 AM
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
02-25-2008 6:50 AM
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.
02-25-2008 6:52 AM
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