cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Function ROUTING_MAINTAIN component allocation phantom assy

0 Kudos

Dear community,

Due to an upgrade to SAP EWM, we have to allocate components to the right operation in the routing of a material. This can be done manually in CA02, but since we need to update hunderds of routings, we wanted to use the function routing_maintain.

It is working for a level 0 component, but I cannot get it working for the components of a phantom assy.

The code below for the function/bapi ROUTING_MAINTAIN is working for the level 0 component

'    keyDate = "20190514" 
'    routingGroup = "50018714" '
'    routingGroupCounter = "01" '
'    material = "6425-1301-6601" '
'    plantt = "2010" 
'    maintainMode = "C" 
'    flagBarPointer = "0000000000" 
'    sequenceNo = "000000"
'    activity = "0305"
'    operation = "0305"
'    bomType = "M" 'auto
'    BOMnumber = "00236223" 
'    alternativeBOM = "01" 
'    itemID = "00000006"
'    itemNo = "0060" 
'    quantity = "1"
'    qUnit = "EA" 
'    bomTypeRoot = "M" '
'    bomNumberRoot = "00236223"
'    alternativeBOMRoot = "01"

Set bapi = r3.Add("ROUTING_MAINTAIN")
    bapi.Exports("KEY_DATE") = keyDate
    bapi.Exports("TASK_LIST_GROUP") = routingGroup
    bapi.Exports("GROUP_COUNTER") = routingGroupCounter
    bapi.Exports("MATERIAL") = material
    bapi.Exports("PLANT") = plantt

    MAINTAINCOMPONENT.Value(1, "MAINTAIN_MODE") = maintainMode 
    MAINTAINCOMPONENT.Value(1, "FLAG_BAR_POINTER") = flagBarPointer 
    MAINTAINCOMPONENT.Value(1, "SEQUENCE_NO") = sequenceNo 
    MAINTAINCOMPONENT.Value(1, "ACTIVITY") = activity 
    MAINTAINCOMPONENT.Value(1, "OPERATION_ID") = operation 
    MAINTAINCOMPONENT.Value(1, "BOM_TYPE") = bomType 
    MAINTAINCOMPONENT.Value(1, "BOM_NO") = BOMnumber 
    MAINTAINCOMPONENT.Value(1, "ALTERNATIVE_BOM") = alternativeBOM 
    MAINTAINCOMPONENT.Value(1, "ITEM_ID") = itemID 
    MAINTAINCOMPONENT.Value(1, "ITEM_NO") = itemNo 
    MAINTAINCOMPONENT.Value(1, "COMP_QTY") = quantity 
    MAINTAINCOMPONENT.Value(1, "COMP_UNIT") = qUnit 
    MAINTAINCOMPONENT.Value(1, "PLANT") = plantt 'plant
    MAINTAINCOMPONENT.Value(1, "MATERIAL") = material 'material
    MAINTAINCOMPONENT.Value(1, "BOM_TYPE_ROOT") = bomTypeRoot
    MAINTAINCOMPONENT.Value(1, "BOM_NO_ROOT") = bomNumberRoot 
    MAINTAINCOMPONENT.Value(1, "ALTERNATIVE_BOM_ROOT") = alternativeBOMRoot

    MAINTAINCOMPONENT.Value(1, "SEQUENCE_NO_OLD") = ""
    MAINTAINCOMPONENT.Value(1, "ACTIVITY_OLD") = ""
    MAINTAINCOMPONENT.Value(1, "OPERATION_ID_OLD") = ""
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_DIVISOR") = "00000"
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_1") = "0"
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_2") = "0"
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_3") = "0"
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_UNIT") = ""
    MAINTAINCOMPONENT.Value(1, "CUTTING_MEASURE_UNIT_ISO") = ""
    MAINTAINCOMPONENT.Value(1, "COMP_UNIT_ISO") = "EA"
    MAINTAINCOMPONENT.Value(1, "BACKFLUSH") = ""
    MAINTAINCOMPONENT.Value(1, "ORDER_LVL") = "00" 
    MAINTAINCOMPONENT.Value(1, "ORDER_PATH") = "00" 
    MAINTAINCOMPONENT.Value(1, "PATH") = "000000" 

What I changed for the level 1 component was the BOMnumber (BOM_NO), item ID(ITEM_ID), item No(ITEM_NO), ORDER_LVL (to 01), ORDER_PATH (to 01) and PATH (to 000001).

This resulted in the error "No suitable object found" and "The component to be assigned has not been completely specified".

I also tried changing the material to the phantom material number, the item ID to both the number of the row/line in CA02 and to 00000001 as it's the first item in the BOM of the phantom material. However each time I get the same error.

In short:

Can someone help me with what I need to change in my code (which fields) to be able to assign a component on level 1 (so a component of a phantom assy) to an operation in a routing using ROUTING_MAINTAIN?

Thank you in advance!

Tom

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor

Perform some search on OSS there are some notes available

Hint: Start with note 1933543 - CPCC_S_TASK_LIST_MAINTAIN: Error with phantom assemblies ('The same symptom occurs when you use the function module ROUTING_MAINTAIN')

0 Kudos

I'll check it out as soon as our SAP service department has implemented the note.

Thank you!

0 Kudos

Unfortunately that note and the 2 others found (2153292 CPCC_S_TASK_LIST_MAINTAIN: Error with phantom assemblies (2) and

2299757 CPCC_S_TASK_LIST_MAINTAIN: Error with phantom assemblies (3)) are only valid to version SAPKH61712 or before, while our system is on SAPKH61714.

raymond_giuseppi
Active Contributor

Did you pass the parameter application in your code, as suggested in first note?

' To allow editing of these kinds of component assignments, you must enter an application (parameter 'APPLICATION') to enable a multi-level explosion of the root BOM.

Answers (2)

Answers (2)

0 Kudos

Hi, did yo do the other change? I met the same problem with you~

0 Kudos
Did you pass the parameter application in your code, as suggested in first note?
' To allow editing of these kinds of component assignments, you must enter an application (parameter 'APPLICATION') to enable a multi-level explosion of the root BOM.

I somehow overlooked this, this indeed fixes the problem.

For the sake of future references, I added bapi.Exports("APPLICATION") = "PP01" (where PP01 is the BOM application)

Thanks a lot Raymond!