Calling Screen Variants

Screen variants are called:

  • Automatically whenever you start the transaction variant that 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.

  • By a program that includes a call to 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.

When is it helpful to call screen variants using a program?

  • 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 having to create two different transaction variants.

  • When different settings are necessary with the save screen within a transaction
  • When a subscreen has several different settings

Screen variants can also be created 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.