Show TOC

Background documentationHolding Data Dynamically Locate this document in the navigation structure

 

In the attributes of a screen, you can enable the following standard menu entries by setting the Hold data attribute:

  •   System   User profile   Hold data  

    Hold data allows users to retain values that they have entered on a screen so that they appear the next time they start the same transaction. Only values actually entered by the user are retained. These values are again set as default values in the corresponding input fields every time the screen is reprocessed. In this process, the values transported from the ABAP program at PBO are overwritten.

  •   System   User profile   Set data  

    The Set Data menu option has the same effect as Hold Data. Additionally, when the held data is placed in the screen fields, these fields are no longer ready for input.

  •   System   User profile   Delete data  

    The Delete Data menu option deletes the held data and makes the relevant fields on the screen ready for input again.

If Hold data is not activated in the screen attributes, the above menu entries have no effect.

In the PBO event of a screen, you can overwrite the Hold data attribute dynamically using the statement

SET HOLD DATA ON|OFF.

The ON addition activates the attribute, OFF deactivates it.

Example

Syntax Syntax

Hold data

  1. REPORT demo_dynpro_set_hold_data.
  2. DATA field(10) TYPE c.
  3. CALL SCREEN 100.
  4. field = 'XXXXXXXXXX'.
  5. CALL SCREEN 100.
  6. MODULE hold_data OUTPUT.
  7.    SET HOLD DATA ON. 
  8. ENDMODULE.
End of the source code.

The statically-defined next screen for screen 100 is 0, and it contains a single input/output field called field.

Syntax Syntax

The flow logic is as follows:

  1. PROCESS BEFORE OUTPUT.
  2.    MODULE hold_data.
  3. PROCESS AFTER INPUT.
End of the source code.

In the PBO event, the Hold data attribute is activated dynamically. If the user enters a value and then chooses   System   User profile   Hold data   or Set data, the same value is displayed in the field when the screen is next displayed. This value is displayed each time the screen is called until the user chooses Delete data. This overwrites any value assigned to the field field in the ABAP program.