Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

To call an external executable program from a background process

Former Member
0 Likes
836

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

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
695

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

Read only

Former Member
0 Likes
695

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

Read only

0 Likes
695

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.

Read only

0 Likes
695

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