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: 

BSEG to VBAK

Former Member
0 Kudos

Dear All Experts,

I want to find Sales Order number for particular FI document. Means i want to link BSEG and VBAK tables. Kindly help to link these two tables. BSEG-VBELN VBEL2 both are blank....any other link.....

Regards,

Shaligram.

4 REPLIES 4

sanilbhandari
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi

In VBRK, you will get the Sales Order No also. Further, pass sales invoice no along with fiscal year in field AWKEY of BKPF Table and get the BELNR as output. This is the FI Document No of Billing Invoice of a Sales Order

Regards

Sanil Bhandari

Sanil Bhandari

Former Member
0 Kudos

This message was moderated.

former_member201275
Active Contributor
0 Kudos

you can't link directly.

instead use link from vbak to bkpf.

and then bkpf to bseg.

eg.

first fetch belnr from bkpf where passing AWTYP = "VBAK"

then link bseg- vbak.

with associative property.

a=b, b=c.

then a=c.

raymond_giuseppi
Active Contributor
0 Kudos

- From BSEG read BKPF

- There look at field AWTYP and AWKEY

- If AWTYP is 'VBAK', AWKEY contains key of VBAK

- If AWTYP is 'VBRK', AWKEY contains key of VBRK, then from VBRK read VBAK

Look at table TTYP to find how AWKEY is mapped to key fields, there you may find a structure or a FM to execute the mapping.

Also use sdn search tool to find document like [Copy of Link Between SAP SD, MM & FI|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=45427] or [Link Between SAP SD, MM & FI|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=33768&decorator=printable]

Regards,

Raymond