Skip to Content
0
Former Member
May 14, 2008 at 10:47 AM

problem with Read stat..

22 Views

Hi Experts,

here am trying to read 2 internal tables, by loping one table.

but the problem am using READ stat for 2 tables, for these case i ve proper data in all internal tables before looping tables.

while reading first( it_aufk ) is ok, but 2nd table ( it_afvc ) is not reading, for this while debugging i found correct data in internal tables. even though it_afvc is not reading ( i.e data is nt coming to header ) at all.

my peace of code is:

LOOP AT it_tab2.

it_dummy-psphi = it_tab2-psphi.

it_dummy-posid = it_tab2-posid.

it_dummy-pspid = it_tab2-pspid.

it_dummy-pspnr = it_tab2-pspnr.

it_dummy-post1 = it_tab2-post1.

READ TABLE it_aufk WITH KEY pspel = it_tab2-pspnr BINARY SEARCH.

IF SY-SUBRC EQ 0.

it_dummy-pspel = it_aufk-pspel.

it_dummy-objnr = it_aufk-objnr.

it_dummy-bukrs = it_aufk-bukrs.

it_dummy-aufnr = it_aufk-aufnr.

it_dummy-ktext = it_aufk-ktext.

ENDIF.

  • problem is below table

READ TABLE it_afvc WITH KEY PROJN = it_tab2-pspnr

BINARY SEARCH.

IF SY-SUBRC EQ 0.

it_dummy-projn = it_afvc-projn.

it_dummy-vornr = it_afvc-vornr.

ENDIF.

APPEND it_dummy.

CLEAR it_dummy.

ENDLOOP.

Could anyone tell where i ve gone wrong.

Thanks in advance.

kumar.