04-02-2009 12:30 PM
Hi,
In my scenario a report is getting displays which gives the complete details based on the input.Instead of dispalying as a report i have to schedule a background job,in which job log gives the details of the report.How to do it?Plz post some sample code
04-02-2009 12:33 PM
After giving your inputs in Selection screen of report pree F9 it will ask for details.
Give the details and create a background job with immediately option.
you can see the report output in SM37 transaction.
04-02-2009 12:33 PM
After giving your inputs in Selection screen of report pree F9 it will ask for details.
Give the details and create a background job with immediately option.
you can see the report output in SM37 transaction.
04-02-2009 12:41 PM
Am doing this in an interactive report.The first report is generated there once i click a button a background job has to be scheluled at once which should give the info of the report.How to do it?
04-02-2009 12:54 PM
In the at user-command section of your report, you shold call the following FMs in sequence to create a background job.
1) call FM JOB_OPEN
2) Submit the report name in background mode
3) JOB_CLOSE
Sample code:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = JOBNAME
JOBGROUP = 'FIEB'
IMPORTING
JOBCOUNT = JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 01
INVALID_JOB_DATA = 02
JOBNAME_MISSING = 03.
IF SY-SUBRC NE 0.
MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.
ENDIF.
SUBMIT RSBDCSUB AND RETURN
USER SY-UNAME
VIA JOB JOBNAME NUMBER JOBCOUNT
with mappe = group
WITH MAPPE = BI-NAME
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
BDCSTRTDT = SY-DATUM.
BDCSTRTDT = SPACE.
BDCSTRTTM = SPACE.
BDCIMMED = 'X'.
bdcstrttm = runtime.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBNAME = JOBNAME
JOBCOUNT = JOBCOUNT
STRTIMMED = BDCIMMED
SDLSTRTDT = BDCSTRTDT
SDLSTRTTM = BDCSTRTTM
EXCEPTIONS
CANT_START_IMMEDIATE = 01
JOBNAME_MISSING = 02
JOB_CLOSE_FAILED = 03
JOB_NOSTEPS = 04
JOB_NOTEX = 05
LOCK_FAILED = 06.
IF SY-SUBRC NE 0.
MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.
ENDIF.
CLEAR BDCIMMED.
BDCSTRTDT = SPACE.
BDCSTRTTM = SPACE.
04-02-2009 12:55 PM
Hi,
You can use the below fuction module to to create a job in back ground but for that you need to create another report which will take input from this report.
JOB_OPEN
SUBMIT program...
JOB_CLOSE
In the program you can write "write statement to create the job log".
Br/Manas
04-02-2009 2:00 PM
After using the job_open,submit and job_close how to write the contents of the report in the job log.Please help
04-02-2009 2:03 PM
04-02-2009 2:05 PM
Hi,
What I guess the job log would be no of records pass, no of successful records , no of records skipped.
So you can take the nos from the corresponding internal tables and by using "Write Statement" you can populate the job log.
BR/Manas