cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Variant?

Former Member
0 Kudos

I have a batch job for std. SAP program that needs to pick up a file. My only problem is file name has a counter and will increment every day.

How can I automatically schedule this job?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The reason why I asked for the program name is becuase some programs allow logical filenames to be entered. But not this one.

You options are:

1) Have an external program to rename the file to a constant name while keeping a backup of the original file. That constant name will be used by the variant.

2) Have a wrapper ABAP program that checks for the counter based file and then submits the standard program using that file name.

3) Change the variant as sugegsted before, but be cautious about the timing of the change.

Srinivas

Former Member
0 Kudos

What is the standard program?

Former Member
0 Kudos

RFEBKA00 is the std. program

Former Member
0 Kudos

I think that rather than trying to change a variant dynamically, I'd put some logic in the program to look for the file with the highest counter and process that one.

Rob

Former Member
0 Kudos

This is standard R/3 program and I do not want to change this program before exploring additional options.

Former Member
0 Kudos

It would be awkward, but you could write a frontend that finds the correct file and then submits the standard SAP program.

Rob

Former Member
0 Kudos

You can run background job with a variant. After each run update variant using fm RS_CHANGE_CREATED_VARIANT. This fm will be used to update parameter for the file - it will increament with 1.

So in this way you can schedule the job to run in background.

Former Member
0 Kudos

This would probably work most of the time. But it's possible that the counter will be incremented without the job being run. That's why I think it's better to look for the correct file to process just before the program is run. In any event you would have to use FM RS_CHANGE_CREATED_VARIANT (or something like it) to change the variant.

I take it back about using RS_CHANGE_CREATED_VARIANT. You would just:


SUBMIT (report) with
  p_file = file_name.

or some other variation of submit.

Rob

Message was edited by: Rob Burbank