‎2007 Aug 01 9:46 AM
On Tx CKMLQS
Hi all,
We need to have a functionality in BI similar to that of
transaction CKMLQS ( Valuated quantity structure ) on R/3 .
Tx CKMLQS gives the BOM along with PrelimVal,diff and Actual . We need to know from which tables on R/3, these data comes ( Prelimval,diff,actual,currency,price,resource,quantity etc )
I checked with tables STKO,STPO,MAST but this doesn't seem to help .
Well, I may be wrong !
Could you please let me know where the above data comes ?
Thanks a lot !
Points assured for all the helpful answers
‎2007 Aug 05 12:35 PM
If you want to get the data for standad and actual prices
you got the table "CKMLPEKEPH"
and pass the parameters in the below mantioned way :
1. kalnr number ( kalnr )
2. Year ( bdatj )
3. Period ( poper )
4. Type of cost component ( keart)
5. Type of price ( prtyp 'V' - Actual and 'S' - Standard )
6. Currency Type ( curtp )
7. Inidcator Lower level/level ( kkzst )
If you pass these values with prtyp as 'V' - U will get the Actual Price Values
If you Pass 'S' - U will get the Standard Price Values.
If you want any more information Regarding this Transaction u can feel free to
ask.
Thanks & Regards
Rajesh Balusu.
‎2007 Aug 01 9:49 AM
‎2007 Aug 01 10:04 AM
Hey Kiran.
Thanks for the input , but the above tables ( one is structure ) does not have the data . ( Prelim Val.Diff, actual Val )
Could you please analyse a bit and let me know the tables ?
Thanks a lot,
‎2007 Aug 01 2:12 PM
go to se80>click on repository information system>expand ABAP dictioanry> expand fields>click on table fields
on the right side of the screen enter the field name and press execute to know the tables where it is used and what other tables where it is used can be known from the where-used-list in any table
regards,
srinivas
<b>*reward for useful answers*</b>
‎2007 Aug 05 12:35 PM
If you want to get the data for standad and actual prices
you got the table "CKMLPEKEPH"
and pass the parameters in the below mantioned way :
1. kalnr number ( kalnr )
2. Year ( bdatj )
3. Period ( poper )
4. Type of cost component ( keart)
5. Type of price ( prtyp 'V' - Actual and 'S' - Standard )
6. Currency Type ( curtp )
7. Inidcator Lower level/level ( kkzst )
If you pass these values with prtyp as 'V' - U will get the Actual Price Values
If you Pass 'S' - U will get the Standard Price Values.
If you want any more information Regarding this Transaction u can feel free to
ask.
Thanks & Regards
Rajesh Balusu.
‎2007 Aug 05 12:42 PM
‎2007 Aug 06 7:28 AM
Hey Rajesh,
Thanx a lot !
Would highly appreciate if you could clarify a couple of queries more related to the same transaction ( CKMLQS ).
1. Whenever PRTYP is S ( Standard Price ) we have the standard price in one field
but when it is V ( Actual price ) the prices are split across multiple fields, most of them containing duplicate values ( values are repeated, KST001,002, 00n ) . But the actual price is the sum of unique values .How do we decide which values are to be added to get the price ?
2. From which table do we get Quantity ? ( as in Tx CKMLQS )
3. Which is the table that links the finished product with all its subsidiary part ( BOM that is ) ? I think we have an FM for this, but I need the table .
Rajesh, I am thankful to you, if you could please clarify the above, it would be great !
I owe you a treat !
Thanks,
‎2007 Aug 06 9:09 AM
For standard Cost :
You need to go to ckmlcr and you have to pass KALNR , Period , Year, CURTP
then you will get stprs , you multiply menge with this stprs value then you will get the standard value.
If you want actual Material Cost:
You will multiple values for actuals.
You put a loop for that internal table and add all those Like make it a single record.
v_kst001 = v_kst001 + wa_ckml*-kst001.
v_kst002 = v_kst002 + wa_ckml*-kst002.
once if you through with this
add first four variables then you will get actual materialcost.
.
‎2007 Aug 06 9:47 AM
Hey Rajesh,
Thanks once again....
Could you please give me your email id or contact no ?
I have still some pending queries like :
1. From which table 'quantity' comes .
2. how the multi level boms ( in the output ) are selected, because as I can see these are not the complete BOM explosion as given by the FM ( CS_BOM_EXPLOSION_V2 )
This would be really helpful !
Thanks,
‎2007 Aug 11 6:47 AM
‎2007 Oct 04 11:00 PM
&----
*& Form get_cklmqs_data_ag
&----
-->if_matnr Material Number
-->if_werks Plant
-->if_bdatj Posting date YYYY
-->if_poper Posting period
-->if_curtp Currency Type and Valuation View
----
FORM get_ckmlqs_data_ag USING if_matnr
if_werks
if_bdatj
if_poper
if_curtp.
DATA : ls_mlkey TYPE mlkey.
DATA : qstree TYPE REF TO cl_qstree_ckml.
DATA : lcl_node TYPE REF TO cl_qsnode_material_ckml,
lcl_node1 TYPE REF TO cl_qsnode,
lcl_node2 TYPE REF TO cl_qsnode,
lcl_value TYPE ckmlqs_fields .
DATA : BEGIN OF lt_ckmlqs OCCURS 100,
seqnr TYPE i ,
kalnr TYPE ck_kalnr1 ,
matnr TYPE matnr ,
text(30) TYPE c ,
quantity TYPE menge_pos ,
unit TYPE meins ,
bewer TYPE kkb_ml_bewer ,
abwe TYPE kkb_ml_abwe ,
ges TYPE kkb_ml_ges ,
preis TYPE kkb_ml_preis ,
currency TYPE waers ,
ressource TYPE kkek_ress ,
peinh TYPE ck_peinh_1 ,
END OF lt_ckmlqs .
DATA : lv_seqnr TYPE i .
DATA : BEGIN OF lt_inputs OCCURS 10,
seqnr TYPE i ,
qsnode TYPE REF TO cl_qsnode,
END OF lt_inputs .
STATICS : st_t001w TYPE t001w .
*------
IF st_t001w-werks NE if_werks.
SELECT SINGLE * FROM t001w INTO st_t001w
WHERE werks = if_werks.
ENDIF.
ls_mlkey-matnr = if_matnr.
ls_mlkey-werks = if_werks.
ls_mlkey-bwkey = st_t001w-bwkey.
ls_mlkey-bdatj = if_bdatj.
ls_mlkey-poper = if_poper.
ls_mlkey-werks_ml_productive = if_werks.
ls_mlkey-curtp = if_curtp.
CALL METHOD cl_qstree_ckml=>create_docking_tree
EXPORTING
is_mlkey = ls_mlkey
IMPORTING
er_qstree = qstree
EXCEPTIONS
container_already_exists = 1
treecontrol_already_exists = 2
object_create_error = 3
container_create_error = 4
kalnr_notfound = 5
treecontrol_create_error = 6
OTHERS = 7.
CHECK sy-subrc EQ 0.
lcl_node = qstree->mr_rootnode.
READ TABLE lcl_node->t_inputs INTO lcl_node1 INDEX 1.
ADD 1 TO lv_seqnr.
lt_inputs-seqnr = lv_seqnr.
lt_inputs-qsnode = lcl_node.
APPEND lt_inputs.
LOOP AT lt_inputs.
CALL METHOD lt_inputs-qsnode->expand_inputs.
lcl_node1 = lt_inputs-qsnode.
LOOP AT lcl_node1->t_inputs INTO lcl_node2.
IF sy-tabix = 1.
ADD 1 TO lv_seqnr.
lt_inputs-seqnr = lv_seqnr.
ENDIF.
lt_inputs-qsnode = lcl_node2.
APPEND lt_inputs.
ENDLOOP.
ENDLOOP.
LOOP AT lt_inputs.
lt_ckmlqs-seqnr = lt_inputs-seqnr .
lt_ckmlqs-kalnr = lt_inputs-qsnode->kalnr .
lt_ckmlqs-text = lt_inputs-qsnode->text .
lt_ckmlqs-quantity = lt_inputs-qsnode->quantity.
lt_ckmlqs-unit = lt_inputs-qsnode->unit .
SELECT SINGLE matnr FROM mbew INTO lt_ckmlqs-matnr
WHERE kaln1 = lt_ckmlqs-kalnr.
CLEAR lcl_value.
READ TABLE lt_inputs-qsnode->t_values INTO lcl_value
WITH KEY curtp = if_curtp.
lt_ckmlqs-bewer = lcl_value-bewer .
lt_ckmlqs-abwe = lcl_value-abwe .
lt_ckmlqs-ges = lcl_value-ges .
lt_ckmlqs-preis = lcl_value-preis .
lt_ckmlqs-currency = lcl_value-currency .
lt_ckmlqs-ressource = lcl_value-ressource.
lt_ckmlqs-peinh = lcl_value-peinh .
APPEND lt_ckmlqs. CLEAR lt_ckmlqs.
ENDLOOP.
ENDFORM. " get_cklmqs_data_ag