Skip to Content
-2

default values in TVARV

Hello Experts,

Anyone help me on how to set as default the current year and period in variant. I want to do a background job for our program using save variants. But I need the period and year to always be assigned what ever is the current year and period.

Please help me on this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 25 at 03:15 AM
    -1

    Hi Satish,

    you can use the initialization Event to calculate the year like 2018-3 and assigned to the Parameter/select-options .

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24 at 06:32 PM

    Hi Satish,

    Following steps to consider setting up it.

    1. Fill selection screen data and save the data as variant.

    2. Define a Variant name and in "Field attributes" select the check box for "Selection variable".

    3. Select D: Dynamic date calculation and choose corresponding date calculation (attached print).

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24 at 11:08 AM
    -1

    Hi Sathish,

    "I need the period and year to always be assigned what ever is the current year and period

    If current period is required, instead of using variant concept, you can default the values in program level itself like

    "Declaration
    PARAMETER: P_PERIOD TYPE PERIOD DEFAULT SY-DATUM+0(6).
    
    "Else assign like below too
    p_period = sy-datum+0(6). 

    Regards

    Rajkumar Narasimman

    Add comment
    10|10000 characters needed characters exceeded

    • "I want to display current year - 3 years, for ex 2018-3 = 2015.

      Please do not share the requirement as it is, always do write the problem which you faced it when you tried the requirement.

      Coming to the above issue, for calculation in the year, check whether any period variable is maintained already in TVARVC table, if it is available, use the same. If variable not available, create newly. Also, make sure that the period value in TVARVC table is updated by some background job monthly wise.

      Regards

      Rajkumar Narasimman