Storing Texts in Update Task
If the value in the storage mode of a text is set to 'update task', this text is automatically stored. You need no extra function modules for this storage mode. The application program always calls the same SAPscript function modules, independent of the storage mode.
When using storage mode 'V', at the end of the dialog transaction the application program must call a SAPscript function module that prepares the update of the texts processed so far.
Texts maintained with SAPscript consist of a text header and a table containing the text lines. The system keeps these two components in the work areas defined in the application program. The application program must provide these work areas for each text. This means, if two text modules are edited at the same time, two structures must exist to contain the text headers and two tables for the text lines. This is necessary, if several texts are displayed and changed on the same screen. If the texts appear one after the other on different screens, you can reuse the same work areas, provided the old text has been stored. For direct storage, this is no problem, since the changes immediately go to the text file and the system can read the text from there, if the user may need it again during the transaction.
When using the update task, you are not allowed to write the text to the text file, because all database changes are executed only after the user triggered the function 'Update' in the application transaction. For this reason, changes to the text modules are stored intermediately in an administration table controlled by SAPscript: the text memory. If the user wants to edit a changed text again during the transaction, SAPscript fetches the current version of the text from the text memory. The text memory stores the database function to be executed (insert, update or delete) as well as the text header and text lines of the corresponding texts.
At the end of the transaction, the application program must use the function module COMMIT_TEXT to tell the word processing program to pass the texts stored in the text memory to the update task. After this, the text memory is empty again, unless specified otherwise. After all data of the application program are passed to the update task, a COMMIT WORK must occur to update the texts. The function module COMMIT_TEXT itself does not execute a COMMIT WORK.
You must not change the storage mode set in table TTXOB without adapting the application programs, since, depending on this setting, the programs may have to call the function module COMMIT_TEXT and a COMMIT WORK.