2023年7月6日 星期四

ABAP SUBMIT語句使用注意事項

 https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapsubmit.htm


The addition AND RETURN determines the object accessed by the runtime environment after the program has been called:

Without the addition AND RETURN, the internal session of the program accessed replaces the internal session of the calling program in the same position in the call sequence, with the current SAP LUW being exited. Once program access is completed, the system returns to before the position from which the calling program was started. The content of the system field sy-calld at SUBMIT is copied by the calling program without AND RETURN.

如果沒有添加 AND RETURN,則所訪問程序的內部會話將替換調用序列中相同位置的調用程序的內部會話,同時退出當前 SAP LUW。 一旦程序訪問完成,系統返回到調用程序啟動之前的位置。 SUBMIT 處的系統字段 sy-calld 的內容由調用程序複製,無需 AND RETURN。

The addition AND RETURN starts the executable program in a new internal session of the current call sequence. The session of the calling program and the current SAP LUW are preserved. The called program runs in its own SAP LUW. Once program access is completed, program execution is continued after the statement SUBMIT.

添加 AND RETURN 在當前調用序列的新內部會話中啟動可執行程序。 調用程序的會話和當前 SAP LUW 將被保留。 被調用的程序在其自己的 SAP LUW 中運行。 一旦程序訪問完成,程序在SUBMIT語句後繼續執行。

The number of internal session in a call sequence is restricted to nine. If this is exceeded by SUBMIT ... AND RETURN, the program terminates and the entire call sequence is deleted.

呼叫序列中的內部會話數量限制為 9 個。 如果 SUBMIT ... AND RETURN 超出此範圍,程序將終止並刪除整個調用序列。

SUBMIT does not end the current database LUW (the addition AND RETURN is irrelevant here). A database commit or database rollback in the called program works in exactly the same way as in the current program.

SUBMIT 不會結束當前數據庫 LUW(這裡添加 AND RETURN 無關)。 被調用程序中的數據庫提交或數據庫回滾的工作方式與當前程序中完全相同。

The statement SUBMIT with the addition AND RETURN opens a new SAP-LUW, but it does not open a new database LUW. This means that a database rollback in this SAP LUW can roll back all registration entries made by the statements CALL FUNCTION IN UPDATE TASK or CALL FUNCTION IN BACKGROUND TASK in the tables VB... or ARFCSSTATE and ARFCSDATA. Under certain circumstances, the statement ROLLBACK WORK in the called program can also affect the interrupted SAP LUW. To prevent this, an explicit database commit must be executed before the program is called. This problem does not occur in local updates.

添加 AND RETURN 的 SUBMIT 語句打開一個新的 SAP-LUW,但不會打開新的數據庫 LUW。 這意味著此 SAP LUW 中的數據庫回滾可以回滾由表 VB... 或 ARFCSSTATE 和 ARFCSDATA 中的 CALL FUNCTION IN UPDATE TASK 或 CALL FUNCTION IN Behind BACKGROUND TASK 語句創建的所有註冊條目。 在某些情況下,被調用程序中的ROLLBACK WORK語句也會影響中斷的SAP LUW。 為了防止這種情況,必須在調用程序之前執行顯式數據庫提交。 本地更新不會出現此問題。

If there are still procedures registered in the current SAP LUW in a SUBMIT, without AND RETURN, the SAP LUW exits without calling or rolling back the procedures. Registered update function modules can no longer be executed. In a case like this, therefore, it is advisable to execute the statement COMMIT WORK or ROLLBACK WORK explicitly before the program call.

如果在 SUBMIT 中當前 SAP LUW 中仍有註冊的過程,而沒有 AND RETURN,則 SAP LUW 將退出而不調用或回滾過程。 已註冊的更新功能模塊無法再執行。 因此,在這種情況下,建議在程序調用之前顯式執行 COMMIT WORK 或 ROLLBACK WORK 語句。

SET UPDATE TASK LOCAL與LUW說明

 https://blog.csdn.net/nkGavinGuo/article/details/122707200