Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Not updating current date in background

jaheer_hussain
Active Contributor
0 Kudos

Hi,

Good Morning.

I’ve been running background jobs using dynamic date variables – create the variant, create the variable using D and the current date. I’m running into a problem though – I’m setting it up to run on a schedule(26.02.2018), daily for example, but the current date doesn’t change like it’s supposed to. It just runs it for the same date(26.02.2018) every day. Have you ran into this problem?

Even I check the box for “Save field without values” in the variant.It is not working.

Can you please give some for this issue?

6 REPLIES 6

JL23
Active Contributor
0 Kudos

How can we know that this variant is used in your job?

And why did you decide to flag the indicator to save the field without value?

jaheer_hussain
Active Contributor
0 Kudos

Thank you jurgen.

based on below point: I did flagged this indicator. I want to run my z* program with everyday with current date in background.Is it possible?

https://saptribalknowledge.wordpress.com/2011/02/01/dynamic-dates-in-screen-variants/

  1. Eric Says:
    2011/02/16 at 05:06

    I’ve been running background jobs using dynamic date variables – exactly as shown in your screenshots, create the variant, create the variable using D and the current date. I’m running into a problem though – I’m setting it up to run on a schedule, daily for example, but the current date doesn’t change like it’s supposed to. It just runs it for the same date every day. Have you ran into this problem?

    Reply
  2. feimster Says:
    2011/02/16 at 14:04

    In the variant attributes on the line for your date field, check the box for “Save field without values”. This should force the date calculation to be used rather than the explicit value stored in your variant.

Regards,

jaheer_hussain
Active Contributor
0 Kudos

Thsis is input screen.

thanh_dinh
Explorer
0 Kudos

Hello Mohamed,

I think the way you set D and "current date" for the parameter is correct and enough to fulfill your requirement. Flag "Save field without values" is not necessary for this case. Can you make a quick test by displaying the selection screen and loading your variant? If the parameter is displayed correctly as current date, so I think maybe the background job wasn't run with your variant.

I have one workaround but honestly I don't think it's the best. You can create a new Z* report then using command SUBMIT to run your report with current date in selection screen. The last step is schedule Z* report to run everyday.

DATA: 
wa_rsparams TYPE rsparams,       
lt_rsparams TYPE STANDARD TABLE OF rsparams.

wa_rsparams-selname = 'S_BUKRS'.
wa_rsparams-kind = 'S'.
wa_rsparams-sign = 'I'.
wa_rsparams-option = 'EQ'.
wa_rsparams-low = sy-datum.
APPEND wa_rsparams TO lt_rsparams.
CLEAR wa_rsparams.
SUBMIT your_report WITH SELECTION-TABLE lt_rsparams AND RETURN

Regards,

JL23
Active Contributor
0 Kudos

If you look through the examples, which actually exists in several blogs here in the community too, then you can see that they all worked without having checked the box for “Save field without values” - So just try it without.

raymond_giuseppi
Active Contributor
0 Kudos

Remove the 'save without value', it has little meaning combined with a date calculation.