Skip to Content
0

Dynamic Date with Range- Changing only High value

Sep 12, 2017 at 05:35 AM

78

avatar image
Former Member

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.

dynamic-date.jpg (15.3 kB)
10 |10000 characters needed characters left characters exceeded
Former Member

closing this thread as There is no option provided by SAP, I understood that this is not possible

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sandra Rossi Sep 12, 2017 at 11:56 AM
1

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.)

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

1
avatar image
Former Member Sep 12, 2017 at 06:27 AM
0

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.

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

It's not clear, but I think he's wanting to set it in the variant, not in the code.

0
Former Member

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.

0