Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

to get lifnr

Former Member
0 Kudos
616

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 .....

2 REPLIES 2

Former Member
0 Kudos
255

Hi,

Get the Document number from BKPF and input the document number in BSEG and get the LIFNR number.

Thanks,

Sriram Ponna.

Former Member
0 Kudos
255

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.