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: 

Faster retrieval of accounting document details via Profitability Segment

Former Member
0 Kudos

Hi Everyone!

My dilemma goes like this: I need to get the accounting doc details of a vendor credit memo, but the only information that I have is the sales order reference, which is stored in the profitability segment of one of the line items.

What I am doing right now are the following:

(1) Using the sales order# as selection criteria, get the prof. segment number from table CE4xxxx_ACCT, where xxxx is my operating concern

(2) From the CE4xxxx_ACCT data, get BSEG entry using profitability segment number, company code, and document year

(3) Get additional information needed from BKPF based on retrieved BSEG data.

My main problem is step 2, since the primary keys that I have are only the company code and document year, so it's quite slow.

Is there any other way to retrieve BSEG data based only on the profitability segment data?

Many thanks

6 REPLIES 6

Former Member
0 Kudos

This may give you some ideas.

[Quickly Retrieving FI document Data from BSEG|/people/rob.burbank/blog/2007/11/12/quickly-retrieving-fi-document-data-from-bseg]

Rob

0 Kudos

Hi Rob,

Thanks for the link. It did prove some helpful ideas on how to tackle my problem. I have also considered using the BSIS/BSAS tables to retrieve what I need. Unfortunately, both tables don't have the PAOBJNR field that need for the selection.

Former Member
0 Kudos

Hi,

You say you have Sales Order details available.

Does the Sales Document Flow table (VBFA) provide any assistance?

Take a look at program RIBELF00 and see if it provides hints on a path for the access you want.

Andrew

0 Kudos

Hi Andrew,

Thank you for the help. I tried the program you suggested, but it does not return the information that I need. The sales order number is being used as reference to the vendor credit memo, which is not traceable in the document flow.

I appreciate the effort, though.

Former Member
0 Kudos

If there is a SAP transaction which provides the ability to display the first document and then link to the accounting document by a menu option such as "Accounting Documents" or "Document Flow", I would suggest you turn on SQL trace (ST05) and run the transaction and perform the link. The resulting trace should show the sequence of tables the SAP code uses to link the two documents, and you can drill down to the source code to see if it uses any standard function modules.

May provide some hints.

Andrew

Former Member
0 Kudos

This message was moderated.