Skip to Content
0
Former Member
Apr 22, 2008 at 11:10 AM

correct the code

15 Views

hi, my requirement all the data in t_adrc,t_bkpf,t_bseg,t_vaddress and t_vendor into final internal table

t_data.

SELECT SINGLE adrnr FROM t001 INTO t001-adrnr

WHERE bukrs EQ po_bukrs.

SELECT street

str_suppl2

city1

region

post_code1

FROM adrc

INTO TABLE t_adrc

WHERE addrnumber EQ t001-adrnr.

SELECT belnr

bldat

xblnr

usnam

FROM bkpf

INTO TABLE t_bkpf

WHERE belnr IN so_belnr AND

budat IN so_budat AND

blart IN so_blart.

SELECT belnr

zuonr

sgtxt

lifnr

hkont

prctr

kostl

dmbtr

FROM bseg

INTO TABLE t_bseg

FOR ALL ENTRIES IN t_bkpf

WHERE ( lifnr IN so_lifnr or

lifnr eq ' ' ) and

belnr EQ t_bkpf-belnr.

SELECT SINGLE adrnr FROM lfa1 INTO lfa1-adrnr

WHERE lifnr IN so_lifnr.

SELECT street

str_suppl2

FROM adrc

INTO table t_vaddress

WHERE addrnumber EQ lfa1-adrnr.

SELECT lfa1~name1

lfa1~ort01

lfa1~regio

lfa1~pstlz

knvk~namev

knvk~name1

INTO TABLE t_vendor FROM knvk INNER JOIN lfa1 ON

lfa1lifnr = knvklifnr

WHERE lfa1~lifnr IN so_lifnr and

lfa1~adrnr eq adrc-addrnumber.

t_data-street = t_adrc-street.

t_data-street3 = t_adrc-str_suppl2.

t_data-city = t_adrc-city1.

t_data-region = t_adrc-region.

t_data-post_code1 = t_adrc-post_code1.

t_data-bldat = t_bkpf-bldat.

t_data-belnr = t_bkpf-belnr.

t_data-xblnr = t_bkpf-xblnr.

t_data-usnam = t_bkpf-usnam.

t_data-zuonr = t_bseg-zuonr.

t_data-sgtxt = t_bseg-sgtxt.

t_data-vendorfname = t_vendor-namev.

t_data-vendorname1 = t_vendor-name2.

t_data-vendorname = t_vendor-name1.

t_data-vendorstreet = t_vaddress-street.

t_data-vendorstreet3 = t_vaddress-str_suppl2.

t_data-ort01 = t_vendor-ort01.

t_data-regio = t_vendor-regio.

t_data-pstlz = t_vendor-pstlz.

t_data-lifnr = t_bseg-lifnr.

t_data-hkont = t_bseg-hkont.

t_data-prctr = t_bseg-prctr.

t_data-kostl = t_bseg-kostl.

t_data-dmbtr = t_bseg-dmbtr.