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: 

background job is cancelled dut o variant not exist

Former Member
0 Kudos

Dear friends,

In my program I have created a variant using FM 'RS_VARIANT_CREATE', and after the creation of variant , i'm submitting the job immediately, but the job get canceled with error message, specified variant is not defined.

when i checked the VARID table the variant gets updated, the time differnce is approximately 8 sec for both varaint creation and job start timre. Can any one face this type of issue, could any one help on this.

Thanks for your time.

Best regards

Kumar.

4 REPLIES 4

Former Member
0 Kudos

At the time of SUBMIT (see this keyword in ABAP help), are you supplying the name of the variant? Are you supplying a job name and getting a job number first? or??

0 Kudos

Dear Friend,

I am submitting the job with job name and job number and with selection-table ( variant).

Here the issue is if I re run the same failed job( after few mints) with out any changes , it get's executed successfully, Here the issue is time conflicts, between the variant creation and job submission, during the job submission a vraint existence is being checked, there it''s failing..

please let me know what could be the possible reasons..

Thank you!

Best Regards

Kumar.

0 Kudos

Hi Kumar,

Right after you create your variant use the statement COMMIT WORK AND WAIT.

If it doesn't work you can do something like this

While f_found = space.

select * from varid

where report = 'XYZ'

and variant = 'MYVAR'.

if sy-subrc = 0.

f_found = 'X'.

else.

wait up to 1 seconds.

endif.

endwhile.

I still think try COMMIT WORK AND WAIT after calling RS_VARIANT_CREATE.

Kind regards,

Marius

marius_greeff
Active Participant
0 Kudos

Have you tried commit work and wait after creation of your variant?

Regards,

M