Calling Screen Variants
Screen variants are called either automatically or by a program.
- Screen variants are called automatically whenever you start the transaction variant they are assigned to.
The field values and attributes stored for a screen are technically saved in the screen variant. When a transaction variant is processed (see Starting Transaction Variants ), these values are inserted on the transaction's screens from those screen variants that are both available in the system and assigned to that particular transaction variant. You cannot set different screen variants according to case at this juncture.
- Screen variants are called by a program, when the program includes a call to the function module RS_HDSYS_SET_SC_VARIANT
This technique allows you to set different field values and attributes for a screen according to the current context.
It is helpful to call screen variants through a program in the following cases:
- When the same screen is used by multiple transactions
Transaction A and transaction B have the same initial screen. However, the subsequent screens of these two transactions differ from one another. Screen variant A or B can be set for the initial screen depending on whether transaction A or B is being processed. By calling the appropriate screen variant with a program, you avoid the necessity of creating two different transaction variants.
- When you need to have the same screen with different settings within a transaction
- When a subscreen has several different settings
You can also create screen variants for subscreens. This allows you to send the same subscreen with different values and attributes.
- When different table control settings exist within a screen
You can adopt table control layout guidelines in screen variants (see Table Control Layout in Variants). You can also create multiple screen variants for a table control, each with a different layout, and call these variants according to context.
Function module RS_HDSYS_GET_SC_VARIANT checks if a screen variant is active for the current screen and returns with the variant's name and current values.