Link to home
Start Free TrialLog in
Avatar of psdalb
psdalb

asked on

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
Avatar of Mike McCracken
Mike McCracken

Which tools from SAP are you using?

mlmcc
Avatar of psdalb

ASKER

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".  
Avatar of psdalb

ASKER

I meant "List of Sales Orders"  
VA05.JPG
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
Avatar of psdalb

ASKER

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.
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
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
ASKER CERTIFIED SOLUTION
Avatar of gnurl
gnurl
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of psdalb

ASKER

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.
Please see here. You need to use "Current date +/- ??? days."

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

 User generated image