An alternative in the context can be compared with the ABAP statement IF-ELSE-ENDIF. So again, this is a kind of “ABAP light” coding.
Alternatives can be nested, and they can also be combined with conditions.
In the example above, the TRUE path is only processed if SENDER-COUNTRY = 'DE'. and only that rows of the internal table MEALS are transferred to the layout that match the DATA condition (example MEALS-SPRACHE = 'D').
Not only interface elements are passed to the context. New elements can also be created in the context:
See the example above for static and dynamic text modules.
On the left: SF_XSF_DEMO_GREETINGS is a Smart Forms text module.
On the right: IV_SENDER_TEXT is a variable containing a text module at run time (hopefully).
This figure shows the solution of the form context exercise.
The most important parameters are IS_ADDRESS and IT_TITLES.