2011 Apr 07 4:47 AM
Is there any method to call an external executable program (exe) from a background process in ABAP.
CL_GUI_FRONTEND_SERVICES->execute will not work since the process is working in background.
Is there any background substitute for this method?.
Thanks
Is there any method to call an external executable program (exe) from a background process in ABAP.
CL_GUI_FRONTEND_SERVICES->execute will not work since the process is working in background.
Is there any background substitute for this method?.
Thanks
2011 Apr 07 6:09 AM
Hello,
You can make use of the function 'SXPG_COMMAND_EXECUTE'.
Google it, read the documentation available on SDN. There are many relevant posts available.
BR,
Suhas
2011 Apr 07 6:24 AM
Hi John,
Try this code. Hope this is what you are looking for.
DATA LOAD_JOB TYPE TBTCJOB-JOBNAME
DATA load_count LIKE tbtcjob-jobcount.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = 'LOAD_JOB'
IMPORTING
jobcount = load_count.
SUBMIT zprog_back
VIA JOB 'LOAD_JOB'
NUMBER load_count AND RETURN.
*
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = load_count
jobname = 'LOAD_JOB'
* SDLSTRTDT =
* SDLSTRTTM =
strtimmed = 'X'
.
This will call program zprog_back using a background job 'LOAD_JOB' and will execute in background immediately.
<reminder removed by moderator>
Regards
Naveen Vajja
Edited by: Thomas Zloch on Apr 7, 2011 10:02 AM
2011 Apr 07 6:53 AM
Hi Naveen,
I think your answered code is to execute an ABAP program in background. That thing I am already doing with SM36.
But my issue is to call/execute an external executable program (not ABAP program), from an ABAP program that is running in
background.
2011 Apr 07 7:48 AM
Hi,
/SDF/S_TCC_COMMAND_EXECUTE OS: Command Execute
CAT_EXTERNAL_EXECUTE
These are the FM's I know....but never tried executing in background. Sorry
To pass parameters as well, you can also use FM gui_run
Tiny word of caution though. This only runs Windows Scripts. So if you are in a UNIX environment, thats a different story (and I'm not completely aware of such cases. Though I think you use SM69).
But as an idea.... you can write scripts to execute via a job.
There are application specific FM's as well.
<reminder removed by moderator>
Regards
Naveen Vajja
Edited by: Ncvajja on Apr 7, 2011 8:54 AM
Edited by: Thomas Zloch on Apr 7, 2011 10:03 AM
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |