2008 Jun 13 10:05 AM
Hi experts i have got 'belnr' from 'bseg' table by providing
corresponding 'hkont' field values.
And also got 'budat' from 'bkpf' for the corresponding
values of 'belnr' from bseg.
Now my problem is how to get the 'lifnr' values in 'bseg'
(for the corresponding values of 'bkpf-belnr' and 'bseg-belnr').
send me the coding .....
2008 Jun 13 10:11 AM
Hi,
Get the Document number from BKPF and input the document number in BSEG and get the LIFNR number.
Thanks,
Sriram Ponna.
2008 Jun 13 10:19 AM
hi,
write the code as:
data: v_hkont type bseg-hkont.
data:begin of itab occurs 0,
belnr type bseg-belnr,
lifnr type bseg-LIFNR,
budat type bkpf-budat,
end of itab.
data:begin of itab1 occurs 0,
belnr type bseg-belnr,
budat type bkpf-budat,
end of itab1.
select belnr lifnr from bseg into corresponding fields of table itab
where hkont = v_hkont.
select belnr budat from bkpf into corresponding fields of table itab1 for all entries in itab
where belnr = itab-belnr.
loop at itab.
read table itab1 with key belnr = itab-belnr.
itab-budat = itab1-budat.
modify itab index sy-tabix transporting budat.
endloop.
there fore in this way itab table will contain corresponding belnr,lifnr,budat.
I hope this piece of code will help you in achieving your requirement.