2014 Jan 28 4:27 AM
Hi All,
I need to call a custom function module in my program and run it as a background task. I used
CALL FUNCTION 'Z_SD_SERV_ORDER_CREATE' IN BACKGROUND TASK
TABLES
T_FLTHDR = LT_FLTHDR
.
IF SY-BATCH EQ 0.
ENDIF.
But the SY - BATCH returns me SPACE . I checked in SM37 also. There was no background job running. Can anyone please help me out on this?
Regards,
Siju
2014 Jan 28 4:32 AM
Hi Siju
If you call a function in background task it will not schedule a job in SM37/SM37. What exactly you want to happen?
Nabheet
2014 Jan 28 4:36 AM
Hi Nabheet,
The custom function module 'Z_SD_SERV_ORDER_CREATE' which I am calling in my program has the code to create service orders. I want it to be executed in background . Any way to do this?
2014 Jan 28 4:39 AM
Hi,
It is a trfc. The function will be registered in SM58. Kindly go through the basics on CALL FUNCTION IN BACKGROUND TASK before trying it. There are options to execute LUW.
Regards,
DPM
2014 Jan 28 4:41 AM
The way you have done is a TRFC call as mentioned will get triggered on commit. You can use syntax starting new task/receiveing results(if you want) for the same. Search on SCN for function module starting new task
Nabheet
2014 Jan 28 5:17 AM
Hi DPM,
Now I used
CALL FUNCTION 'Z_SD_SERV_ORDER_CREATE' IN BACKGROUND TASK AS SEPARATE UNIT
TABLES
T_FLTHDR = LT_FLTHDR
.
COMMIT WORK.
And when I check in SM58 , it gives me an error that :
Function module "Z_SD_SERV_ORDER_CREATE" cannot be
used for 'remote' call .
Any way to sort it out?
2014 Jan 28 5:30 AM
Hi,
Check whether your FM is remote enabled. If not, kindly make it Remote function in the Function module attribute screen.
Regards,
DPM
2014 Jan 28 5:41 AM
Goto Se37 and make your function module RFC enabled in attributes
2014 Jan 28 8:53 AM