SAP Function /SAPMP/BAPI_ROUTING_PROCESS - Mill Products: Create and Change a Routing

Parameter Reference Type Length Default Optional Text
APPLICATION BAPI1012_CONTROL_DATA-APPLICATION C 4 X BOM Application
BOMUSAGE BAPI1012_CONTROL_DATA-BOM_USAGE C 1 X BOM Usage
CHANGEMODE /SAPMP/BAPI1012_CONTROL_DATA-CHANGEMODE C 1 SPACE X Activate Change Mode
PROFILE BAPI1012_CONTROL_DATA-PROFILE C 7 X Profile to Be Used
TESTRUN BAPIFLAG u 1 SPACE X Switch to Simulation Session for Write BAPIs
WORKAREA /SAPMP/BAPI1012_CONTROL_DATA-WORK_AREA C 18 X Work Area

Parameter Reference Type Length Text
GROUP BAPI1012_TSK_C-TASK_LIST_GROUP C 8 Key for Task List Group
GROUPCOUNTER BAPI1012_TSK_C-GROUP_COUNTER C 2 Group Counter

Parameter Reference Length Optional Text
COMPONENTALLOCATION BAPI1012_COM_C 263 X Component Assignment in CREATE-BAPI for Routings
INSPCHARACTERISTIC BAPI1012_CHA_C 718 X Inspection Characteristics in CREATE-BAPI for Routings
LENGTHCALCULATION /SAPMP/BAPI1012_LC_OPR_C 68 X Length Calculation Data CREATE-BAPI for Routing Operations
MATERIALTASKALLOCATION BAPI1012_MTK_C 179 X Material Routing Assignment in CREATE-BAPI for Routings
OPERATION BAPI1012_OPR_C 743 X Operations in CREATE-BAPI for Routings
PRODUCTIONRESOURCE BAPI1012_PRT_C 407 X PRT Assignments in CREATE-BAPI for Routings
REFERENCEOPERATION BAPI1012_REF_OPR_C 129 X Reference to Operation Set in CREATE-BAPI for Routings
RETURN BAPIRET2 548 X Return Parameters
SEQUENCE BAPI1012_SEQ_C 149 X Sequences in CREATE-BAPI for Routings
SUBOPERATION BAPI1012_SUB_OPR_C 628 X Suboperations in CREATE-BAPI for Routings
TASK BAPI1012_TSK_C 177 X Routing Header Data in CREATE-BAPI for Routings
TEXT BAPI1012_TXT_C 134 X Long Text Lines in CREATE-BAPI for Routings
TEXTALLOCATION BAPI1012_TXT_HDR_C 111 X Text Assignments (Int. Format) for Direct Input in the EWB
WORKCENTERREFERENCE BAPI1012_WC_REF_OPR_C 146 X Standard Tasks in CREATE-BAPI for Routings

Functionality
You use this method to create routing with all the correspondinglower-level objects.
You can create both a key date view and a complete history of a routing.The latter is useful when you are importing data from external systems.

Example
You want to create a routing with its sequences, operations andinspection characteristics for the key date 01.01.2010.
Make an entry for each object in the following tables. Enter 01.01.2010as the date in the VALID_FROM attribute:

  • TASK

  • Enter the relevant planning header data. Only enter data in theTASK_LIST_GROUP and GROUP_COUNTER attributes if you are working withexternal number assignments. If you are working with an internal numberassignment, the plan group and the plan group counter are determinedautomatically.
    • SEQUENCE

    • Only entries for alternatinve or parallel sequences are permitted here.The standard sequence of a routing is created automatically and shouldnot therefore be entered. Only enter data in the TASK_LIST_GROUP andGROUP_COUNTER attributes if you are working with external numberassignments.
      • OPERATION

      • Make an entry in this table for each operation. To allow identificationof the operations, enter an external operation ID in the OPERATION_IDfield. This ID must contain at least one non-numeric character (forexample, VORG0010). This external ID is used to define alternative orparallel sequences for identifying the relevant branch or returnoperation. Only enter data in the TASK_LIST_GROUP and GROUP_COUNTERattributes if you are working with external number assignments.
        • INSPCHARACTERISTIC

        • Make an entry in this table for each inspection characteristic. To allowidentification of the inspection characteristics, enter an inspectioncharacteristic number in the INSPCHAR field. You can create inspectioncharacteristics with or without reference to a master inspectioncharacteristic. Enter the reference to the master inspectioncharacteristic in the CHA_MASTER_IMPORT_MODUS (mode for reference to themaster inspection characteristic) field: 'L' for the reference thatindicates under which circumstances the master inspection characteristichas to be fully maintained; you only have to fill those fields in theINSPCHARACTERISTIC parameter that cannot be copied from the masterinspection characteristic; 'C' for copying the data from the masterinspection characteristic to the inspection characteristic, 'N' forcreating a loose reference to the master inspection characteristicwithout transferring data from the master inspection characteristic. Inthis case, you complete all fields in the INSPCHARACTERISTIC parameteryourself.
          You can copy the tax code of the inspection characteristic directly fromthe master inspection characteristic, enter it individually, or enter akey for the tax code in the PRESET_CTRL_INDS_KEY field, if you havedefined this key in Customizing.
          If you enter the tax codes individually, note the following specialfeatures:
          SCOPE_IND: Scope of inspection
          This indicator may have various characteristics:
          Set " " for: Unrestricted Inspection Scope
          Set "<" for: Smaller Inspection Scope Permitted
          Set ">" for: Larger Inspection Scope Permitted
          Set "=" for: Fixed Inspection Scope
          RESULT_RECORDING_TYPE: Recording type
          This indicator may have various characteristics:
          Set "-" for: No Recording
          Set "*" for: Classified Recording
          Set "+" for: Individual Recording
          Set " " for: Summarized Recording
          DOCU_REQU: Documentation requirement of inspection results.
          This indicator may have various characteristics:
          Set " " for: No Documentation Required
          Set "." for: Documentation in Case of Rejection
          Set "+" for: Document all Inspection Results.
          CONFIRMATION_CATEGORY Characteristic category
          Set " " for: Optional Characteristic
          Set "+" for: Depends on Acceptance of Previous Required Characteristic
          Set "-" for: Depends on Rejection of Previous Required Characteristic
          Set "X" for: Required Characteristic
          PRINT_IND: Print control
          This indicator may have various characteristics:
          Set " " for: Print
          Set "x" for: Do Not Print
          Set "*" for: Do Not Print with Skip
          If you want to assign test equipment to the inspection characteristic inthe ITEM_NO_OF_PRODUCTION_RESOURCE field, ensure that you have assignedthis to the operation in PARAMETER PRODUCTIONRESOURCE.

          Notes
          If no error has occurred during data transfer, the GROUP andGROUPCOUNTER export parameters are assigned the same key as the plancreated. To update the data in the database, you have to execute aCOMMIT WORK.
          Any errors that occur are logged in the RETURN export parameter. If anyinconsistencies arise, the entire routing is discarded.

          Description
          If the data has been transferred successfully, this parameter containsthe ID of the routing created. You can use this ID subsequently toaccess the routing.
          When you use internal number assignment, the system determines therouting group automatically. When you use external number assignment,the system copies the routing group from the transferred routing headerdata.

          Description
          When the data has been transferred successfully, the group counter ofthe created routing appears in this parameter. You can subsequentlyaccess the created routing in conjunction with the routing groupreturned in the GROUP parameter.
          When the first routing is created, '01' is always returned in thisparameter. If a new plan is inserted into an existing routing group, thenext free group counter is returned. If a group counter has already beenspecified in the transferred routing header data, this is transferred.

          Description
          You must enter the BOM application if you want to create componentassignments when you create a routing.
          The BOM application is used in conjunction with the BOM usage to controlthe selection of correct alternative BOMs in the component assignment.

          Description
          You must enter the BOM usage if you want to create component assignmentswhen you create a routing.
          The BOM usage is used to control the selection of the correct BOMs inthe component assignment.

          Description
          You use this parameter to define whether an existing plan should bechanged or not.
          When you change a plan, the TASK table parameter may contain only oneentry for the plan that you want to change.
          To change a plan, you must transfer a valid Engineering Workbench workarea in the WORKAREA import parameter (see the documentation for theWORKAREA import parameter).

          Value range
          The following values are permitted:
          ' ' -> Create
          'X' -> Change

          Default
          The default value is ' '.

          Description
          You can define default values for particular attributes in routing byentering a profile. The system reverts to these default values if norelevant values have been entered. If you do not enter a profile, youmust make entries for the following attributes in the routing header(TASK structure):
          PLANT
          TASK_MEASURE_UNIT
          TASK_LIST_USAGE
          TASK_LIST_STATUS
          In the same way as you use the profile to make default values for therouting header, you can also use it to make default values forattributes of an operation. If you have not stored any default valuesfor these attributes in the specified profile, or if you have notspecified a profile, you must make entries for the following attributesin the OPERATION structure:
          CONTROL_KEY
          BASE_QUANTITY
          NOMINATOR
          DENOMINATOR
          You can maintain profiles in Customizing for SAP R/3.

          Description
          You use this parameter to define whether only the consistency of thetransferred data should be checked or whether the data should also beposted to the database. The data can only be posted to the database ifno inconsistencies have arisen.
          When you are using internal number assignment, ensure that the systemissues a new routing number, even when the data is only being checked.This new routing number will not be available when you create a newrouting.

          Value range
          The following values are permitted:
          ' ' -> Check data and flag it for subseqent posting to the database,if no inconsistencies have arisen
          'X' -> Only check data

          Default
          The default value is ' ', in other words, if no inconsistencies arise,the data is flagged for posting.

          Description
          Work area in the Engineering Workbench.
          To change routing routing using the /SAPMP/BAPI_ROUTING_PROCESS BAPI,you have to transfer a work area that meets the following requirements:
          Focus:
          Routing header
          Automatic lock:
          Routing headers
          Sequences
          Operations
          Bills of material
          Items
          The work area contains:
          Routing header
          Sequence
          Operation
          Suboperation
          PRT
          Inspection characteristic
          Special inspection characteristic specifications
          BOM header
          Item
          Subitem
          Component assignment
          Process work areas

          Default

          Description
          This table is used to transfer the data for the component assignments tobe created.
          The assignment is made when you enter the operation and item data.
          You can identify the operation by entering its ID in the OPERATION_IDfield. If you do not enter an ID, the system attempts to find theoperation using the operation number (ACTIVITY attribute).
          The BOM item is identified using the item ID in the ITEM_ID field, theBOM data (BOM_TYPE, BOM_NO and ALTERNATIVE_BOM attributes) and theheader BOM. If you do not enter a header BOM in the BOM_TYPE_ROOT,BOM_NO_ROOT and ALTERNATIVE_BOM_ROOT fields, it can be determined usingthe header material entry in the MATERIAL field.
          You are only permitted to enter a routing group (TASK_LIST_GROUPattribute) if you are using external number assignment. If you are usinginternal number assingment, the system determines the routing groupautomatically during processing.
          For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

          Description
          This table is used to transfer the data for the inspectioncharacteristics to be created.
          You can identify the operation by entering an ID in the OPERATION_IDfield. If this ID doesn not exist, the system attempts to find theoperation using the operation number in the ACTIVITY field.
          You can create the inspection characteristic with reference to areleased master inspection characteristic.
          You are only permitted to enter a routing group if you are usingexternal number assignment. If you are using internal number assignment,the system determined the routing group automatically during processing.
          For more information about the meaning of the various paramter fields,see the relevant data element documentation in the ABAP Dictionary.

          Description
          This table is sed to transfer the length-calculation data for the tasklist operations.
          The length-calculation data is assigned to an operation in theOPERATION_ID field when you enter the ID for the operation. If you donot make an entry, the system attempts to find the correct operationusing the operation number in the ACTIVITY field.

          Description
          This table is normally used to transfer data for the assignments ofmaterials to routings that are to be created.
          You are only permitted to enter a routing group (TASK_LIST_GROUPattribute) when you are using external number assignment. If you areusing internal number assignment, the system finds the routing groupautomatically during processing.
          You have to enter a value for the following attributes, otherwise theconsistency of the plan cannot be guaranteed:
          MATERIAL
          PLANT
          For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

          Description
          This table is used to transfer the data for the operations to becreated.
          You can uniquely identify the operation, especially in lower-levelstructures (for example, component assignment), by entering a unique keyin the OPERATION_ID field. This key must contain at least onenon-numeric character (for example, VORG0010) and remain unchangedthroughout the duration of the operation.
          You must enter a value for the following attributes, otherwiseconsistency of the operation cannot be guaranteed:
          ACTIVITY
          CONTROL_KEY or
          WORK_CNTR and PLANT
          If, when the BAPI was called, you entered a profile that defines adefault value for the tax code, the relevant attribute in the OPERATIONstructure can remain empty.
          You are only permitted to enter a routing group (TASK_LIST_GROUPattribute) if you are using external number assignment. If you are usinginternal number assignment, the routing group is determinedautomatically during processing.
          For more information about the meaning of the individual parameterfields, see the relevant data element documentation in the ABAPDictionary.

          Description
          This table is used to transfer the data regarding the production andresource tool assignments that are to be created.
          The operation can be identified using its ID, which you enter in theOPERATION_ID field. If this does not exist, the system attempts to findthe operaion using the operation number in the ACTIVITY field.
          You can assign the following objects to an operation as a productionresource/tool; you enter the relevant object type in the PRT_CATEGORYfield:

          • Production Resource/Tool (Material)

          • The material is determined using the MATERIAL and PRT_PLANT fields.
            • Equipment

            • You define the equipment to be assigned in the EQUIPMENT field
              • Documents

              • You define the document to be defined in the DOCUMENT_TYPE,DOCUMENT_NUMBER, DOCUMENT_PART and DOCUMENT_VERSION fields.
                • Miscellaneous

                • You define the production resource/tool to be assigned in theMISCELLANEOUS field.
                  You can only enter a reference operation set group when you are usingexternal number assignment. If you are using internal number assignment,the reference operation set group is determined automatically duringprocessing.
                  For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

                  Value range
                  The object type of the production resource/tool that is to be assignedis defined in the PRT_CATEGORY field. The following values arepermitted:
                  'M' -> Material
                  'E' -> Equipment
                  'D' -> Documents
                  'S' -> Miscellaneous

                  Description
                  This table is used to transfer the data for reference operation sets tobe created.
                  You can identify each reference operation by entering a unique key inthe OPERATION_ID field. This key must contain at least one non-numericcharacter (for example, REF01) and remain unchanged throughout theduration of the reference operation.
                  You can enter the reference operation set in theREFERENCED_TASK_LIST_GROUP (routing group) and REFERENCED_GROUP_COUNTERfields.
                  In the ACTIVITY field, enter the operation number for the referenceoperation in the routing.
                  You are only permitted to enter a routing group if you are usingexternal number assignment. If you are using internal number assignment,the system finds the routing group automatically during processing.
                  For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

                  Description
                  All of the messages that are issued during the creation of a routing arecollected in this table. These messages can be used as a basis forcorrecting subsequent data inconsistencies.

                  Description
                  This table is used to transfer the data for the sequences to be created.
                  Ensure that you only enter alternative or parallel sequences. You arenot permitted to enter values for the standard sequence, as these aregenerated automatically when you create the routing header.
                  You are only permitted to enter a routing group (TASK_LIST_GROUP ) ifyou are using external number assignment. If you are using internalnumber assignment, the system finds the routing group automaticallyduring processing.
                  You have to enter a value for the following atttributes, otherwiseconsistency of the routing cannot be guaranteed:
                  SEQUENCE_CATEGORY
                  REFERENCE_SEQUENCE
                  RETURN_OPERATION or RETURN_OPERATION_IDENT
                  When you create the sequence, the system takes into account any routingsequence that you have entered (SEQUENCE_NO attribute). If you have notentered a routing sequence, the next free routing sequence is issued.
                  For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

                  Description
                  This table is used to transfer the data for the suboperations to becreated.
                  For identification purposes, you can give each suboperation a unique keyin the SUB_OPERATION_ID field. This has to contain at least onenon-numeric character (for example, UV0010/1) and remain unchanged forthe entire duration of the suboperation.
                  The subitem is assigned to a higher-level operation in the OPERATION_IDfield when you enter the operation ID. If you do not enter an ID, thesystem attempts to find the correct operation using the operation numberin the ACTIVITY field.
                  You must enter a value for the following attributes, otherwise theconsistency of the suboperation cannot be guaranteed:
                  SUB_ACTIVITY (suboperation number)
                  CONTROL_KEY (control key) or
                  WORK_CNTR (work center) and PLANT (work center plant)
                  If , when the BAPI was called, you entered a profile that defines thedefault value for the control key, the corresponding attribute for theSUBOPERATION structure can remain empty.
                  You may only enter a task list group (TASK_LIST_GROUP attribute) if youare using external number assignment. If you are using internal numberassignment, the task list group is determined automatically duringprocessing.
                  For more information about the meaning of the different parameter fields
                  , see the relevant data element documentation in the ABAP Dictionary.

                  Description
                  The header data of the routing to be created is transferred in thisstructure.
                  You can only enter a reference operation set group (TASK_LIST_GROUPattribute) when you are using an external number assignment. When youare using an internal number assignment, the reference operation setgroup is determined automaticallly during processing.
                  If you enter a group counter for a reference operation set(GROUP_COUNTER attribute), the system takes this into account whencreating the new routing, providing it is not the first referenceoperation set in the group. If it is the first reference operation setin the group, '01' is used as the group counter. If you do not enter agroup counter for the reference operation set, the next group counternot in use is used to create routing.
                  You must enter values for the following attributes, otherwise theconsistency of the header data cannot be guaranteed:
                  TASK_LIST_USAGE
                  PLANT
                  TASK_LIST_STATUS
                  TASK_MEASURE_UNIT
                  If, when the BAPI was called, you entered a profile that defines defaultvalues for the specified attributes, the relevant attributes in the TASKstructure can be left empty.
                  For more information about the meaning of the different parameter fields
                  , see the relevant data element documentation in the ABAP Dictionary.

                  Description
                  This table is used to transfer the long texts to be processed line byline when you are creating or changing routing. A format parameter canbe specified for each line.
                  The long text lines assigned to an object are determined using theLINE_FROM and LINE_TO attributes in the TextAllocation table.
                  For more information about the meaning of the individual parameterfields, see the relevant data element documentation in the ABAPDictionary.

                  Description
                  The data that you store here can be used to assign long texts when youcreate or change routing. To do so, enter the object type to which youwant to assign the long text in the OBJECT_TYPE attribute. The followingvalues are permitted:
                  '10' -> Routing header
                  '12' -> Sequence
                  '13' -> Operation
                  '14' -> Suboperation
                  '15' -> Reference operation set
                  '16' -> Work center operation set
                  '17' -> Production resource/tool
                  '19' -> Inspection characteristics
                  In the other attributes, enter the values required for uniqueidentification of each object. The LINE_FROM and LINE_TO attributes arepointers to the relevant text table containing the long text lines to betransferred. LINE_FROM defines the first line of the long text, andLINE_TO defines the final line.
                  For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

                  Description
                  This table is used to transfer the data for the standard tasks to becreated.
                  Basically, work center operation sets represent a reference to areference operation set. In the work center operation set, however, theoperations in the reference operation set are grouped into a referenceoperation, that is to say, all default values in the operations in thereference operation set are cumulated and stored in the relevantattributes for the work center operation set.
                  For identification purposes, you can assign each work center operationset a unique key in the OPERATION_ID field. This key has to contain atleast one non-numeric character (for example, STD01) and remainsunchanged for the entire duration of the work center operation set.
                  You enter data for the reference operation set in theREFERENCED_TASK_LIST_GROUP (routing group) and REFERENCED_GROUP_COUNTER(group counter of a reference operation set) fields. Enter the operationnumber for the work center operation set of the routing in the ACTIVITYfield.
                  You must enter the following attributes when creating a work centeroperation set:
                  CONTROL_KEY or
                  WORK_CNTR and PLANT
                  CUMULATION_TYPE
                  You may only enter a reference operation set group (TASK_LIST_GROUPattribute) when you are working with external number assignment. If youare working with internal number assignment, the reference operation setgroup is determined automatically during processing.
                  For more information about the meaning of the various parameter fields,see the relevant data element documentation in the ABAP Dictionary.

                  Value range
                  The following values are permitted in the CUMULATION_TYPE field:
                  '1' -> Cumulation in the task list and in the order
                  '2' -> Cumulation in the order