‎2017 Sep 12 6:35 AM
Dear SAP guys,
I am trying to give a range of values dynamically for the date field in a variant but I have been unsuccessful. My requirement is that I have to fix the low value a constant and only change high value with respect to current date. I am not able to modify only High value.
For example, in the attached picture dynamic-date.jpg, the low value I need to keep the same as 24.06.2011 but the high value 12.09.2017 needs to be changed according to current date. Please let me know your valuable inputs.
Thanks & Regards,
Aswath.
‎2017 Sep 12 7:27 AM
Hi,
Something like this :
REPORT ytestsele.
SELECT-OPTIONS dat FOR sy-datum DEFAULT '20010101' TO sy-datum NO-EXTENSION.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'DAT-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT dat.
dat-high = sy-datum.
MODIFY dat.
ENDLOOP.
START-OF-SELECTION.
‎2017 Sep 12 7:46 AM
It's not clear, but I think he's wanting to set it in the variant, not in the code.
‎2017 Sep 12 7:48 AM
Hi,
Thanks for the answer, sorry to say that this is not suitable for my requirement as I want to achieve the requirement using the dynamic variant concept only. The report needs to be scheduled with the variant as batch job. I don't want to code the logic inside the program.
Thanks & Regards,
Aswath.
‎2017 Sep 12 12:56 PM
The choices for variables within program variants are very limited. There's no option for what you want to do, so you have to find workarounds (for instance, define a variable in TVARVC, assign it to the date field in your variant, and update this variable daily using a custom program ; or, if the low date needs to always be 24.06.2011, you may hardcode it in the (custom?) program, and use "lower or equal to the current date" by using date variables, etc.)
‎2017 Sep 13 5:29 AM
Hi Rossi,
Yes that option is always there, anything not possible we need to achieve through code only. I was just wondering why SAP has not provided such options though they have provided the concept of dynamic date calculations.
I guess I have no choice but to use coding to calculate the dates dynamically when the program is being executed in background.
Thanks & Regards,
Aswath.
‎2018 Apr 10 12:29 PM
closing this thread as There is no option provided by SAP, I understood that this is not possible