‎2007 Mar 30 6:07 AM
Hi
How to link VBAK(sales order)and VBRK(billing document)?
what are the fields to link and how to link. because vbak-vbeln is sales order number and vbrk-vbeln is billing document number.
need help...
Thanks
smita
‎2007 Dec 18 4:42 PM
I realize you've probably figured this out by now, but since I found this on a search and others might, here's what I found:
VBAK joins VBAP through VBELN
VBAP joins VBRP through VBAP-VBELN=VBRP-AUBEL and VBAP-POSNR=VBRP-AUPOS
VBRP joins VBRK though VBELN
The data elements for VBELN are different even though the names are the same (se11 helps)
I'm sure some of the other answers worked, I just couldn't follow them.
‎2007 Mar 30 6:09 AM
vbrk-vgbel same as lips-vbeln
and now lips-vgbel is same as vbak-vbeln.
‎2007 Mar 30 6:13 AM
hopen this helps
Hope this will give u some idea..
select avbeln bfkdat into table itab from vbak as a inner join
vbrk as b on
avbeln = bvbeln where
a~audat in s_audat.
if not itab[] is initial.
select fkimg into corresponding fields of table itab_final
from vbrp for all entries in itab
where vbeln = itab-vbeln and
matnr = p_matnr and
charg = p_charg.
endif.
regards
navjot
Pls reward fopr helpful replies!!
Message was edited by:
navjot sharma
‎2007 Mar 30 6:24 AM
Hello,
Please check VBFA table.
You get relation between sales order number and billing document number there.
Regards,
tarun
‎2007 Mar 30 6:28 AM
Hi tarun
I know VBFA table link between VBAK and VBRK , But what are fields and how?
‎2007 Mar 30 6:30 AM
hi,
Following tables are included in link (In chronological order):
VBAK - sales documetn header,
VBAP - Sales document item
LIPS - Sales doc. Delivery items
VBRP - billing item data
VBRK - Billing header
generally sales doc and billing docs are related by delivery docs.
u can join these tables using joins in select statement.
join structure will loolk like.:
select .....
from vbak as a
inner join vbap as b on avbeln = bvbeln
inner join lips as c on cvgbel = bvbeln and cvgpos = bposnr
inner join vbrp as d on dvgbel = cvbeln and dvgpos = cposnr
inner join VBRK as e on evbeln = dvbeln
.
.
.
Also, pl refer following file, very helpful, forever.
http://www.sap-img.com/sap-download/sap-tables.zip
Jogdand M B
PS: Reward if helpful...
‎2007 Mar 30 6:31 AM
vbrp-vgbel = lips-vbeln
Get vgbel from lips
lips-vgbel = vbak-vbeln.
‎2007 Mar 30 6:33 AM
hi,
vbrk-vbeln eq vbak-vbeln for vbak-vbtyp eq 'M'.
VBTYP is SD document category.
u can use
on VBRKVBELN EQ VBAKVBELN
WHERE VBAK~VBTYP EQ 'M'.
‎2007 Mar 30 6:39 AM
Hi..
VBFA table is the table for Sales Document Flow..SO In the field "Follow-On-Document" if we type the Billing document number, you will get the preceeding documents..there you can see the Sales Document numbers corresponding to them...
select VBELV
from VBFA
into table itab
where vbeln in s_billindocument
and VBTYP_N = 'M'.
try this..
Message was edited by:
Rammohan Nagam
‎2007 Mar 30 6:47 AM
Hi,
You can link VBRP and VBAP table using VBRP-AUBEL = VBAP-VBELN and VBRP-AUPOS = VBAP-POSNR.Header table you can't link, always links will be in Item tables.
Join VBAK and VBAP and VBRL VBRP using above link:
You can also using VBFA table:
Pass the Preceding Document as VBAK-VBELn and Preceeding Doc type as C(order) and Subceeding Doc as VBRK-VBELN and Subse doc Type as M.
hope you understood .
reward if useful
regards,
Anji
‎2007 Mar 30 7:39 AM
hi
these are table relations
vbak n vbrk is vbeln
vbak n vbrp is vbeln
vbak n vbfa is vbeln, vbelv n vbtyp_n
vbak n lips is vbeln
Regards,
alson
‎2007 Dec 18 4:42 PM
I realize you've probably figured this out by now, but since I found this on a search and others might, here's what I found:
VBAK joins VBAP through VBELN
VBAP joins VBRP through VBAP-VBELN=VBRP-AUBEL and VBAP-POSNR=VBRP-AUPOS
VBRP joins VBRK though VBELN
The data elements for VBELN are different even though the names are the same (se11 helps)
I'm sure some of the other answers worked, I just couldn't follow them.
‎2013 May 16 12:43 PM