Application Development and Automation 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: 
Read only

accounting document - clearing

Former Member
0 Likes
1,829

Hi,

I would like to view if an accounting document is cleared or not, for a particular client, in sap databases not from VF03 - document flow .

Which is that indicator that tell me if an accounting document is cleared or not?

And if it's possible, please someone tell me which are the main tables involved in document flow:

sales order->...->accounting document.

Any help would be appreciated.

Thank you.

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,031

In the accounting document (header BKPF; items BSEG) you have to look for the Customer item ([BSID/BSAD|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bsidBSAD&adv=false&sortby=cm_rnd_rankvalue] or [BSEG-KOART = 'D' |https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bseg-koart%3D%27D%27&adv=false&sortby=cm_rnd_rankvalue]for debitor)

- If you go through BSID/BSAD, BSAD contains the cleared items and BSID the others)

- If you go through BSEG, check fields [BSEG-AUGDT or BSEG-AUGBL|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bseg-augdt+bseg-augbl&adv=false&sortby=cm_rnd_rankvalue] which are filled during the clearing

Look at table [VBFA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=vbfa&cat=sdn_all] for flow of document and at some threads like .

Regards

Read only

Former Member
0 Likes
1,031

Hi

The main accounting tables are BKPF (header) and BSEG (items), and you can also considere BSID (open item) and BSAD (cleared item) for customer.

But if you wan to do a query starting from sales invoice (VBRK):

- A) Search account document

BKPF-AWTYP = 'VBRK'.

BKPF-AWKEY = VBRK-VBELN.

This query is very fast because there's a standard index for those fields

- B) Search items

BSEG-BUKRS = BKPF-BUKRS.

BSEG-BELNR = BKPF-BELNR.

BSEG-GJAHR = BKPF-GJAHR.

BSEG-KOART = 'D'. <----


Items for customer only.

- C) Check if the document is cleared

IF NOT BSEG-AUGBL IS INITIAL. -


> Item is cleared. ENDIF.

If all items are cleared means the invoice is cleared.

U can also considere:

IF BSEG-AUGBL is initial -> u'll find a record in BSID else in BSAD.

Max

Read only

0 Likes
1,031

Many thanx Raymond Giuseppi & max bianchi

One more question: beside what you told me, i have run FBL5N report to see if coincide with table BSID.

And in FBL5N report there is a field called Probable Payment Date (Cash Discount 1 Due). I have not found this field in BSID table. This field is automatically calculated based on Document Date in Document and Cash discount days 1 (terms of payment) OR it's stored somewhere in a table??

Ex: Document Date = 01.11.2008

Cash discount days 1 = 10

-


=>_Probable Payment Date (Cash Discount 1 Due)_ will be 11.11.2008

What about field Days in Arrears by Net Due Date from FBL5N? It's calculated like Probable Payment Date?

(Payment Date - current date) I think it is ... but i want to be sure about this.

Again I thank those who helped me.

Read only

0 Likes
1,031

Hi Dan

I can't find the field Probable Payment Date (Cash Discount 1 Due). I have a field called "Cash Disc. 1 Due", but it's a flag not a date. This flag is set at runtime (it belongs to the layout structure RFPOS*), perhaps you're speaking about the baseline date (BSEG-ZFBDT)?

If it's so that date is calculated by fm NET_DUE_DATE_GET, here it needs to use the cash discount fields (ZFBD1T, ZFBD2T, ZFBD3T): these fields depend on term of payment (ZTERM).

If you're speaking about other field u should check if it's a custom fields and so if it's filled by an user-exit (probably BTE) called by FBL5N.

Anyway u should considere the output fields are in structures RFPOS*, the values of most of fields are transfered from BSEG (BSID/BSAD) directly, but other fields can be calculated at runtime: u should check the fm FI_ITEM_DISPLAYS.

Max

Edited by: max bianchi on Nov 14, 2008 12:33 PM

Read only

0 Likes
1,031

This kind ogf field is calculated during display process, this short code used in many report and logical database may help you

TABLES: BSEGH, BSEGA, FAEDE. " force sharing data 
MOVE-CORRESPONDING bseg TO bsegh. " pass data
PERFORM got_bsega(sapbsega). " bsega and faede are now filled.

Regards