Skip to Content
avatar image
Former Member

Change variant to consider 01.01.current year


I need to adjust the variant key date to '01.01.current year' (dynamically). I tried different options using Table Variable from TVARC but not able to adjust. I should not write this in the program. Requirement is to update the variant. Please let me know how to achieve this.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 13, 2015 at 07:44 AM

    As this variable "first day of year" does not exist, neither in table of variable nor in dynamic functions, you have to maintain it yourself in TVARVC thru a customer program executed by a periodic job and then use this new variable in your variant.

    NB: You can copy code of standard report RVSETDAT to update TVARVC, add your z-report to the background job which currently (should) execute this standard report everyday in your system.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the suggestions. I got the answer.

      In Initialization I have added the code to default the key date value to 01.01.Current year and in the variant for this key date  I have selected the check box ‘Save field without values’. So the key date value was filled with 01.01.Current year in the given variant.



  • Jan 12, 2015 at 04:59 PM

    Hi Kishor,

    Without using TVARC Table, we have another option called Dynamic date calculation .

    When creating variant, In selection variable, use D as shown below. Than lead to assign the dynamic date in variant as shown below.

    In this case, I have selected first day of current month.

    First date of Current year is not available in this case, I hope normally we schedule the program in background, Some program will run once in a year on January month. In those case, we may need first date value 01.01.2015. In some day it is going to run on January month, it is better to assign the variant (First day of Current Month) as shown above.

    If the program is ran on any day in January month, we can use value as 01.01.2015 for this year.. For next year 01.01.2016.

    Hope it helps.


    Rajkumar Narasimman

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Kishor,

      you can use RS_VARIANT_DELETE  function module to delete the existing and then update with New Information by the same coding, what i have provided.

      So everytime, user will get the new Variant with same name, only the variant value will be change, as per Date Information.