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 and financial document number

Former Member
0 Kudos
68

Hai Friends,

How can i link material document number and financial document number

4 REPLIES 4

andreas_mann3
Active Contributor
0 Kudos
47

try mseg-Belnr and bkpf(or bseg)-belnr

A.

Former Member
0 Kudos
47

Hi,

Invoice Reference number is stored in FI document. Table is BSIK and BSAK.

Former Member
0 Kudos
47

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

Former Member
0 Kudos
47

hi,

the link is

BKPF-AWKEY= MKPF-Mblnr + MKPF-MJAHR.(Concatenation of Mat.Doc and Mat. Doc. Year)

Hope this helps you.

Raj

Edited by: Raj on Dec 3, 2008 5:57 AM