cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI/FM for material assignment to an inspection plan QP02

Arun_Prabhu_K
Active Contributor
5,612

Requirement: To assign single material to an existing inspection plan.

I had referred several threads and posting it here since I did not get any concrete solution. Some threads suggest direct update of MAPL table. Hope a better method exists.

BAPI

BAPI_INSPECTIONPLAN_CHANGE is unavailable in our system.

BDC

I tried BDC but the problem is that there is no facility for new row addition to insert a material assignment. I have to do multiple page downs to get a blank row for insertion. This will increase response time when the records are more. I could write a logic for the number of page downs required based on MAPL total count divided by count of visible rows in material assignment screen of QP02 tcode.

FM

I checked ROUTING_MAINTAIN but it did not contain any input for passing task list type.

If you had done this requirement using any FM/BAPI, kindly provide the FM detail or idea in BDC to quickly get to the table control empty row in order to assign a material to an inspection plan?

View Entire Topic
Arun_Prabhu_K
Active Contributor

FM CPCC_S_TASK_LIST_MAINTAIN met my requirement.

https://answers.sap.com/questions/13786417/routing-maintain-entry-p-is-not-in-table-tca41-err.html

* BEGIN-INSPECTION PLAN ASSIGNMENT
imatl-maintain_mode = 'C'.
imatl-material = matl.
imatl-plant = plant.
append imatl.

CALL FUNCTION 'CPCC_S_TASK_LIST_MAINTAIN'
EXPORTING
key_date = sy-datum
task_list_type = 'Q'
task_list_group = 'INSPPLAN'
group_counter = plnal
TABLES
material_task_allocations = imatl
return = iret.
READ TABLE iret with key type = 'E'.
if sy-subrc <> 0.
COMMIT WORK.
endif.
* END-INSPECTION PLAN ASSIGNMENT