‎2015 Jan 29 10:55 PM
Hi
I am creating jobs through a SE38 program and building variant through program only .
I cannot hard code the variant name because program can be executed multiple times with out completing the current running job .
I need to have a unique variant name every time to resolve the issue . Here length of the variant name is14 characters only .
So i cannot concatenate sy-uname sy-date and sy-uzeit . Do we have any other option to have unique variant name every time .
i checked with FMs to create random number like NUMBER_GET_NEXT , ICL_ULAE_RUN_NUMBER_GET_NEXT and etc .but these are random numbers so cannot concatenate with this number as this number may repeat frequently also.
Can any body worked on this kind of requirement let me know the ideas .
Thanks
Kamesh
‎2015 Jan 29 11:13 PM
Hi Kamesh
Why not use the same variant name, and manage the run parameters within the program you are running.
Regards
Arden
‎2015 Jan 30 3:25 AM
I explained the issue if I use same variant name . Multiple users can execute the report multiple times a day . So if earlier job is not completed variant is not taking new parameter values . And i tried with change variant also.
‎2015 Jan 30 2:20 AM
Hi Kamesh,
'NUMBER_GET_NEXT' will get a random number? i don`t think so.
It`s must be sequential as you defined in SNRO.
To create a BJob, using 'JOB_OPEN', SUMIT report WITH parameter, 'JOB_CLOSE', seems not need a unique variant name.
regards,
Archer
‎2015 Jan 30 3:26 AM
I explained why I need unique variant name in the thread itself .
‎2015 Jan 30 3:55 AM
HI Kamesh,
What about defining a table or using TVARC entry and updating every time whenever a job is executed and then increasing the number once it is finished?
‎2015 Jan 30 5:04 AM
Hi Jayanthi,
Even job name is same every time .Only variant parameters are different . So I am not able to check which job is related to . There is no inputs how many times program will be executed also .
Thanks
Kamesh
‎2015 Jan 30 5:10 AM
Hi Jayanthi,
Currently I am doing variant in the program like below because variant can be of 14 characters only .
<2char identifier><sy-uname ><hours and minutes of sy-uzeit>
‎2015 Jan 30 5:21 AM
Hi Kamesh,
Define entry in a table for maintaining a value which is of type numeric(say variant_val = 1).
In program, before you execute the job, read the table and then take the value variant_val from the table.
Once the job is finished, in program, update the table entry value to +1(now it will be 2).
Next time, it will read different value from the table. Every time, value will be different.
‎2015 Jan 30 5:25 AM
Hi Kamesh,
You may even think about concatenating variant value from table with current date.
This way, even you can reset the variant value to 1 whenever it reaches 1000 while updating.
‎2015 Jan 30 5:29 AM
Hi Kamesh,
you can use below blog, which is created by me.
Where, i have to try to execute the program in background with the help of Dynamic Variant.
Code is attached in attachment.
ZPRV_BACKGROUND_PROCESS.txt.zip
Regards.
Praveer.
‎2015 Jan 30 10:15 AM
Hi Kamesh,
KAMESH G wrote:
Hi Jayanthi,
Currently I am doing variant in the program like below because variant can be of 14 characters only .
<2char identifier><sy-uname ><hours and minutes of sy-uzeit>
The Maximum variant length is 14. The Username length is up-to 12 characters, in those case, I hope creating variant based on username with hours/minutes, may have some complications.
As Jayanthi Jayaramansuggested, it is better to maintain the table for variant. Even for maintaining program standards, instead of hard coding, it is better to use tables.
Regards
Rajkumar Narasimman
‎2015 Jan 30 3:29 PM
not sure . For this simple thing customer accepts custom table or not . And again clean up program needed to delete the custom table entries .
‎2015 Jan 30 3:31 PM
Instead of creating custom table I think we can take index from table VARID also and we can use that . But I am exploring do we have any other option to create some unique number so that I can concatenate with user name or other .
‎2015 Feb 02 4:20 AM
HI Kamesh,
You don't need to write clean up program since you will be updating the same entry(either TVARC or some other custom table) in the same program after the job is successful.