Skip to Content
Personal Insights
Author's profile photo Marius Stoica

Multiple jobs created at once

Hi,

Are you required to create over 80 jobs consecutively? More precisely 2 jobs/month, every month for 4 years .. Add 96 jobs πŸ™‚

Agreed, it’s not your everyday request, but it’s still some 4h+ of work, let alone create all the 96 variants to the transaction.

What if you could make them at the touch (click) of a button?

 

Said and done πŸ™‚

 

The issue with manual work is not limited to the time it takes, you are also prone to human errors. The quantity and similarities to each variant makes it almost impossible for a human to not err. Also, since SM36 has a bug that doesn’t allow you to create one job after the other without exiting the transaction, there is a “/nSM36” that breaks the process … every time πŸ™

I have created an excel file with all the variants that need to be created for the current transaction, I figured I can use that as input to my new bright idea.

The input data is something like this:

In my case, job name and variant name are identical, but you can easily use this transaction to create multiple jobs, even if they are not dependent on each other or, in case of SM36 transaction restrictions, offer this option. It was just easier for me like this.

I also added the “Predecessor job name” column, to tell the program that the current job created has to be started after the previous “one” ended (with success or error, not specified).

Now that you have completed the data input, just push the button “” and watch as all the jobs are created.

Before:

After:

Fortunately, SM36 provides most of the error messages, so I didn’t have to process them, including the checks for variant and program name (above you can see the variant check and below you can see the program check):

I had to do some checks when deleting the job created. If the job(s) were aborted for a reason or another, you shouldn’t lose the log, so the program will not delete the already processed (successfully or not) job, or the active one, only the ones that aren’t started yet.

Murphy and his law came knocking on the door and after a few jobs successfully finished, I had an error and all subsequent jobs where aborted. Ergo, I had to delete the remaining 80+ jobs and recreate them, and then restart them to finish them off.

All the time was spent well πŸ™‚

Good learning exercise.

 

PS: You can ignore the first colors of the first column. It was an example of all the colors that the ALV can show.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Sorry, I don't get it... Did you mean to share the ABAP code / Github link or something? Maybe I missed it but what is the connection between the spreadsheet and SM36 here? I'm confused...

      Author's profile photo Marius Stoica
      Marius Stoica
      Blog Post Author

      Hi Jelena, not necessarily, but if enough people want it I can share it someway.

      Excel was used by me to track all the job names that I had to create, all 96 of them, since the names were to easy to confuse and mistake if you write all of them by hand all the time.

      Author's profile photo Sandra Rossi
      Sandra Rossi

      I don’t remember of a bug which forces to exit SM36 while creating 2 chained jobs.

      Next exercise: show a custom application which creates the program variants in bulk.

      Author's profile photo Marius Stoica
      Marius Stoica
      Blog Post Author

      Sounds good. The only downside is that from what I know now, it can’t be general or dynamical. It depends on your screen elements. But I’ll look into it.

      Thank you for your feedback.

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      I was also confused by that statement because I've definitely used SM36 to create multiple jobs in a row. Just checked in our EHP6 system and it looks like you can create a new job without exiting but SM36 simply doesn't clear some (global, I assume πŸ™‚ ) data, so after you type in the new job name and go to the step definition screen, it shows all the information from the previous job there instead of a blank screen, as I'd expect.

      This could be a bug or a feature as it can actually be handy if a new job is created with the same step(s) but a different variant, for example.

      But otherwise there is nothing preventing one from creating a new job without leaving the transaction, at least in our release.