Skip to Content

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:



/wp-content/uploads/2016/09/1_1038692.png



We saving a variant we can make the values dynamic as follows:


  • Select the field for which dynamic values are required and press value help for selection variable.


/wp-content/uploads/2016/09/13_1038693.png

On pressing the F4 help the options are displayed in pop-up window.


/wp-content/uploads/2016/09/14_1038698.png


Select ‘T’ for TVARVC and the select the variable name using ‘F4’ help.

/wp-content/uploads/2016/09/33_1038699.png


  • The date field can be made dynamic by following the below steps:
  • Select the selection variable as ‘D’.
  • Select the attribute value using F4 help. Here in the example we set the date field value equals to the current date.

/wp-content/uploads/2016/09/22_1038700.png

/wp-content/uploads/2016/09/21_1038701.png

One the variant is saved and report is executed:

  • The material value will be filled from TVARVC entry chosen.
  • The date will be defaulted to current date.

Running the report using the saved variant.

/wp-content/uploads/2016/09/122_1038702.png

Function Modules Related to Variants:

  • Below Function modules can be used can be used in report programs as per the requirements.


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
_VARIANT

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

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply