Sei sulla pagina 1di 18

Valuation of a

subcontracting
order

Jürgen Müller
Development MM-IM, SAP
(Version 1.01 03.07.2002)
General

The material to be produced by the vendor can be ordered as a subcontract


item in a purchase requisition, purchase order, or scheduling agreement.
Each subcontract item has one or more sub-items that contain the individual
components the vendor needs to perform the subcontract work or value-
added service.
The individual component items can either be
Entered or changed manually
Copied from an existing bill of material (this is known as a BOM explosion)
While posting a goods movement for a valuated material, the system has to
create an accounting document. The logic behind the creation of this
accounting document is always similar.
1. Determine the value string that should be used
2. Determine the involved currency types
3. Perform the valuation
4. Create the accounting document

 SAP AG 2002, Valuation (General), Juergen Mueller 2


General

A subcontracting order can be created using transaction ME21 (or


transaction MEPO) with item category ‘L’ (Subcontracting).

 SAP AG 2002, Valuation (General), Juergen Mueller 3


General

Simillar to a standard purchase order, a subcontracting order can


have for example

an account assignement

fright conditions

Goods receipt based invoice verification active

The value of the produced material will also be calculated based on


the purchase order history, that means based on the WRX account.

The value of the component is based simply on the material master


valuation data.

 SAP AG 2002, Valuation (General), Juergen Mueller 4


General

Price Differences for Subcontract Orders at Goods Receipt

In the customizing of inventory management, you can configure for


each valuation area whether price differences are generated for a
subcontract order at the time of a goods receipt if the manufactured
material is managed at standard price and the standard price varies
from the receipt value (externally performed service + value of
components + delivery costs).

(Table T001K-XLBPD)

 SAP AG 2002, Valuation (General), Juergen Mueller 5


Example 1:

Subcontracting order (without account assignement and without


fright conditions): Posting schema without price differences:

WE01
Material: PRODUCE BSX Stock account FERT : 400 +
BSV Stock change : 400 -
Finished product: 400 EUR WRX GR/IR clearing acct : 250 -
FRL External service acct : 250 +
(value at standard price )

Subcontract order:
-Ext. service : 250 EUR

BSX Compon. stock account : 100 -


GBB Consumption account : 100 +

Component: COMP_1 WA01

Components : 100 EUR

 SAP AG 2002, Valuation (General), Juergen Mueller 6


Example 2:

Subcontracting order (without account assignement and without


fright conditions): Posting schema with price differences:

WE01
Material: PRODUCE BSX Stock account FERT : 400 +
BSV Stock change : 350 -
Finished product: 400 EUR PRD Price difference : 50 -
WRX GR/IR clearing acct : 250 -
(value at standard price) FRL External service acct : 250 +

Subcontract order:
-Ext. service : 250 EUR

BSX Compon. stock account : 100 -


GBB Consumption account : 100 +
Component: COMP_1 WA01

Components : 100EUR

 SAP AG 2002, Valuation (General), Juergen Mueller 7


Example 3:

Subcontracting order (without account assignement and without


fright conditions):

WE01
Material: PRODUCE BSX Stock account FERT : 350 +
BSV Stock change : 350 -
Finished product: 500 EUR WRX GR/IR clearing acct : 250 -
FRL External service acct : 250 +
(value at moving average price)

Subcontract order:
-Ext. service : 250 EUR

BSX Compon. stock account : 100 -


GBB Consumption account : 100 +

Component: COMP_1 WA01

Components : 100 EUR

 SAP AG 2002, Valuation (General), Juergen Mueller 8


Important breakpoints

ME_READ_ITEM_GOODS_RECEIPT

Similar to the standard purchase order: Interface table XEBEFU will be filled (material,
quantity, net. value, GR and IV values).

ME_READ_COMP_GOODS_RECEIPT

The components will be transferred with the interface table MDVW (material and
quantity, no value).

 SAP AG 2002, Valuation (General), Juergen Mueller 9


Program Flow (1)

No reference Read PO Read PP order Read reservation Read Material doct


Document ME_READ_ITEM CO_SF_READ_ITE MB_READ_RESER MB_READ_MATERIAL_P
(manual) _.. M. V. in MM07MFR0 OS.
in MM07MFB7 in MM07MPPS (XRBEFU) in MM07MFB1
(XEBEFU) (XFBEFU) (XMSEG)

SEGMENT_…_UEBERNEHMEN: BELEG_ERGAENZEN
Move XxBEFU data to MSEG – DM07M – VM07M Move XMSEG + other data
to MSEG – DM07M –
VM07M

Internal table FUSS (= MSEG + DM07M + VM07M). Data appears on selection screen/entry screen

Enrich item data in FUSSZEILE_WE_PRUEFEN,


LAGERORTDATEN. (MATERIAL_LESEN)
„Copy“
Create quantity enqueue tables XMARD, XMCHB.. in
MB_CHECK_MATERIAL STOCKS (static availability
check in SAPLMBMV – M7021/022)

SEGMENT_HINZUFUEGEN (MM07MFS9)
Append intermediate document YMSEG – YDM07M – YVM07M

„Post“

Prepare posting in
BUCHEN_AUFBEREITEN
(MM07MFB9)

 SAP AG 2002, Valuation (General), Juergen Mueller 10


Program flow (2)
Loop at LBTAB (only components)
Prepare posting in
BUCHEN_AUFBEREITEN (MM07MFB9)
BUCHEN_INITIALISIEREN (MM07MFB9)
YMSEG – YDM07M – YVM07M moved to
MB_CALCULATE_VALUES WA01
ZMSEG – ZDM07M – ZVM07M (YMBUZ)

MB_UPDATE_SUBCONTRACTING_VALUE

Endloop
M-SEGMENTE_GENERIEREN (MM07MFM0)
ZMSEG – ZDM07M – ZVM07M moved to
XMSEG – XVM07M Loop at ZMSEG (components and product)
MB_CALCULATE_VALUES
F-SEGMENTE_GENERIEREN (MM07MFF9)
Call valuation MB_CALCULATE_VALUES
WE01
(SAPLMBGB) Table XZCXCM > XACCIT.

F-SEGMENTE_ERSTELLEN WA01
Endloop
M-SEGMENTE_ERGAENZEN (MM07MFM0)
Zero lines are deleted. Depending tables prepared
for update (XEKBE, XRKWA, XFAUBE).
Create Delivery if XDELIV is set.

BUCHEN_NUMMERNVERGABE F-BELEG_ERGAENZEN (MM07MFF9)


(Material document number) Call CKMV_AC_DOCUMENT_CREATE Accounting document
Send data to update modules:
BUCHEN_AUSFUEHREN (MM07MFB9)
Tables XMSEG, XMBEW, XMARD, EKBE…
Last Breakpoint in Dialog

COMMIT WORK
(update task begins)

 SAP AG 2002, Valuation (General), Juergen Mueller 11


Program flow (3)
MB_CALCULATE_VALUES

Getting all Currency


werte_rechnen Werte_ml_initialisieren MCKML_F_CKML1_PRICES_GET
Types from Material Ledger

Loop at YCURTP
PERFORM (MSEG-BUSTW) IN SAPLMBGB e.g. Form WA01
Endloop

 SAP AG 2002, Valuation (General), Juergen Mueller 12


Program flow (3)
Form WA01

Form WA01_RECHNEN Calculation T156W-FELDN


Calculation of the fields With BUSTW=WA01
BESTD
VERBR
PRDIF
BESTU
AUFUM

Loop at T156W where BUSTW = WA01.

Form Ausgabe Creating table


ASSIGN (X156W-FELDN) TO <BETRAG>. XZCXCM
... (XZCXCB for fright and
XZCXCM-DMBTR = <BETRAG>. Purch. order
XZCXCM-VORSL = X156W-VORSL. conditions)
Endloop

 SAP AG 2002, Valuation (General), Juergen Mueller 13


Program flow (3)
Form F-SEGMENTE_ERSTELLEN

Loop at T156W where CNT02.

Form F-SEGMENTE_BEWERTEN XZCXCM-COUNTER nach YACCCR

YACCCR nach XACCCR


Form F-SEGMENTE_ERZEUGEN
And
Endloop XACCIT

 SAP AG 2002, Valuation (General), Juergen Mueller 14


Program flow (1)
(4)
Prepare posting in BUCHEN_INITIALISIEREN (MM07MFB9)
YMSEG – YDM07M – YVM07M moved to
BUCHEN_AUFBEREITEN (MM07MFB9)
ZMSEG – ZDM07M – ZVM07M (YMBUZ)

M-SEGMENTE_GENERIEREN (MM07MFM0)
ZMSEG – ZDM07M – ZVM07M moved to
XMSEG – XVM07M

F-SEGMENTE_GENERIEREN (MM07MFF9)
MB_CALCULATE_VALUES
Call valuation MB_CALCULATE_VALUES
(SAPLMBGB) Table XZCXCM > XACCIT.
Loop at XZCXCM Creating
F-SEGMENTE_BEWERTEN XACCIT
Endloop XACCCR
M-SEGMENTE_ERGAENZEN (MM07MFM0)
Zero lines are deleted. Depending tables prepared
for update (XEKBE, XRKWA, XFAUBE).
Create Delivery if XDELIV is set.

BUCHEN_NUMMERNVERGABE F-BELEG_ERGAENZEN (MM07MFF9)


(Material document number) Call CKMV_AC_DOCUMENT_CREATE Accounting document
Send data to update modules:
BUCHEN_AUSFUEHREN (MM07MFB9)
Tables XMSEG, XMBEW, XMARD, EKBE…
Last Breakpoint in Dialog

COMMIT WORK
(update task begins)

 SAP AG 2002, Valuation (General), Juergen Mueller 15


Table XZCXCM, XACCIT and XACCCR (1)

The internal table XZCXCM contains all information about the involved currency types
(CURTP and WAERS) and values. Also lines with value 0 are included!

XZCXCM

CNT02 CURTP WAERS DMBTR SHKZG SHKZM VORSL

01 00 EUR 7.16 S S BSX

02 00 EUR 7.16 H GBB

03 00 EUR 0.00 PRD

05 00 EUR 0.00 BSX

06 00 EUR 0.00 UMB

……

 SAP AG 2002, Valuation (General), Juergen Mueller 16


Table XZCXCM, XACCIT and XACCCR (2)

In form F-BELEG_ERGAENZEN (MM07MFF9) we call the function


CKMV_AC_DOCUMENT_CREATE and forward to FI all posting lines within the
interface structures XACCIT and XACCCR. Lines from the internal table XZCXCM with
debit/credit indicator INITIAL (SHKZG) will not be forwarded to XACCIT and FI!
XACCIT (The information of this table can be stored
MANDT AWTYP KTOSL within database table XACCTIT!)
800 MKPF BSX
800 MKPF GBB
XACCCR
CURTP WAERS WRBTR (The information of this table can be stored
00 EUR 79.43 within database table XACCTCR!)
10 EUR 79.43
00 EUR 79.43-
10 EUR 79.43-

 SAP AG 2002, Valuation (General), Juergen Mueller 17


Accounting document

Within the routine F-BELEG_ERGAENZEN (Include MM07MFF9), we


call the FI function CKMV_AC_DOCUMENT_CREATE, which will
create all accounting relevant documents:

 ML documents (in some cases ML will add an additional ML posting


lines e.g. BSX and PRY posting keys)

 CO documents

 Accounting document

The accounting documents will be stored within database table


BSEG. There will be an index table entry BSIM for every BSX table
entry (with the material as key-field). This table BSIM is also used by
inconsistency checkreport MBVALUE.

 SAP AG 2002, Valuation (General), Juergen Mueller 18

Potrebbero piacerti anche