The concept of a selection screen variant is something that most SAP users have come to expect, yet this feature is unavailable in standard Web Dynpro. Below is the next in a series of posts detailing how to bring this necessary feature back to Web Dynpro. Start here to see the full requirements.
Start a new ABAP class ZCL_WDR_SELOPT_VARIANT. It should inherit from CL_WD_COMPONENT_ASSISTANCE in order to be a true Web Dynpro assistance class (however, this isn’t a requirement). An Assistance Class is assigned to a Web Dynpro component for two reasons: text elements and class-based coding.
Text ElementsI use this class to hold a list of language-dependent label captions that can be translated as needed.
Classic ABAP Class-based Code
You’ll see later where these methods are called. The GET_TEXT method is simply a call to Web Dynpro assistance class GET_TEXT. This makes for a more simple method call inside my Web Dynpro component. The INIT_VARIVAR_TABLE is called at initialization to populate the MT_VARIVAR variant variables function list.This method gets a list of the various dynamic date possibilities:
Next, let’s dive into the Web Dynpro component itself.