Skip to Content
0
Jun 27, 2011 at 10:53 AM

READ TABLE is not working

161 Views

READ TABLE .......... INTO ............ is not executing in one of my programs.


LOOP AT i_bseg INTO struct_bseg.

  READ TABLE I_BKPF INTO STRUCT_BKPF WITH KEY
                        BUKRS = STRUCT_BSEG-BUKRS
                        BELNR = STRUCT_BSEG-BELNR
                        GJAHR = STRUCT_BSEG-GJAHR.

IF SY-SUBRC = 0.
STRUCT_BKPF_BSEG-LIFNR = STRUCT_BSEG-LIFNR.
STRUCT_BKPF_BSEG-MENGE = STRUCT_BSEG-MENGE.
STRUCT_BKPF_BSEG-MEINS = STRUCT_BSEG-MEINS.
STRUCT_BKPF_BSEG-DMBTR = STRUCT_BSEG-DMBTR.
STRUCT_BKPF_BSEG-MATNR = STRUCT_BSEG-MATNR.
STRUCT_BKPF_BSEG-EBELN = STRUCT_BSEG-EBELN.
STRUCT_BKPF_BSEG-BUKRS = STRUCT_BKPF-BUKRS.
STRUCT_BKPF_BSEG-BELNR = STRUCT_BKPF-BELNR.
STRUCT_BKPF_BSEG-BUDAT = STRUCT_BKPF-BUDAT.
STRUCT_BKPF_BSEG-XBLNR = STRUCT_BKPF-XBLNR.
STRUCT_BKPF_BSEG-WAERS = STRUCT_BKPF-WAERS.
 APPEND STRUCT_BKPF_BSEG TO I_BKPF_BSEG.
ENDLOOP.

but the same statement is working fine in some other program. What may be the reason?