In the ABAP Program Flow dialog box, you use mapping variables in the filter condition, join condition, or ABAP code blocks. To update the value of the mapping variables, use a variable function in the Expression transformation in the mapping.
For example, you want to select source data from a time period that ends at the session start time. You create a mapping variable named $$FROMTIME to represent the beginning of the time period. You enter the following statement in the dynamic filter condition:
TABLE_NAME-FIELD_NAME >= $$FROMTIME
To update the beginning of the time period for the next session, you set the $$FROMTIME variable to the session start time of the current session. The built-in variable $$$SESSSTARTTIME returns the session start time. In the mapping, you update the $$FROMTIME variable by entering the following statement:
SETVARIABLE($$FROMTIME, TO_DATE(SESSSTARTTIME))
In an ABAP code block, use a mapping variable as a constant in the right-hand side of comparisons. You cannot modify the mapping variable by assigning a value to it. For example, you cannot assign a value to a mapping variable in the ABAP code block.