‎2009 Jul 01 5:12 PM
Hi,
I am trying to create Inspection plan using BAPI -> BAPI_INSPECTIONPLAN_CREATE
As per requirement I want to copy Inspection plan details (like Material task allocation) of Material 'MAT1' to material 'MAT2'.
here MAT2 is created with reference to MAT1
For this i am importing following values to BAPI...
1. in table 'TASK' : group no(1), counter, valid from date, usage, plant, status and unit
2. in table MATERIALTASKALLOCATION : Material (MAT2), Plant and counter
On executing i am getting following messages:
E BAPI 001
A CPCL 006 Task list Q 1 1 already exists
A CPCC_DT 210 For further processing, the routing entry is missing
Can you please tell me why this has happen?
Is there any BAPI for Inspection plan Change/Display?
Also same scenario i have tested in QP01 with same details that i have mentioned above. There it is working properly.
‎2009 Jul 02 10:26 AM
Hi,
Function Modules:
INSPECTIONPLAN_DISPLAY
INSPECTIONPLAN_CHAR_DISPLAY
In TASK table, you must enter a value for the following attributes to ensure the consistency of the header data:
TASK_LIST_USAGE, PLANT, TASK_LIST_STATUS, TASK_MEASURE_UNIT (unit of measure)
You can only specify a task list group (attributes TASK_LIST_GROUP and GROUP_COUNTER) with external number assignment. For internal number assignment, the task list group and the group counter are automatically determined during processing.
‎2009 Jul 02 11:03 AM
Hi Neenu,
I hv checked these FM:
INSPECTIONPLAN_DISPLAY
INSPECTIONPLAN_CHAR_DISPLAY
both function module are not usefull in my case as they are not giving me details related Material Task allocation
I am already passing these parameters : TASK_LIST_USAGE, PLANT, TASK_LIST_STATUS, TASK_MEASURE_UNIT (unit of measure) to BAPI but still getting error that i have mentioned above.
How to specify a task list group (attributes TASK_LIST_GROUP and GROUP_COUNTER) with external number assignment ?
thanks,
‎2009 Jul 02 11:10 AM
Hi,
Check structure: BAPI1191_TSK_C :Task List Header Data in CREATE-BAPI for Inspection Plans
‎2009 Jul 02 11:32 AM
Hi Neenu,
Thanks for attending my issue.
Please go though the test data that i am passing to BAPI
In table TASK
1. TASK_LIST_GROUP : 2 (already created)
2. GROUP_COUNTER : 1
3. VALID_FROM : 30.06.2009 (from table PLKO)
4. TASK_LIST_USAGE : 3
5. PLANT : A-L1
6. TASK_LIST_STATUS : 4
7. TASK_MEASURE_UNIT : EA
8. IND_UNITS_EXT_NUMBERING : 0 (any external numbering)
In table MATERIALTASKALLOCATION
1. Material : QMRM02 (this material has already allocated to group 1 and 3)
2. Plant : A-L1
3. Group counter : 1
Still i am getting these messages:
E BAPI 001
A CPCL 006 Task list Q 2 1 already exists
A CPCC_DT 210 For further processing, the routing entry is missing
If i go for testing in transaction QP01 with same data mentioned above then material is getting allocated to group '2' so why not i am getting success in BAPI ?
‎2009 Jul 03 6:35 AM
Still no luck from my side...
Should i switch to alternative solution like BDC for Tcode QP01 ? or i need to put extra efforts with same BAPI ?
Plz help...
‎2012 Dec 02 9:23 AM
I am also getting the error.
Can you let me know what was the fix for this?
‎2012 Dec 03 4:44 AM
You can eliminate this error by tweaking the main logic a little bit for Group Counter.
You can write a wrapper FM for this logic or can use enhancement spot in the beginning of the BAPI.
‎2012 Dec 03 5:15 AM
Hi Amol,
Please check this Sample Code .
ZSTRUC_INSPECTION_PLAN
1 MATNR Material Number
2 PLNAL Group Counter
3 PLNNR Key for Task List Group
4 STTAG Key date
5 WERKS WERKS_D
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" ITAB STRUCTURE ZSTRUC_INSPECTION_PLAN OPTIONAL
*"----------------------------------------------------------------------
* Developed by Smruti Ranjan Mohanty
* Global data declarations
DATA: W_TAB LIKE ZSTRUC_INSPECTION_PLAN.
DATA: DAT TYPE BUDAT,
V_BUDAT TYPE BUDAT.
DAT = SY-DATUM .
CALL FUNCTION 'CONVERT_DATE_FORMAT'
EXPORTING
I_DATE = DAT
IMPORTING
E_CALC_DATE = V_BUDAT.
LOOP AT ITAB INTO W_TAB.
REFRESH BDCDATA.
PERFORM BDC_DYNPRO USING 'SAPLCPDI' '8010'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RC271-PLNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RC27M-MATNR'
' '.
PERFORM BDC_FIELD USING 'RC27M-WERKS'
W_TAB-WERKS . "'3300'. " plant
PERFORM BDC_FIELD USING 'RC271-PLNNR'
W_TAB-PLNNR. "'vs_cons4'. " group
PERFORM BDC_FIELD USING 'RC271-STTAG'
V_BUDAT . "'21.07.2011'. "W_TAB-STTAG . " '21.07.2011'. " date
PERFORM BDC_DYNPRO USING 'SAPLCPDI' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RC27X-ENTRY_ACT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=MTUE'.
PERFORM BDC_FIELD USING 'RC27X-ENTRY_ACT'
'1'.
PERFORM BDC_DYNPRO USING 'SAPLCZDI' '4010'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RC271-PLNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P++'.
PERFORM BDC_DYNPRO USING 'SAPLCZDI' '4010'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RC271-PLNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
PERFORM BDC_DYNPRO USING 'SAPLCZDI' '4010'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAPL-WERKS(02)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'MAPL-PLNAL(02)'
W_TAB-PLNAL . "'1'. " 1
SHIFT W_TAB-MATNR LEFT DELETING LEADING '0'.
PERFORM BDC_FIELD USING 'MAPL-MATNR(02)'
W_TAB-MATNR . "'40013140'. " ip
PERFORM BDC_FIELD USING 'MAPL-WERKS(02)'
W_TAB-WERKS . "'3300'. " plant
PERFORM BDC_DYNPRO USING 'SAPLCPDI' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RC27X-ENTRY_ACT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_FIELD USING 'RC27X-ENTRY_ACT'
'1'.
PERFORM BDC_MATERIAL_ASSIGN USING 'QP01'.
* ****************GET ALL MESSAGE DATA............................
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = 'EN'
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = RETURN-MESSAGE.
CLEAR: W_TAB.
ENDLOOP.
ENDFUNCTION.
*Text elements
*----------------
Regard's
Smruti Ranjan