• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1655
  • Last Modified:

How do I include a variable date in a background job?

Hello Experts,

I am new to SAP and just starting to create background jobs to run overnight for our SD department.  Daily we run a report off of VA05 and send the results to the respective salesman of orders placed in their respective areas.  I can run the jobs in the background and have them emailed to the salesmen.  However, I can not get the date to change to "yesterday's" date.  

I would think there is an easy way to enter in a variable (eg yesterday()  ), and have it work off of the system date.  

Any help would be appreciated.

Pat
0
psdalb
Asked:
psdalb
  • 4
  • 3
  • 2
  • +1
1 Solution
 
mlmccCommented:
Which tools from SAP are you using?

mlmcc
0
 
psdalbAuthor Commented:
Thanks for the quick response.  

Very new to this, so I am confused by the "tools".  

What I would like to do is run VA05  (List of Sales Reports)  as a background job at night.  I am having trouble runing the job, as well as creating a variable that will calculate "yesterday's date".  
0
 
psdalbAuthor Commented:
I meant "List of Sales Orders"  
VA05.JPG
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
mlmccCommented:
Ok, this is the SAP main program not one of the SAP business objects or Crystal tools.

I don't know that SAP program.

mlmcc
0
 
psdalbAuthor Commented:
Thanks for the effort.  I have been playing around and now see how I can set up dynamic dates in the varients.  Seem to work for everything but VA05.  Getting close.
0
 
gnurlCommented:
Hi psdalb,

as I know this cant be done by default SAP.
I know that external sceduling tools like UC4, BMC Control-M or Redwood could do something like that, but you dont want to pay for these tools just for just one job.

You could create a report which calles the VA05 report (SAPMV75A) and passes the wanted values to it, that what I would try.

Best regards,
gnurl
0
 
gnurlCommented:
By the way,
in ABAP date is stored in the system variables
SY-DATLO
User’s local date, for example 19981129, 19990628, …
and
SY-DATUM
Current application server date, for example 19981130, 19990627, …

but you can't use these variables in variants, only in ABAP programs...

gnurl
0
 
gnurlCommented:
Searched a bit around:

If you get it manged to create a variant for the Va05 execution than please have a look at the following (or modify the one used in the background job):

https://cw.sdn.sap.com/cw/docs/DOC-38186


Best regards,
gnurl
0
 
psdalbAuthor Commented:
Super Help.  Unfortunately what I wanted to do isn't possible, but the alternate solutions and explanations go a long way to solving this, as well as solving other issues.
0
 
md624Commented:
Please see here. You need to use "Current date +/- ??? days."

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c0/98039be58611d194cc00a0c94260a5/frameset.htm

 image
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now