cancel
Showing results for 
Search instead for 
Did you mean: 

Link between cost- and accounting-document

Former Member
0 Kudos

Hi All,

currently I got stuck while analyzing the connection between cost and accounting documents in R/3.

The target is to get a reference which accounting document is linked to which cost document. My source is always the number of the cost document and I need to find the relevant accounting document.

I need the tables in ERP where this information is stored, as I like to extract that in a business warehouse.

What I do in ERP is the following:

I display a cost document in KSB5.

Select "Environment -> Accounting documents" to display the list of documents in accounting.

In this list I select the accounting document which is displayed in FB03.

Now I like to get the tables which are used to store this information which I displayed as described.

BSEG is used for information about accounting documents.

COEP is used for information about cost documents.

But where can I find the link between those two documents? Where is the information stored, which can be found in the "list of documents in accounting"?

Thanks in advance for your help,

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

iklovski
Active Contributor
0 Kudos

Hi,

As a general remark: if you don't see the connection between the data sources in SAP, you can view the SQL SAP is using to fetch the data. You can do it via ST05 transaction. In your case, open a separate session with ST05 and push 'Activate trace' button; then, go to your other session where the report is open and go to 'Environment' - 'Accounting Documents'. After that, without selecting any document, go back to ST05 session, stop the trace and display it: you will see all the relevant SQL connections, e.g. BKPF-COBK (for CO documents), BKPF -GLPCA (for PCA documents), etc.

Regards,

Eli

Former Member
0 Kudos

But be aware to activate trace for productive system, or put filter, because it can take a lot of server resources for a short time

Former Member
0 Kudos

Hi Eli,

I have to ask our IT department if they are able to star such a trace. But perhaps we can find the relevant information this way, thanks a lot!

iklovski
Active Contributor
0 Kudos

Hi,

It's not connected to IT department; you can do it yourself. Regarding your remark: COBK contains all CO documents, i.e. not only those which result from FI document, and in these cases COBK-REFBN will not refer to BELNR of BSEG (or more correctly to say of BKPF). Example of such documents: internal CO allocations, logistic documents, etc.

In case there is a connection between COBK and BKPF (FI document), AWTYP field in COBK will be equal to "BKPFF".

Regards,

Eli

iklovski
Active Contributor
0 Kudos

@Alex: If you activate it just to see the document and switch it off right after, no impact on the system is to be expected.

Former Member
0 Kudos

Hi, Eli, I meant if you activate it w/o filter, then trace perform for all users which are doing something in system in that moment. Thats why I advised to use filter eg by User name

iklovski
Active Contributor
0 Kudos

Ah, OK; in this sense - certainly. Alternatively, trace could be activated in any system apart from Production. After all, SQL will be the same

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, if you know BSEG data then you can find CO doc via table COBK. How to link doc number - COBK-REFBN=BSEG-BELNR

Former Member
0 Kudos

Hi Alex,

thanks for your reply. Unfortunately I have many examples where COBK-REFBN is NOT BSEG-BELNR. The reference document is very often not the same as the accounting document.

And in general, I have the CO document as a starting point. So I should start in one of the CO tables and continue from there to the accounting document.

Do you have any other ideas?