Skip to Content
0
May 14, 2019 at 09:45 AM

ABAP Function ROUTING_MAINTAIN component allocation phantom assy

2491 Views Last edit May 14, 2019 at 09:45 AM 2 rev

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