2016 Jun 30 9:25 AM
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
2016 Jun 30 11:34 AM
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
2016 Jun 30 11:29 AM
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
2016 Jun 30 11:34 AM
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).
2016 Jun 30 12:05 PM
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
2016 Jun 30 12:15 PM
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.