Application Development and Automation 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: 
Read only

Variable Variant

Former Member
0 Likes
729

Hi All,

Is it possible to create a variable variant in a program. Suppose I want to create a variant for the program where the selection screen data will be auromatically changed while running the program in batch.

Kindly provide me any inputs if you have.

Thanks in advance.

Regards,

Lokesh

6 REPLIES 6
Read only

Former Member
0 Likes
692

Hello,

You may create a program to dynamically update the variant using the function RS_CHANGE_CREATED_VARIANT and run this program prior to your batch program.

Thanks,

Venu

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
692

Dynamic variants are possible but the scope is limited.

the selection screen data will be auromatically changed while running the program in batch.

Can you be more specific in your statement ?

BR,

Suhas

Read only

Former Member
0 Likes
692

Suhas, Thanks for the response.

Yes my requirement is that every month on a specific date job will be run for a last month all sales documents created. e.g. on 2nd of April program will run for all sales documnets created in the month of march from 1st Mar to 31st Mar. same it will do in the month of May for all docs in april. so this criteria I need for batch jod creation so that it picks up the date automatically.

Please suggest.

Read only

0 Likes
692

It isn't worth developing something as this can be done manually very easily by entering the date interval in the selection screen (with a select-options to enter 01.03.2010 to 31.03.2010), or maybe they want to suppress all humans maybe

Read only

Former Member
0 Likes
692

We can do one thing here. Create a variant with blank/empty date.

In At Selection-screen output event, check if SY-BATCH is 'X' and selection screen date is initial.

Get the last month from SY-DATUM.

Get the first and last days of last month.

Modify selection screen dates with the first and last days of last month.

We followed this way in my project.

Regards,

Ganga

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
692

Hello Lokesh,

I partially agree with Sandra Since you are scheduling a monthly batch job you do not want to manually change the date range.

For me the simplest solution would be defaulting the first & last date of the previous month in the low & high values of the select-option.

I dont think creation of dynamic variant is available for SELECT-OPTION.

BR,

Suhas