[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1610
  • 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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