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

Background job step parameters

Former Member
0 Likes
3,883

Hello,

I have developed a process that uses HRForms to create output via a background job. A step is created for each form, and a final step loops over all the spool files, converts them to PDF, and writes each one to a separate file on the server.

That all works fine. Next I would like to use some of the program parameters in the file names, i.e. pernr and date, so we can tell which file belongs to which pernr.

I am using BP_JOB_READ to get a list of spools in the job. Is there another FM I can use to retrieve the program parameters I passed into each step?

If not, I'm considering maintaining a list of field PARAMETER (type BTCXPGPAR) from table JOB_READ_STEPLIST against the pernrs from the submit stage. This does not contain the parameters I send to the program but I think I could use it to uniquely identify the step. Is this a reasonable approach?

Kind regards

Steve

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,395

At every step, there is a program and a program variant. The values of parameters are stored in the program variant, that you may read using via function module RS_VARIANT_CONTENTS (lots of code snippets in SCN).

Hello,

I have developed a process that uses HRForms to create output via a background job. A step is created for each form, and a final step loops over all the spool files, converts them to PDF, and writes each one to a separate file on the server.

That all works fine. Next I would like to use some of the program parameters in the file names, i.e. pernr and date, so we can tell which file belongs to which pernr.

I am using BP_JOB_READ to get a list of spools in the job. Is there another FM I can use to retrieve the program parameters I passed into each step?

If not, I'm considering maintaining a list of field PARAMETER (type BTCXPGPAR) from table JOB_READ_STEPLIST against the pernrs from the submit stage. This does not contain the parameters I send to the program but I think I could use it to uniquely identify the step. Is this a reasonable approach?

Kind regards

Steve

4 REPLIES 4
Read only

Former Member
0 Likes
2,395

Hi

The fm BP_JOB_READ should return the name of the variant, so you can use the fm RS_VARIANT_CONTENTS in order to get the parameters o

Max

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,396

At every step, there is a program and a program variant. The values of parameters are stored in the program variant, that you may read using via function module RS_VARIANT_CONTENTS (lots of code snippets in SCN).

Read only

0 Likes
2,395

Many thanks Sandra and Max.

I'm currently passing the parameters to the step using SUBMIT .... AND RETURN WITH  pnppernr = lv_pernr ...

When I call RS_VARIANT_CONTENTS I can't see the parameter values I set.


Should I use RS_CHANGE_CREATED_VARIANT to update the variant and then pass the variant name into JOB_SUBMIT?


Can I loop over my list of data, update the variant, and create a new step with the variant for each form without affecting existing steps?


Steve



Read only

0 Likes
2,395

When you use SUBMIT ... WITH ... WITH ... VIA JOB ..., it will create automatically a temporary variant (something like &0000000000001), that you may read using RS_VARIANT_CONTENTS.