‎2011 Nov 17 10:15 AM
Hi experts,
I want to insert data from a custom class alike in T code : QS21 (Creating MIC), so am wondering for any BAPI .
Am a newbie to QM.
Can any one suggest me some procedure.
Thanks
Aisurya
‎2011 Nov 17 10:20 AM
Hi,
Can you please check this BAPI,
BAPI_QPMK_SAVE_REPLICA
Regards,
Guna
‎2011 Nov 17 10:33 AM
Hi Guna,
How to pass the control data in to that..
Help me...
Thanks
‎2011 Nov 17 10:34 AM
CTUT_FEATURE_DATA - pass your existing characteristics name here to get the values
CTUT_CHARACT_GET_TEXTS-to get texts
CLSE_SELECT_CABNT - to get values
Then use BAPI_QPMK_SAVEREPLICA to create one.
You can check the solution here to populate control data
‎2011 Nov 17 10:44 AM
HI ,
I followed the link , but how to pass " structure QMKST " in "MSTCHA-IND_CONTROL" field.
Shall i append the values and pass the structure in that field as a string, i guess no.
Pls help me in this.
Thanks
Aisurya.
‎2011 Nov 17 10:54 AM
Hi,
data:lwa_control type QMKST..
data:lwa_bapi type BAPIQPMK_QPMK.
lwa_control-SYNCRO = 'X'.
lwa_control-FORMELMK = 'X'.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = lwa_control
importing
ex_container = lwa_bapi-IND_CONTROL "Your Bapi field
exceptions
illegal_parameter_type = 1
others = 2.
‎2011 Nov 17 11:49 AM
Hi Keshab ,
It is helpfull , thanks but am stuck in some other places . I am very new to QM.
Below is my code :
data:lwa_control type QMKST.
data:lwa_bapi type TABLE OF BAPIQPMK_QPMK,
wa_bapi like line of lwa_bapi .
lwa_control-SYNCRO = 'X'.
lwa_control-FORMELMK = 'X'.
lwa_control-QUANTITAT = 'X'.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = lwa_control
importing
ex_container = wa_bapi-IND_CONTROL "Your Bapi field
exceptions
illegal_parameter_type = 1
others = 2.
data : lv_MSTCHA_INSP_METH type TABLE OF BAPIQPMK_QPMZ,
lt_MSTCHA_TEXT type TABLE OF BAPIQPMK_QPMT,
wa_MSTCHA_TEXT like line of lt_MSTCHA_TEXT,
lv_MSTCHA_LONGTEXT type BAPIQPMK_LONGTEXT,
lv_MSTCHA_SMPL_LTXT type BAPIQPMK_SMPL_LTXT,
lv_return type table of bapiret2.
wa_bapi-PLANT_QPMK = 'QM'.
append wa_bapi to lwa_bapi.
wa_MSTCHA_TEXT-LANGU = 'EN'.
wa_MSTCHA_TEXT-CHAR_DESCR = 'Testing using a bapi'.
append wa_MSTCHA_TEXT to lt_MSTCHA_TEXT.
CALL FUNCTION 'BAPI_QPMK_SAVEREPLICA'
TABLES
MSTCHA = lwa_bapi
* MSTCHA_INSP_METH =
MSTCHA_TEXT = lt_MSTCHA_TEXT
* MSTCHA_LONGTEXT =
* MSTCHA_SMPL_LTXT =
RETURN = lv_return
* EXTENSION1 =
.and get some error in return i.e
row, type, ID, Number, Message
1, E, QP, 661 , The key for the master insp. characteristic was not completely entered
2, E, QS 375 , Create insp. method/master insp. characteristic : Details not complete
3, W, Q0 202 , Dependent control indicators will be canceled
4, W, Q0 205 , Calculated characteristic will be reset
5, S, QP 504 , Non-relevant fields will be initialized
6, E, QP 504 , Non-relevant fields will be initialized
7, E, QS 376 , Complete the short text data
Thanks
Aisurya.
‎2011 Nov 17 11:55 AM
Read the Bapi documentation in SE37 by clicking the parameters in it.
kesav
‎2011 Nov 21 5:59 AM
Hi kesav,
I am passing all the mandatory parameters into the BAPI, but still i get some error,warning in the Return.
1 E QP 661 The key for the master insp. characteristic was not completely entered
2 E QS 375 Create insp. method/master insp. characteristic : Details not complete
3 W Q0 202 Dependent control indicators will be canceled
4 W Q0 205 Calculated characteristic will be reset
5 S QP 504 Non-relevant fields will be initialized
6 E QP 504 Non-relevant fields will be initialized
7 E QS 376 Complete the short text data
Please help me in this.
Thanks
Aisurya
‎2012 Nov 03 10:24 AM
hi needy,
You can solve this problem by following code...
Note : Preset Indicators has to be used for setting control indicators as shown.
SELECT SINGLE * FROM TQ27 into i_TQ27 where STEUERKZ eq itab-IND_CONTROL.
CONCATENATE i_TQ27-QUANTITAT
i_TQ27-MESSWERTE
i_TQ27-PRUEFKAT
i_TQ27-TOLEROBEN
i_TQ27-TOLERUNTEN
i_TQ27-SOLLPRUEF
i_TQ27-PUMFKZ
i_TQ27-LZEITKZ
i_TQ27-ESTUKZ
i_TQ27-DOKUKZ
i_TQ27-RZWANG
i_TQ27-SYNCRO
i_TQ27-ADDPRO
i_TQ27-ZERSTPRF
i_TQ27-FORMELMK
i_TQ27-STICHPR
i_TQ27-AUSSLOS
i_TQ27-FIXIERT
i_TQ27-BEWFHLZHL
i_TQ27-LSTKZ
i_TQ27-VORGAEND
i_TQ27-PMMZWANG
i_TQ27-FEHLREC
i_TQ27-AENDBELEG
i_TQ27-QSPCMK
i_TQ27-KEINDRUCK
i_TQ27-PARA INTO I_MSTCHA-IND_CONTROL RESPECTING BLANKS.
"concatenate above fields into
IND_CONTROL field. and give it to
BAPI_QPMK_SAVEREPLICA
...and its working fine
‎2013 May 24 11:09 AM