
In previous blogs we learnt about the types of selection screen variant, variant attribute and their uses.
Previous Blogs in the series:
Selection Screen Variants - Part I
Selection Screen Variants - Part II
Dynamic Variants: The values in such variants are dynamic and can vary over time.
How to use table TVARVC for dynamic variants? : The table TVARVC can be used for creating variants where input data needs to be changed frequently.
We have to first maintain high and low values for a field in the table TVARVC .Transaction STVARVC can be used to maintain these values in client 000. In other clients the table can be directly maintained in SM30.
This values can be then used in variants while saving the variant attributes.
To create dynamic value for any field, Click on Selection variable and then press F4.
The F4 for the selection variable shows the following options.
T – Table Variable for TVARVC
D – Dynamic data calculation.
When T is selected values will be fetched from TVARVC table . Press 'F4' on 'Name of Variable' for the field and select the desired entry.
When D is selected it corresponds to dynamic date calculations and hence is suitable for date fields.
For example if we have the selection screen as below:
We saving a variant we can make the values dynamic as follows:
On pressing the F4 help the options are displayed in pop-up window.
Select 'T' for TVARVC and the select the variable name using 'F4' help.
One the variant is saved and report is executed:
Running the report using the saved variant.
Function Modules Related to Variants:
Function Module | Description |
RS_CREATE_VARIANT | To create variants for reports |
RS_VARIANT_EXISTS | To check whether a variant exists for a report |
RS_VARIANT_CATALOG | Returns the variant list for a report in an internal table |
RS_VARIANT_FETCH | To get the variant attributes of an existing variant |
RS_VARIANT_COPY | To copy an existing variant |
RS_CHANGE_CREATED | To change the contents of an existing variant |
RS_VARIANT_CONTENTS | To get the variant contents |
RS_VARIANT_ATTR_SAVE | To save the variant attributes. Helpful for dynamic variants |
RS_VARIANT_VALUE_SAVE | To save the variant values. |
Suggestions and comments welcomed.
~Tanmay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |