‎2009 Aug 11 11:45 AM
Hi,
I have requirement where in after obtaining all the required inputs from the user we will call an function module to execute it.
The requirement is that the execution of fm shld happen in background and a log must be created showing the user whther it was successful or if it failed with the list of errors.
Can you kindly give some input on how to schedule the execution of function module in background job and if scheduled how to create the logs to display the success or error message.
Warm Regards,
Naveen M
‎2009 Aug 11 11:56 AM
Hi,
Just create a simple program where you have to call this FM.
Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
For Message Log, you can use structurre BDCMSGCOLL
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
After Call to FM, read from this internal table as follows
READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
MSGNR = <Message Number>.
regds,
Anil
‎2009 Aug 11 11:52 AM
Hi
Insert the fm in a new report and schedule a job for this new report, in this way all logs and message will be available in trx SM37.
U can use fm JOB_OPEN and JOB_CLOSE in order to create and close a job.
Max
‎2009 Aug 11 11:56 AM
Hi,
Just create a simple program where you have to call this FM.
Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
For Message Log, you can use structurre BDCMSGCOLL
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
After Call to FM, read from this internal table as follows
READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
MSGNR = <Message Number>.
regds,
Anil