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: 

Map MSEG to BSEG

Former Member
0 Kudos

Hi,

Can you please help me in linking the MM document to the corresponding

Accounting document line item wise.

We can find the corresponding Accounting documents (BKPF) for a MM document (MKPF)

using the Function module: AC_DOCUMENT_RECORD.

But is it possible to Find this line item of an MM doc. (MSEG) corresponds to these many lines

of an Accounting document (BSEG).

Is there any function module or can you help me with the table mappings for this.

Regards,

Midhun.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

The link can be done for whole document only:

MKPF_KEY-MBLNR = MKPF-MBLNR.
MKPF_KEY-MJAHR = MKPF-MJAHR.

SELECT * FROM BKPF WHERE AWTYP = 'MKPF'
                     AND AWKEY = MKPF_KEY.
  EXIT.
ENDSELECT.

SELECT * FROM BSEG INTO TABLE T_BSEG 
                    WHERE BUKRS = BKPF-BUKRS
                      AND BELNR = BKPF-BELNR
                      AND GJAHR = BKPF-GJAHR.

The MM items are collected in the same FI item, if they have the same G/L accounting, I believe there's no function module, but it depends on your customizing (T030 table): here you can find out the rules to determine the account for every MM item.

Max

4 REPLIES 4

Former Member
0 Kudos

hi

try with this

use bkpf-awkey,referance object

it will give referance material doc no.

it is used as FI to MM link.

Former Member
0 Kudos

i think it is not possible but if you can join bkpf and mkpf then through this you can join mseg and bseg.

i mean

mkpf and mseg.

bkpf and bseg.

regards

shiba dutta

Former Member
0 Kudos

Hi

The link can be done for whole document only:

MKPF_KEY-MBLNR = MKPF-MBLNR.
MKPF_KEY-MJAHR = MKPF-MJAHR.

SELECT * FROM BKPF WHERE AWTYP = 'MKPF'
                     AND AWKEY = MKPF_KEY.
  EXIT.
ENDSELECT.

SELECT * FROM BSEG INTO TABLE T_BSEG 
                    WHERE BUKRS = BKPF-BUKRS
                      AND BELNR = BKPF-BELNR
                      AND GJAHR = BKPF-GJAHR.

The MM items are collected in the same FI item, if they have the same G/L accounting, I believe there's no function module, but it depends on your customizing (T030 table): here you can find out the rules to determine the account for every MM item.

Max

Sathish
Employee
Employee
0 Kudos

There is no direct link between MSEG & BSEG. The link happens through PO Documents. This can be determined by the fields EBELN & EBELP in the tables MSEG & BSEG. Another field which can help is MATNR in BSEG table.

Hope the above helps.