on 06-10-2008 10:21 AM
Hi,
I have created an IDOC inbound function module.In the source code of this function module i have used SUBMIT command to submit a function module in background.Now what I wanted to do was that in case there are errors in the background program i must update them in the idoc status record.My question was how do we get the error description from a submit program in the background.I mean is there any return type variable or something inside which we can catch these errors?
Use BP_JOBLOG_READ function module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shah,
Read the contents of a job processing log into an internal table for further processing. You could, for example, combine the logs of related jobs into a single log. Display sample code
For sample code, please see the online documentation in the function module facility
Copying a Job Log into an Internal Table
Use BP_JOBLOG_READ to read the contents of a job log into an internal table. You can then further process the job log. For example, you could concatenate the logs from several related jobs or search for the term canceled (German abgebrochen) to detect jobs that did not run successfully.
Sample Program
REPORT BPJOBLOG.
INCLUDE LBTCHDEF.
Possible data declarations: BP_JOBLOG_READ
Assumption: You have saved the JOBNAME and JOBCOUNT of a job
and are specifying these values explicitly.
Job log records are returned in an internal table.
DATA: JOBNUMBER LIKE TBTCJOB-JOBCOUNT.
DATA: JOBLOGID LIKE TBTCJOB-JOBLOG.
DATA: JOBNAME LIKE TBTCJOB-JOBNAME.
DATA JOBLOG OCCURS 100 LIKE TBTC5.
JOBNAME = '<NAME OF JOB>'. " Supplied by you when you schedule
" a job.
JOBCOUNT = '<NUMBER OF JOB>'. " Returned by JOB_OPEN.
CALL FUNCTION 'BP_JOBLOG_READ'
EXPORTING
CLIENT = SY-MANDT " Defaults to user's client.
JOBCOUNT = JOBNUMBER " Job ID number.
JOBNAME = JOBNAME " Job name.
TABLES
JOBLOGTBL = JOBLOG
EXCEPTIONS
JOBLOG_DOES_NOT_EXIST = 01 " Log already deleted
JOBLOG_IS_EMPTY = 02 " Job has just started. If
" exception recurs, there is
" probably a system problem.
NO_JOBLOG_THERE_YET = 03 " Job not yet started.
NO_SHOW_PRIVILEGE_GIVEN = 04 " Calling user does not have
" display privileges for the
" requested job.
OTHERS = 99. " System errors, such as
" database or network
" problems.
if found worth pls do the req
Thanx
Sampath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.