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: 

Material document number

Former Member
0 Kudos

In ME23N for a material document number under Doc.Info tab, in FI Document button we can see the list of document number related to that material document number.

How can i relate the material document number with the doc.number accounting. i want to show that the material doc.no '123' is related to the following Doc.No '54457', '457848', '4874897'.........

Give me the table link for this.

2 REPLIES 2

Former Member
0 Kudos

Hi,

You can get Invoice Number in PO history tab. Those information stored in table EKBE. Then you can get FI document number in table BSIK and BSAK for Vendor and In table BSID and BSAD for customer. You use field Invoice reference number/Billing doc. Num to identify the entry.

Former Member
0 Kudos

Hi,

I did below for my requirement to get payment document number. It will useful to you

FORM GET_PAY_DOC .

data: wa_bkpf TYPE bkpf.

data: wa_obj_key TYPE bkpf-AWKEY,

wa_AUGBL TYPE bsak-AUGBL.

SELECT SINGLE belnr GJAHR from ekbe into (it_table-belnr, it_table-GJAHR)

where ebeln eq it_table-ebeln AND

ebelp eq it_table-ebelp AND

BEWTP eq 'Q' AND

XBLNR eq it_table-tknum.

CHECK sy-subrc eq 0.

CONCATENATE it_table-belnr it_table-GJAHR INTO wa_obj_key.

SELECT SINGLE bukrs belnr GJAHR from bkpf into CORRESPONDING FIELDS OF wa_bkpf

where awtyp = 'RMRP' AND

awkey = wa_obj_key.

CHECK sy-subrc eq 0.

SELECT SINGLE AUGBL from bsak into wa_AUGBL

where bukrs eq wa_bkpf-bukrs AND

lifnr eq it_table-tdlnr AND

belnr eq wa_bkpf-belnr AND

GJAHR eq wa_bkpf-GJAHR.

CHECK sy-subrc eq 0.

SELECT SINGLE belnr budat from bsak into (it_table-belnr1, it_table-Budat)

where bukrs eq wa_bkpf-bukrs AND

lifnr eq it_table-tdlnr AND

AUGBL eq wa_AUGBL AND

GJAHR eq wa_bkpf-GJAHR AND

blart eq 'KZ' and

belnr ne wa_bkpf-belnr AND

SHKZG eq 'S'.

ENDFORM. " GET_PAY_DOC