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: 

temporary variants

0 Kudos

Hi all,

if i run a SUBMIT statement to run a report, a temporary variant

(like '&0000000000000') is created for this report.

Question 1: How are these Variants deleted? (must be a periodic job or something)

Question 2: Is there any Function Module to create this kind of variants?

Background: I create a lot of variants to run jobs. If I create 'normal' variants i have to deal with the deletion myself ... i don't want to do that if not necessary.

Thanks in advance.

regards

Steffen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Instead of submitting with a variant, you can populate the selection fields yourself inside the calling program and use a statement like this:

SUBMIT zprogram WITH SELECTION-TABLE rspar. "rspar is an internal table

or

SUBMIT zprogram WITH sel_field1 = wfield1.

This way you avoid the issue of creating and deleting variants. I hope this helps.

- April King

4 REPLIES 4

Former Member
0 Kudos

Instead of submitting with a variant, you can populate the selection fields yourself inside the calling program and use a statement like this:

SUBMIT zprogram WITH SELECTION-TABLE rspar. "rspar is an internal table

or

SUBMIT zprogram WITH sel_field1 = wfield1.

This way you avoid the issue of creating and deleting variants. I hope this helps.

- April King

0 Kudos

Hi,

thanks for the answer

actually i wrote a class that can be fed with a lot of selection parameters, converts them into variants and then submits the report with one of those created variants.

I just want to replace the 'normal' variant (created with FM 'RS_CREATE_VARIANT') with a temporary variant (e.g. &0000000000).

Is that possible?

regards steffen

0 Kudos

I haven't been able to find anything on creating temporary variants. But in your class you could define internal selection sets and then submit the program with that selection set. That would avoid creating anything external. There's an example in this document (look for the SUBMIT statement, page 3):

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d...

If it only needs to be available temporarily anyway then I don't see the advantage to creating an external variant. But you can try looking through the code in program SAPLBTCH (transaction SM37), since that can create temporary variants when you schedule a job.

- April

0 Kudos

Hi April,

i guess that the temporary variants are created by the submit statement interally.

I just wanted to take the complexity of all the select-options and parameters away by first saving them as a variant instead of taking them along all the way to the submit statement.

... seems not possible what i wanted to do

Thanks again for your support.

regards

STeffen