Skip to Content
0
Former Member
Sep 23, 2014 at 07:25 AM

header table not get loaded into the internal table

30 Views

hi all

In my coding i have select some flds form the header table its not even getting loadded into the internal table whats the problem

this was my code

SELECT vbeln erdat kunnr waerk from vbak into TABLE it_vbak where vbeln = P_sales.

select * from vbap into table it_vbap FOR ALL ENTRIES IN it_vbak where vbeln = it_vbak-vbeln and

erdat = it_vbak-erdat and

waerk = it_vbak-waerk.

******* SELECT erdat waerk from vbap into table it_inf for ALL ENTRIES IN it_vbak where vbeln = it_vbak-vbeln.

select kunnr name1 from kna1 into TABLE IT_KNA1 for ALL ENTRIES IN IT_vbak WHERE SPRAS = 'en' AND KUNNR = it_vbak-kunnr.

select ebeln aedat EQ_EINDT zterm from ekko into table it_ekko where ebeln = P_Purch.

select * from ekpo into TABLE it_ekpo FOR ALL ENTRIES IN it_ekko where ebeln = it_ekko-ebeln and aedat = it_ekko-aedat .

loop at it_vbap into wa_vbap.

read TABLE it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.

if sy-subrc = 0.

wa_final-vbeln = wa_vbap-vbeln.

wa_final-erdat = wa_vbap-erdat.

wa_final-waerk = wa_vbap-waerk.

read TABLE it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.

if sy-subrc = 0.

wa_final-kunnr = wa_kna1-kunnr.

wa_final-name1 = wa_kna1-name1.

ENDIF.

ENDIF.

READ TABLE it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.

if sy-subrc = 0.

wa_final-ebeln = wa_ekpo-ebeln.

wa_final-AEDAT = wa_ekpo-aedat.

wa_final-EQ_EINDT = wa_ekko-EQ_EINDT.

select single vtext into wa_final-vtext from tvzbt where zterm = wa_ekko-zterm and spras = 'EN'.

endif.

append wa_final to it_final.

endloop.

with thanks

Maha.