Link between BSEG and MSEG items
Hi,
I am trying to find a link between the material movement line item (MSEG) and the accounting lines(BSEG).
Using MBLNR + MJAHR I can read BKPF via AWKEY.
But I cannot tie the two records(credit/debit) in BSEG to the movement line on MSEG.
There must be an index or something to link the field ZEILE in MSEG to field BUZEI in BSEG. I have the values for BELNR and GJAHR from MKPF.
Any help would be appreciated.
Cheers
Rob King
Not very sure but maybee BSEG-OBZEI (Item number in original document) is what you need.
CaKe
No, there is no "natural" link between mseg item and bseg item.
In our company, we implemented user exit MBCF0002 for resolve this.
(EXIT_SAPMM07M_001 )
We "codify" mseg-sgtxt and bseg sgtxt with informations of original item
Example :
concatenate '/' i_mseg-bwart '/' i_mseg-sobkz '/' wv_zeile'/' into e_sgtxt.
Attention : the manage of wv_zeile is not the same for all movement.
For example :
if ( i_mseg-bwart = '411' or i_mseg-bwart = '412' )
and i_mseg-sobkz ne ' '.
wv_zeile = ( i_mseg-zeile * 2 ) - 1.
else.
wv_zeile = i_mseg-zeile .
endif.
==> Check other movements code in your system.
Regards,
Djoudjou
Tried that but it contains 000 for all 22 records I am looking at.
The only field on BSEG that can be tied back to MSEG is the AUFNR (Order) field and this is only on half of the records where SHKZG (credit/debit) is set to "S". Plus the fact that you could do two issues of the same material on the same order under the same document.
I am not even sure if SAP can display the accounting info for a single line of a material issue.
Cheers
Rob
Thanks Djoudjou,
Sounds like the only way round this problem.
In the mean time we have asked the user to only issue one material for an order, as apposed to the same material to several orders.
Cheers
Rob