10-25-2006 12:13 PM
Hi all,
I am working in 4.6c, i have written a select query as below but it is not populating the internal table.please help . urgent.
SELECT lifnr
name1
brsch
INTO CORRESPONDING FIELDS OF TABLE vend_det
FROM lfa1
FOR ALL ENTRIES IN po_hdr
WHERE lifnr = po_hdr-lifnr
AND brsch = 1.
10-25-2006 12:26 PM
Hi Satya,
get all the lifnrs into IT_lifnr.
delete adjacent duplicates from it_lifnr.
if not it_lifnr[] is initial.
select lifnr
name1
into table vend_Det
from lfa1
for all entries in it_lifnr
where lifnr = it_lifnr-lifnr
and brsch = '0001'.
endif.
this should work.
-Anu
10-25-2006 12:17 PM
try this..., change the ones in bold
<b>if not po_hdr[] is initial.</b>
SELECT lifnr
name1
brsch
INTO CORRESPONDING FIELDS OF TABLE vend_det
FROM lfa1
FOR ALL ENTRIES IN po_hdr
WHERE lifnr = po_hdr-lifnr
AND brsch = <b>'0001'</b>.
<b>
endif.</b>
10-25-2006 12:21 PM
I tried even this, but it is not populating the internal table. the required vendor number(LIFNR) is present in the PO_HDR internal table but i dont know why it is not populating the <b>vend_det</b> internal table.
10-25-2006 12:24 PM
for that combination of LIFNR and BRSCH chk if it exits in LFA1,
also while checking if the internal table used for for all entries is initial or not , check the whole body , i.e give square brackets
10-25-2006 12:26 PM
Hi Satya,
get all the lifnrs into IT_lifnr.
delete adjacent duplicates from it_lifnr.
if not it_lifnr[] is initial.
select lifnr
name1
into table vend_Det
from lfa1
for all entries in it_lifnr
where lifnr = it_lifnr-lifnr
and brsch = '0001'.
endif.
this should work.
-Anu