cancel
Showing results for 
Search instead for 
Did you mean: 

billing/accounting linkage

Former Member
0 Kudos

we have one SD billing document, document 13000005, with multiple line items for different material, line item1 is with revenue 1000, cost 800, line item 2 is with revenue 1300, cost 900, cost 800 and 900 are posted to different COGS account

from billing document number, how can I link to delivery accounting document line item through table or function module, for e.g. I want to link billing line item1 with delivery accounting document which post to COGS account

Accepted Solutions (0)

Answers (3)

Answers (3)

srinu_s1
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi, the approach provided so far didn't work for order related billing, because there is no delivery.

so in the table level, can we identify whether it is order related billing or delivery related billing?

if it is order related, from billing document number, how can I get the accounting document for COGS posting? thanks

Former Member
0 Kudos

Any idea?

suman_sardar2
Active Contributor
0 Kudos

Siva,

If your business process is Order related billing then how COGS comes in the picture as you are not doing the delivery & COGS is your inventory movement in PGI.

The movement type 601 is used for sales from a delivery.

Please explain your exact requirement along with business process.

Find the answer for your query.

"May I know if I already know billing document, from which table we can get SO number?"

>> This can be fetched from VBRP table check VBRP-AUBEL where VBRP-AUTYP='C'

"from outbound delivery, which table can we get Sales order number?"

>> You can get this from LIPS table check LIPS-VGBEL where LIPS-VGTYP='C'.

Note :Also want to  share you that VBFA is the only table to get the data faster from any other alternatives.So prepare your report depending on the data volume of your system.

Hope this is clear to you.

Thanks,

Suman$

Former Member
0 Kudos

Hi Siva,

Simple way of Getting your Accounting document document for your billing document is as mentioned below:

BKPF-XBLNR = VBRK-XBLNR

BKPF-BUKRS = VBRK-BUKRS

BKPF-GJAHR = VBRK-FKDAT+(4).

It will help you help you get accounting document no..

Thanks,

Munvar.

former_member186385
Active Contributor
0 Kudos

Hi Siva,

in VBRP-VGBEL you can get the delivery document , provided if the billing created from Delivery

with the delivery number you can check Accounting document number in MSEG

hope it is clear

regards,

santosh

suman_sardar2
Active Contributor
0 Kudos

Hi Santosh,

First of I am not getting that MSEG stores the accounting document as per my knowledge it should be in BKPF & BSEG.

Also want to know that how can I get the Material doc no in MSEG with the help of Delivery no.

Thanks in advance.

Thanks,

Suman$

suman_sardar2
Active Contributor
0 Kudos

Hi Siva,

Yes you can do this by simple table join logic and provide the same to ABAP to meet the requirement.

For your case the driving document will be Billing doc VBRK-VBELN.

You have to follow the table VBRK/VBRP to VBFA-VBELN and take the VBFA-VBELV where VBFA-VBTYP_V = J (Delivery).

Then pass the VBFA-VBELV to BKPF-XBLNR and fetch the BKPF-BELNR then pass this to BSEG-BELNR with fiscal year and company code to get the details line items.

Hope this will help you.

If you have any doubt do let me know.

Thanks,

Suman$

Former Member
0 Kudos

Thanks,

May I know if I already know billing document, from which table we can get SO number? from outbound delivery, which table can we get Sales order number?

I don't like to use VBFA table, is there any other way?