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: 

Changing a variant variable via ABAP

Former Member
0 Kudos

I've looked for an answer for this, but can not find one.... so here's the situation.

I'm running a SAP job that has a date selection option.  I want to create a variant and have that date go from the 1st day of the year up until 5 days in the future of today's date.  I know I can write a program to calculate the date and do a SUBMIT, but I would like to stay away from that if possible.  The options I have are to create an entry in TVARCV from "20130101" to "today+5".  OR do a dynamic "Current date +/- xxx days". 

What I was thinking was to create a batch job that runs nightly that changes either the TVARCV entry or the XXX in the dynamic option.  The problem is I don't know how to do that.  Does anyone have any ideas?  Is there a FM that changes TVARCV?  I don't want to manually change it if I can help it since it's a SAP table.  If there is a way to do it without coding, I would love to hear about that too.

Any information would be helpful.

Thanks,

Curtis

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Curtis,

Typically for anything more complex than populating a parameter with a date +/- todays date I would use TVARV.  As you suggest, writing a fairly simple ABAP to update your variable in TVARV.

Alternatively, if the variable is fairly specific (i.e. only one batch program will need to use it) I would create a wrapper program with the parameters of your actual program but without the date.  The wrapper calls the standard program, passing the parameters and calculating the required dates.

Sadly, this still involves coding, however simple.

regards,

Nick

1 REPLY 1

Former Member
0 Kudos

Hi Curtis,

Typically for anything more complex than populating a parameter with a date +/- todays date I would use TVARV.  As you suggest, writing a fairly simple ABAP to update your variable in TVARV.

Alternatively, if the variable is fairly specific (i.e. only one batch program will need to use it) I would create a wrapper program with the parameters of your actual program but without the date.  The wrapper calls the standard program, passing the parameters and calculating the required dates.

Sadly, this still involves coding, however simple.

regards,

Nick