cancel
Showing results for 
Search instead for 
Did you mean: 

Link to find Accounting document number from Material document number / PO

Former Member
0 Kudos

Hi

We are working on a custom report, in which we need to print purchasing details (from EKPO, EKKO & EKBE) as well as accounting details (from BSEG & BKPF). We need to hit BKPF/BSEG with the accounting document number, since it is the only key field (though PO number is there in BKPF, we can not use this because it is not a key field)

My question from which table we get the accounting document number ? We need to provide a link between purchasing & accounting through accounting document number, but how to find the accounting document number. ?

Thanks

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You will get the material document number from EKBE. using this Material document number check in MSEG to get hte accounting document number. so you will find the link between PO number and accounting document number.

Regards,

Ramakrishna

Former Member
0 Kudos

Hi Ramakirshna

MSEG don't have the accounting document number field !

Thanks

Venkat.

Former Member
0 Kudos

PO no --> Material document : Table EKBE (Purchase order history)

Material document --> Accounting document : Table BKPF (Accounting Document Header) here you need to apply logic Doc type = WE (Goods Receipt), Ref. procedure = MKPF (Mat doc header table)

In BKPF table the object key will be the material document number + YEAR.

Hope this helps.

Regards

Arif Mansuri

Former Member

Venkat,

I guess you are trying to fetch Accouting Documents for goods receipt against PO.

To do this, you need to look at the PO History table (EKBE) and find out the Corresponding material document (VGABE = 1 for good receipt).

Get the value of BELNR and GJAHR.

Concatenate BELNR and GJAHR into your refernce key (like BKPF-AWKEY).

Then use this key to read table BKPF with the following key

AWTYP = 'MKPF' for Material document

AWKEY = reference key generated above.

AWSYS = the value of the logical system (if used) or blanks

This will get you quicker access as compared to what you've described below. In this case, the system uses a standard SAP Index "Index by application type and key" to fetch the relevant records.

Hope this helps.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

First take Table MKPF field MBLNR.

Go to BKPF table and search search key AWKEY this id nothing but Material document number.in same table u can find Accounting number BELNR.

table BSEG in this table u can find Purchasing document or BSET.

Pls give me points if this is usefull.

Raghu

Former Member
0 Kudos

Hi Raghu

You are right. But we want to got BKPG/BSEG with the accounting document number. Because material document number/PO doc. number are not a key fields in these fields. Getting accounting document number through material doc. number would take lottt of time, since this field is not a key field.

If you know to find accounting doc number in anyother way, please let us know

Thanks

Venkat.

Former Member
0 Kudos

hi,

If u r restricting to some table how can u get the fields and then BKPG table itself not there and one more thing At the time of Accounting entry Material,PO not comming into the picture u should choice another table also.

Raghu

Former Member
0 Kudos

HI raghu

I don't mind going for another table. My concern here is the performance issue. I treid fetch the accounting document number from BKPF through PO number. It took 30 mins. I absolutely dont have any problem to refer other tables.

Former Member
0 Kudos

Hi

It is located in a structure (RF05L) field name is BELNR.

regards

Yogesh

Former Member
0 Kudos

I don't want reference from structure. I am writing a custom program, in which i need to access data from table. My question was, from which table i should able to find the accounting document number through purchasing/material document ?