cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC : how to get error description returned from submit program into idoc

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

jwalithtatikonda2
Participant
0 Kudos

Use BP_JOBLOG_READ function module

Answers (1)

Answers (1)

Former Member
0 Kudos

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