cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO USE BAPI_ROUTING_CREATE

05-04-2006 6:38 AM
3944 views 3 comments
0 Likes
SAP Managed Tags
Subscribe

I want to use BAPI_ROUTING_CREATE to create routing,but i can not know how to use BAPI_ROUTING_CREATE ,who can give me some coding or advice? pls send to email: [email protected]

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hai XiaOging

check with the following Code & Program

CALL FUNCTION 'BAPI_ROUTING_CREATE'

EXPORTING

APPLICATION = APPLICATION

BOMUSAGE = BOMUSAGE

PROFILE = PROFILE

TESTRUN = TESTRUN

IMPORTING

GROUPCOUNTER = OBJECT-KEY-GROUPCOUNTER

GROUP = OBJECT-KEY-GROUP

TABLES

COMPONENTALLOCATION = COMPONENTALLOCATION

PRODUCTIONRESOURCE = PRODUCTIONRESOURCE

INSPCHARACTERISTIC = INSPCHARACTERISTIC

TEXTALLOCATION = TEXTALLOCATION

TEXT = TEXT

RETURN = RETURN

WORKCENTERREFERENCE = WORKCENTERREFERENCE

TASK = TASK

MATERIALTASKALLOCATION = MATERIALTASKALLOCATION

SEQUENCE = SEQUENCE

OPERATION = OPERATION

SUBOPERATION = SUBOPERATION

REFERENCEOPERATION = REFERENCEOPERATION

EXCEPTIONS

OTHERS = 01.

and go through the standard SAP Program 'RBUS1012'

Thanks & Regards

Sreenivasulu P

Former Member
0 Likes

Hi...

Welcome to SDN !!!!!!!!!

Refer the following code...


DATA: GROUP               TYPE BAPI1012_TSK_C-TASK_LIST_GROUP,
        GROUP_COUNTER       TYPE BAPI1012_TSK_C-GROUP_COUNTER,
        SEQUENCE_NO         TYPE BAPI1012_OPR_C-SEQUENCE_NO,
        TASK_LIST_USAGE     TYPE BAPI1012_TSK_C-TASK_LIST_USAGE,
        TASK_LIST_STATUS    TYPE BAPI1012_TSK_C-TASK_LIST_STATUS,
        LOT_SIZE_FROM       TYPE BAPI1012_TSK_C-LOT_SIZE_FROM,
        LOT_SIZE_TO         TYPE BAPI1012_TSK_C-LOT_SIZE_TO,
        TASK_MEASURE_UNIT   TYPE BAPI1012_TSK_C-TASK_MEASURE_UNIT,

        TESTRUN             TYPE BAPIFLAG,
        PROFILE             TYPE BAPI1012_CONTROL_DATA-PROFILE,

        TASK                TYPE BAPI1012_TSK_C
                              OCCURS 0 WITH HEADER LINE,
        MATERIALTASKALLOCATION TYPE BAPI1012_MTK_C
                              OCCURS 0 WITH HEADER LINE,
        SEQUENCE            TYPE BAPI1012_SEQ_C
                              OCCURS 0 WITH HEADER LINE,
        OPERATION           TYPE BAPI1012_OPR_C
                              OCCURS 0 WITH HEADER LINE,
        SUBOPERATION        TYPE BAPI1012_SUB_OPR_C
                              OCCURS 0 WITH HEADER LINE,
        REFERENCEOPERATION  TYPE BAPI1012_REF_OPR_C
                              OCCURS 0 WITH HEADER LINE,
        WORKCENTERREFERENCE TYPE BAPI1012_WC_REF_OPR_C
                              OCCURS 0 WITH HEADER LINE,
        COMPONENTALLOCATION TYPE BAPI1012_COM_C
                              OCCURS 0 WITH HEADER LINE,
        PRODUCTIONRESOURCE  TYPE BAPI1012_PRT_C
                              OCCURS 0 WITH HEADER LINE,
        INSPCHARACTERISTIC  TYPE BAPI1012_CHA_C
                              OCCURS 0 WITH HEADER LINE,
        TEXTALLOCATION      TYPE BAPI1012_TXT_HDR_C
                              OCCURS 0 WITH HEADER LINE,
        TEXT                TYPE BAPI1012_TXT_C
                              OCCURS 0 WITH HEADER LINE,
        RETURN              TYPE BAPIRET2
                              OCCURS 0 WITH HEADER LINE,
        BAPI_RETN_INFO      LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.


task-task_list_usage = '1'.
task-plant = 'Z4'.
task-task_list_status = '4'.
task-task_measure_unit = 'KG'.
APPEND task.


materialtaskallocation-group_counter = 'AC'.
materialtaskallocation-material = '3EP6001'.
materialtaskallocation-plant = 'Z4'.
APPEND materialtaskallocation.


operation-group_counter = 'AC'.
operation-activity = '0010'.
operation-operation_id = 'V10'.
operation-control_key = 'ZS11'.
operation-work_cntr = 'NAM'.
operation-plant = 'Z4'.
operation-standard_text_key = 'Z400001'.
operation-operation_measure_unit = 'KG'.
operation-denominator = 1.
operation-nominator = 1.
operation-base_quantity = 200.
operation-std_unit_02 = 'MIN'.
operation-std_value_02 = '3.5'.
operation-std_unit_03 = 'MIN'.
operation-std_value_03 = '3.5'.
operation-required_wait_time_unit = 'STD'.
operation-required_wait_time = 1.
APPEND operation.


operation-group_counter = 'AC'.
operation-activity = '0020'.
operation-operation_id = 'V20'.
operation-control_key = 'ZS05'.
operation-work_cntr = 'LP1K71'.
operation-plant = 'Z4'.
operation-standard_text_key = 'Z400002'.
operation-operation_measure_unit = 'KG'.
operation-denominator = 1.
operation-nominator = 1.
operation-base_quantity = 200.
operation-std_unit_02 = 'MIN'.
operation-std_value_02 = 4.
operation-std_unit_03 = 'MIN'.
operation-std_value_03 = 48.
operation-required_wait_time_unit = 'STD'.
operation-required_wait_time = 1.
APPEND operation.


componentallocation-group_counter = 'AC'.
componentallocation-activity = '0010'.
componentallocation-operation_id = 'V10'.
componentallocation-bom_type = 'Z'.
componentallocation-bom_no = '00080331'.
componentallocation-alternative_bom = '01'.
componentallocation-item_id = '00000001'.
componentallocation-item_no = '0010'.
componentallocation-comp_qty = 200.
componentallocation-comp_unit = 'KG'.
componentallocation-material = '0200200354011'.
componentallocation-plant = 'Z4'.
componentallocation-bom_type_root = 'Z'.
componentallocation-bom_no_root = '00080331'.
componentallocation-alternative_bom_root = '01'.
APPEND componentallocation.


componentallocation-group_counter = 'AC'.
componentallocation-activity = '0020'.
componentallocation-operation_id = 'V20'.
componentallocation-bom_type = 'Z'.
componentallocation-bom_no = '00080331'.
componentallocation-alternative_bom = '01'.
componentallocation-item_id = '00000002'.
componentallocation-item_no = '0020'.
componentallocation-comp_qty = 200.
componentallocation-comp_unit = 'KG'.
componentallocation-material = '0100400069051'.
componentallocation-plant = 'Z4'.
componentallocation-bom_type_root = 'Z'.
componentallocation-bom_no_root = '00080331'.
componentallocation-alternative_bom_root = '01'.
APPEND componentallocation.


 CALL FUNCTION 'BAPI_ROUTING_CREATE'
*    DESTINATION 'NONE'
    EXPORTING
      TESTRUN                = TESTRUN
      PROFILE                = PROFILE
      BOMUSAGE               = BOMUSAGE
      APPLICATION            = APPLICATION
    IMPORTING
      GROUP                  = GROUP
      GROUPCOUNTER           = GROUP_COUNTER
    TABLES
      TASK                   = TASK
      MATERIALTASKALLOCATION = MATERIALTASKALLOCATION
      SEQUENCE               = SEQUENCE
      OPERATION              = OPERATION
      SUBOPERATION           = SUBOPERATION
      REFERENCEOPERATION     = REFERENCEOPERATION
      WORKCENTERREFERENCE    = WORKCENTERREFERENCE
      COMPONENTALLOCATION    = COMPONENTALLOCATION
      PRODUCTIONRESOURCE     = PRODUCTIONRESOURCE
      INSPCHARACTERISTIC     = INSPCHARACTERISTIC
      TEXTALLOCATION         = TEXTALLOCATION
      TEXT                   = TEXT
      RETURN                 = RETURN.

Hope it helps...

Lokesh

Pls. reward appropriate points by clicking the stars on the left side of the post.

Former Member
0 Likes

Can anybody pls tell me how to use in LSMW