‎2022 Apr 07 5:33 AM
Hello Experts,
I am using Z_FM to update order status and to send status into an IDoc. So, here i'm doing creating entry in NAST table and using submit RSNAST00 for generating IDoc to send order status to IDoc.
Doing like CALL FUNCTION 'Z_FUNCTION_MODULE' IN UPDATE TASK
after this FM, creating message entry in NAST and submitting RSNAST00
SUBMIT rsnast00 WITH s_kappl = ls_nast-kappl "#EC CI_SUBMIT
WITH s_objky = ls_nast-objky
WITH s_kschl = ls_nast-kschl
WITH s_nacha = ls_nast-nacha
TO SAP-SPOOL
SPOOL PARAMETERS lv_print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB v_jobname NUMBER lv_jobnumber
AND RETURN.
Note: these code not writing in IN UPDATE FM, If we use this inside FM, getting errors.
If i use COMMIT WORK, then only IDoc getting success else it's getting failed.
But, we cannot use the COMMIT WORK in BAdi(LE_SHP_DELIVERY_PROC).
Please help on this How to Commit without using COMMIT WORK.
Kind Regards,
Ram Mididoddi
‎2022 Apr 07 6:00 AM
Hi Ram,
I had such cases also several times. I implemented a new function module that is RFC-enabled which is called inside the update task function module using STARTING NEW TASK. This creates a new session inside the update task which allows also to use the (normally) forbidden commands (in update task) like COMMIT, SUBMIT and so on.
Refer to this documentation for more details:
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/de-DE/abapcall_function_starting.htm
Kind regards
Jens
‎2022 Apr 07 7:35 AM
Format of your question is wrong, everything is in "Code" format. You can mix Code and Non-Code as you can see below.
----------------------------------------------
Hello Experts,
I am using Z_FM to update order status and to send status into an IDoc. So, here i'm doing creating entry in NAST table and using submit RSNAST00 for generating IDoc to send order status to IDoc.
Doing like CALL FUNCTION 'Z_FUNCTION_MODULE' IN UPDATE TASK
after this FM, creating message entry in NAST and submitting RSNAST00
SUBMIT rsnast00 WITH s_kappl = ls_nast-kappl "#EC CI_SUBMIT
WITH s_objky = ls_nast-objky
WITH s_kschl = ls_nast-kschl
WITH s_nacha = ls_nast-nacha
TO SAP-SPOOL
SPOOL PARAMETERS lv_print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB v_jobname NUMBER lv_jobnumber
AND RETURN. Note: these code not writing in IN UPDATE FM, If we use this inside FM, getting errors.
If i use COMMIT WORK, then only IDoc getting success else it's getting failed.
But, we cannot use the COMMIT WORK in BAdi(LE_SHP_DELIVERY_PROC).
Please help on this How to Commit without using COMMIT WORK.