on 08-23-2006 3:51 PM
Hello,
I need to call a report from one of the methods of a WDA application. The report is called when a user clicks SAVE button. Also, the report has parameters.
The idea is to run the report as a background job.
Do I need to use SUBMIT?
How can this be done?
Thank you.
Yes, I think you can do this. I would suggest using the SUBMIT statement, but you will need to setup a background job. You can do this using the following code.
data: sdate type sy-datum,
stime type sy-uzeit,
l_valid,
ls_params like pri_params,
l_jobcount like tbtcjob-jobcount,
l_jobname like tbtcjob-jobname.
* Get Print Parameters
call function 'GET_PRINT_PARAMETERS'
exporting
no_dialog = 'X'
importing
valid = l_valid
out_parameters = ls_params.
* Open Job
l_jobname = 'ZRICH_0005'.
call function 'JOB_OPEN'
exporting
jobname = l_jobname
importing
jobcount = l_jobcount.
* Submit report to job
submit zrich_0005
<b> with p_fld = 'X' " Pass parameters like this</b>
via job l_jobname
number l_jobcount
to sap-spool without spool dynpro
spool parameters ls_params
and return.
* Kick job off 30 seconds from now.
sdate = sy-datum.
stime = sy-uzeit + 30.
* Schedule and close job.
call function 'JOB_CLOSE'
exporting
jobcount = l_jobcount
jobname = l_jobname
sdlstrtdt = sdate
sdlstrttm = stime
* strtimmed = 'X'
.
Regards,
RIch Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the above program, notice in the SUBMIT statement that there is a WITH extension. This is one way of passing the parameters, for example P_FLD is a parameter of the submitted program. You can also pass values to SELECT-OPTIONS if need be. Use create a range and pass like this.
submit <report>
<b>with S_FLD in R_FLD</b>
and return.
Regards,
Rich Heilman
User | Count |
---|---|
72 | |
11 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.