LOOP AT i_data
INTO w_data.
.*****several data processing
*call bapi to create production order
concatenate 'Task' sy-tabix into task. " New task name
CALL FUNCTION 'COXT_BAPI_ORDER_CREATE' starting New task 'Task1'"
" Task Name in which u can call the bapi in the New task .
destination 'NONE'
performing set_function1_done On end of task " Call your Rollback F.M inside this perform
EXPORTING
is_header = lx_orderdata
i_order_category = lv_auftyp
iv_reset = 'X'
iv_commit = ' '
IMPORTING
es_return = lx_return_create
e_order_number = lv_order_number.
endloop.
IF lv_order_number IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
******* save the created production order to the custom table using ENQUEUE and DEQUEUE.
MODIFY ZCUSTOM TABLE.... ...
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
ENDLOOP.
For any help follow this link Parallel Processing - ABAP Development - SCN Wiki.
Regards.
Nishant Bansal