[Practical] SAP cost component split price access logic

This article sorts out the price logic of each cost under the "CV cost component" view in CKM3.

Code snippet 1:  

The SELECT
  TCKH3 ~ ElemT " Cost Component No.
  TCKH3 ~ EL_HV" full cost
  TCKH1 ~ TXELE " Cost Component Name
  TKEVA04 ~ WERTKOMP1" field name
  the FROM  TCKH3
  the INNER 
the JOIN  TCKH1  the ON  TCKH1 ~ ELEHK  TCKH3 ~ ELEHK
                   
the AND  TCKH1 ~ ElemT  TCKH3 ~ ElemT
  the INNER 
the JOIN  TKEVA04  ON  TCKH1 ~ ELEHK  TKEVA04~ELEHK
                  
AND TCKH1~ELEMT TKEVA04~ELEMT
  
INTO  CORRESPONDING FIELDS OF TABLE LT_TCKH3
  
WHERE TCKH3~ELEHK '20'
    AND  TCKH1~ELEHK '20'
    AND  TCKH1~SPRAS SY-LANGU
   
AND  TKEVA04~ERKRS 经营范围
    AND  TKEVA04~BWFKT '01'.

among them:

ELEHK - Cost structure structure , which can be viewed through transaction code OKTZ (sample pictures, for reference only).

BWFKT  - Valuation Point

  • 01Real  -time valuation of actual data
  • 02Regular  evaluation of actual data
  • 03  Manual planning
  • 04Automatic  planning

The results of the above SQL statements are as follows (sample pictures, for reference only):

The fields involved are:

KST001KST003KST005KST007KST009KST011

 

Code snippet 2:  

The SELECT
    CKMLPRKEPH ~ KST001 " Cost field
    CKMLPRKEPH ~ KST003" Cost field
    CKMLPRKEPH ~ KST005 " Cost field
    CKMLPRKEPH ~ KST007" Cost field
    CKMLPRKEPH ~ KST009 " Cost field
    CKMLPRKEPH ~ KST011" Cost field
    CKMLHD ~ MATNR " material number
    CKMLHD ~ BWTAR" Evaluation range
    CKMLPRKEPH ~ WAERS " Currency Code
    CKMLPRKEKO ~ LOSGR" Bulk Product Costing
FROM  CKMLHD
INNER 
JOIN CKMLPRKEPH ON CKMLHD~KALNR CKMLPRKEPH~KALNR
INNER 
JOIN CKMLPRKEKO ON CKMLHD~KALNR CKMLPRKEKO~KALNR
INTO CORRESPONDING FIELDS OF TABLE LT_KEKO
WHERE CKMLHD~MATNR IN S_MATNR
 
AND  CKMLHD~BWKEY IN S_WERKS
 
AND  CKMLPRKEPH~BDATJ 记账年份
  AND  CKMLPRKEKO~ BDATJ  billing period
  AND  CKMLPRKEPH ~ POPER  billing year
  AND  CKMLPRKEKO ~ POPER  billing period
  AND  CKMLPRKEPH ~ KEART  'H'
  AND  CKMLPRKEPH ~ PRTYP  'V'
  AND  CKMLPRKEPH ~ KKZST  ''
  AND  CKMLPRKEKO ~ PRTYP  'V' .

Related Table:

  • CKMLHD- Material Ledger: Title Record
  • CKMLPRKEPH- Material Ledger : Cost component split of price (element)
  • CKMLPRKEKO- material ledger ; cost component split of price (title)

The specific Table values ​​above are shown in the figure below (sample pictures, for reference only):

 

The above SQL statement finally gets the data shown in the figure below (sample picture, for reference only) :

 

Compare transaction code CKM3N display results (sample pictures, for reference only) :

among them:

PRTYP  - price type

  • Cost component split of future planned prices in P   market
  • The cost component split of the future evaluation price of the Z   market
  • S   standard price of cost component split
  • The cost component division of V   moving average price
  • E   Separately assessed cost component split at the end of the external period
  • A   cost component split of plan price
  • B   cost component differences between planned and actual price segmentation

KKZST  - Mark the lower limit layer / layer

  • Empty     all
  • X lower level
  • S rank

KEART  - Cost component breakdown type of product costing

Specify whether the cost component structure to which the displayed cost component belongs is defined as the main cost component component allocation or auxiliary cost component component allocation.

 

 

Guess you like

Origin blog.csdn.net/zhongguomao/article/details/108501497