Skip to Content
-2

default values in TVARV

Apr 24 at 09:39 AM

57

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Himanshu Gupta
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 .

Share
10 |10000 characters needed characters left characters exceeded
ROBERTO Forti Santos Apr 24 at 06:32 PM
1

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,


variant.png (143.2 kB)
Share
10 |10000 characters needed characters left characters exceeded
Rajkumar Narasimman 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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks for quick response.

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

How can achieve this. Please help me on this.

0
"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

0