‎2008 Feb 27 10:41 AM
Hi ,
I am facing a issue in BAPI_ROUTING_CREATE, when executing the BAPI after passing all the required parameter for creation of Routing , it returns following
S BAPI 000
i.e bapi execution is suscessfull, but when I check in CA03, its not created, could any one help me in this regards
I am passing following parameters
TASK
MATERIALTASKALLOCATION
OPERATION
SUBOPERATION
thanks
bobby
‎2008 Feb 27 12:26 PM
Hi
You will have to use BAPI_TRANSACTION_COMMIT after your bapi call. Only then the Routing will be created.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Thanks
Vijay
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 3:37 PM
‎2008 Feb 27 12:26 PM
Hi
You will have to use BAPI_TRANSACTION_COMMIT after your bapi call. Only then the Routing will be created.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Thanks
Vijay
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 3:37 PM
‎2008 Feb 28 5:41 AM
Hi Vijay,
Is there any BAPI for Changing/Delete routing
thanks
bobby
‎2008 Feb 28 6:19 AM
Hi Vijay,
I tried to create routing using the BAPI_ROUTING_CREATE and after that used the BAPI_TRANSACTION_COMMIT function module to store in data base table .
The routing is getting created but I am unable to find it in the transaction code CA03. Please help me out in this.
Regards,
Ramkishore.
‎2008 Mar 05 8:20 AM
hI,
PLEASE TRY THE BELOW CODE
DATA: BEGIN OF bapi_task OCCURS 0.
INCLUDE STRUCTURE bapi1012_tsk_c.
DATA: END OF bapi_task.
DATA: BEGIN OF bapi_materialtaskallocation OCCURS 0.
INCLUDE STRUCTURE bapi1012_mtk_c.
DATA: END OF bapi_materialtaskallocation.
DATA: BEGIN OF bapi_operation OCCURS 0.
INCLUDE STRUCTURE bapi1012_opr_c.
DATA: END OF bapi_operation.
DATA: BEGIN OF bapi_sub_operation OCCURS 0.
INCLUDE STRUCTURE bapi1012_sub_opr_c.
DATA: END OF bapi_sub_operation.
DATA: BEGIN OF bapi_inspcharacteristic OCCURS 0.
INCLUDE STRUCTURE bapi1012_cha_c.
DATA: END OF bapi_inspcharacteristic.
DATA: BEGIN OF bapi_return OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF bapi_return.
bapi_task-valid_from = sy-datum.
bapi_task-task_list_usage = '1'.
bapi_task-plant = '0001'.
bapi_task-task_list_status = '4'.
bapi_task-task_measure_unit = 'KG'.
bapi_task-TASK_LIST_GROUP = '50000010'.
bapi_task-GROUP_COUNTER = '1'.
APPEND bapi_task.
CLEAR bapi_task.
bapi_materialtaskallocation-material = 'AB001999'.
bapi_materialtaskallocation-plant = '0001'.
bapi_materialtaskallocation-valid_from = sy-datum.
bapi_materialtaskallocation-TASK_LIST_GROUP = '50000010'.
bapi_materialtaskallocation-GROUP_COUNTER = '1'.
APPEND bapi_materialtaskallocation.
CLEAR bapi_materialtaskallocation.
bapi_operation-valid_from = sy-datum.
bapi_operation-activity = '0010'.
bapi_operation-control_key = 'PP01'.
bapi_operation-plant = '0001'.
bapi_operation-description = 'TESTING12'.
bapi_operation-denominator = '1'.
bapi_operation-nominator = '1'.
bapi_operation-base_quantity = '1'.
bapi_operation-TASK_LIST_GROUP = '50000010'.
bapi_operation-GROUP_COUNTER = '1'.
APPEND bapi_operation.
CLEAR bapi_operation.
bapi_sub_operation-valid_from = sy-datum.
bapi_sub_operation-sub_activity = '0011'.
bapi_sub_operation-activity = '0010'.
bapi_sub_operation-control_key = 'PP01'.
bapi_sub_operation-plant = '0001'.
bapi_sub_operation-description = 'Mixing'.
bapi_sub_operation-denominator = '1'.
bapi_sub_operation-nominator = '1'.
bapi_sub_operation-base_quantity = '1'.
*
bapi_sub_operation-TASK_LIST_GROUP = '50000010'.
bapi_sub_operation-GROUP_COUNTER = '1'.
APPEND bapi_sub_operation.
CLEAR bapi_sub_operation.
bapi_inspcharacteristic-activity = '0010'.
bapi_inspcharacteristic-valid_from = sy-datum.
bapi_inspcharacteristic-quantitative_ind = 'X'.
bapi_inspcharacteristic-char_descr = 'Hardness'.
bapi_inspcharacteristic-up_tol_lmt_ind = 'X'.
bapi_inspcharacteristic-lw_tol_lmt_ind = 'X'.
bapi_inspcharacteristic-target_val_check_ind = 'X'.
bapi_inspcharacteristic-dec_places = '2'.
bapi_inspcharacteristic-meas_unit = 'KGV'.
bapi_inspcharacteristic-target_val = '10'.
bapi_inspcharacteristic-up_tol_lmt = '12'.
bapi_inspcharacteristic-lw_tol_lmt = '8'.
bapi_inspcharacteristic-CHARACTERISTIC_NAME = 'Hardness1111'.
append bapi_inspcharacteristic.
CLEAR bapi_inspcharacteristic.
*BAPI_GROUP = '50000010'.
*bapi_groupcounter = '1'.
.
*CALL FUNCTION '/SAPMP/BAPI_ROUTING_PROCESS'
CALL FUNCTION 'BAPI_ROUTING_CREATE'
exporting
CHANGEMODE = 'X'
IMPORTING
group = bapi_group
groupcounter = bapi_groupcounter
TABLES
task = bapi_task
materialtaskallocation = bapi_materialtaskallocation
operation = bapi_operation
suboperation = bapi_sub_operation
inspcharacteristic = bapi_inspcharacteristic
return = bapi_return.
LOOP AT bapi_return.
IF bapi_return[] IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ELSE.
IF bapi_return-type EQ 'E'.
WRITE:/'Error in Function', bapi_return-message.
ROLLBACK WORK.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE:/ bapi_return-message.
ENDIF.
ENDIF.
ENDLOOP.
THANKS
BOBBY