Calling external program on application server

Hi, everyone. I'm trying to call an external program from ABAP by using SM69 and FM SXPG_COMMAND_EXECUTE
MOVE 'zlong_bat' to ld_comline.         "Maintained using trans SM69
* Execute external command, contained in 'ld_comline'
  CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
       EXPORTING
            commandname                   = ld_comline
*           additional_parameters   = ld_param  "Params passed to script
*           operatingsystem               = 'UNIX'
       IMPORTING
            status                        = ld_status
       TABLES
            exec_protocol                 = ld_output
       EXCEPTIONS
            no_permission                 = 1
            command_not_found             = 2
            parameters_too_long           = 3
            security_risk                 = 4
            wrong_check_call_interface    = 5
            program_start_error           = 6
            program_termination_error     = 7
            x_error                       = 8
            parameter_expected            = 9
            too_many_parameters           = 10
            illegal_command               = 11
            wrong_asynchronous_parameters = 12
            cant_enq_tbtco_entry          = 13
            jobcount_generation_error     = 14
            OTHERS                        = 15.
  IF sy-subrc NE 0.
  ENDIF.
In the  sm69, I define zlong_bat with
    Operating system command: cmd
     Parameters for operating system command: /c remoteconn.bat
It can run well if remoteconn.bat contain some simple command of dos like dir, md, mk... But when I call a program from remoteconn.bat, the abap program hang. I also cannot test in sm69 because it hang too.
If I call direcly from sm 69 with
     Operating system command: cmd
     Parameters for operating system command: /c  psexec.exe
localhost -u test -p 1234
or
     Operating system command: C:\psexec.exe
     Parameters for operating system command: 
localhost -u test -p 1234
The SM69 also hang.
Are there any method to call a program from sap without hanging
of course the program is in its position on application server.
Thank you in advance.
Regards,
Long
Edited by: dragonking88 on Aug 25, 2010 12:54 PM

Hi Long Le Hoang,
I am running a shell script fromSM69 which call psexec.
shell script runs fine but SM69 execution goes on hold.
Can you please help me how to terminate SM69 execution.
Alpa

Similar Messages

  • How to call external programs?

    I have seen people call external programs through LabVIEW and was curious what functions you could use to do this.
    I'm pretty sure its using one of the ActiveX functions  or maybe 'open application reference .vi'.
    Can anyone tell me (or show me) a quick example of how to open an external program (ie excel,  notepad, etc) programatically
    Cory K
    Solved!
    Go to Solution.

    Cory K wrote:
    Where did they get this:
    Kudos for going from "I don't know to start" to "Let's stump Ben" with only the second post to this thread.
    I either copy it from an example or try to browse to it.
    NOTE:
    If you plan to work with MS ActiveX objects, I found it very helpful to do a custom install of Office and make sure the help files for VBA are loaded. These will at the least give you an idea of what the methods are and what parameters go with each.
    Ben
    Message Edited by Ben on 12-31-2008 11:09 AM
    Message Edited by Ben on 12-31-2008 11:13 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Browse.PNG ‏24 KB

  • To call external program

    I would like to know if exists a way of to call external program in windows ce. I'm using cvm J9.

    I don't know how is configured Windows CE, but Windows ME is MIDP 2.0, and formRequest(URL) do it (but work only since MIDP 2.0).
    It's work, but in my case, i try to add arguments, and it doesn't work with : URL = "/Program Files/MyProg/myProg.exe arg1 arg2". If somebody have found a solution...

  • Direct calls within the oracle application server to the IIS using reverse

    trying to direct calls within the oracle application server to the IIS using reverse proxy. I am having problems...
    What is trying to be achieved is a call to the 3rd party web server (IIS with Oracle SSO plug-in) that will be invoked from the OAS.
    Any suggestions

    First you might get more response if you move your question to following forum:
    Oracle Application Server - General
    Second, I didn't quite understand your question. Can you pl. clarify it bit more? What exactly do you mean by invoking IIS from OAS (I am assuming by OAS you mean OC4J here)?
    Thanks
    Shail

  • Calling external programs from within a Tomcat application

    I've got a fairly complex existing Tomcat application (which is packaged and built as a .war file) which I'm trying to edit so that it calls a Perl script part way through the processing, which will generate an XML file used later on. I think I've worked out how to call external scripts from within Java, but at the moment when I try and access the application via Tomcat the application either hangs or bails out (I don't know which, as the log files unhelpfully don't give any error messages).
    The code which is causing the problem looks like this:
    System.err.println("Calling runtime...");
    Runtime runtime = Runtime.getRuntime();
    System.err.println("Executing process...");
    Process process = runtime.exec("/path/to/ysearch.pl 'News' '\"search query\"' 'file");
    System.err.println("Waiting for process...");
    int exitVal = process.waitFor();
    System.out.println("Exited with error code: " + exitVal);The code gets as far as "Executing process..", beyond that there is nothing in the log file so I presume the runtime.exec() call is where the problem is. I'm not interested in reading the output from the script (there shouldn't be any), so that's not an issue, and the permissions on it allow anyone to read or execute ysearch.pl so I don't think there's a problem in that area.
    Does anyone have any suggestions which I could try to get this to work? I've only been using Tomcat for a week (I'm picking up on someone else's code) so I might have made a beginner's mistake. I'm using Tomcat 5 on Fedora Core 7, and Java 1.5.0_01 (I can't easily change any of those).

    I'm not sure, but I thing that overhead caused by calling du cannot be big enough to matter even on older machines.
    But, when calling du from Perl script you are also invoking shell, and this can be a little bit more 'heavy'.

  • AIR-Calling External Program

    hi, i am making an AIR application and i want to execute an external program through this, or suppose that i want to call a java program on client machine, i don't want to have any server to do this, is there any way to do that ?, plz let me know
    With Regards
    Amar Deep Singh

    I think your only option might Merapi, and that might only be for linking AIR and Java apps.
    http://merapiproject.net/
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance
    www.ChikaraDev.com
    Flex Development, Training, and Support Services

  • Call external program in background mode

    Hi,
    I am creating a PO using bapi BAPI_PO_CREATE1 in exit USEREXIT_SAVE_DOCUMENT_PREPARE.
    I dont want to write the code in my exit. Instead I want to write the code in a Z program and call it in my exit.
    My Problem.
    How do I call my z program in my exit so that I can pass internal tables from my exit to the z program. Also I want to schedule the call of my external program for background processing.
    I am trying with SUBMIT ZPROG AND RETURN. But not able to pass an internal table.
    I tried PERFORM BAPI_PO_CREATE IN PRGRAM ZPROG, but in this case not able to schedule it in background.
    Please advise.
    Regards,
    Shobhit

    Hi Rich,
    Im setting runtime error:
    My Code in Exit: (xvbfa is the table which i wanna pass)
    concatenate 'SERVICEPO' sy-datum into l_key.
    export xvbfa = xvbfa
                  to shared buffer indx(st) id l_key.
    My Code in the called program ZMM_SERVICE_PO
    Runtime Errors         CONNE_IMPORT_WRONG_OBJECT_TYPE
    Exceptn                CX_SY_IMPORT_MISMATCH_ERROR
    Date and Time          05.12.2005 21:41:54
    ShrtText
         Error when attempting to IMPORT object "XVBFA".
    What happened?
         Error in ABAP application program.
         The current ABAP program "ZMM_SERVICE_PO" had to be terminated because one of
          the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
         When importing the object "XVBFA", the object in the
         dataset had a different type from the target object in the program
         "ZMM_SERVICE_PO" (object types: field, field string/structure, table).
         table).
    Error analysis
         An exception occurred. This exception will be dealt with in more detail
         below. The exception, assigned to the class 'CX_SY_IMPORT_MISMATCH_ERROR', was
          not caught, which
          led to a runtime error. The reason for this exception is:
         The object "XVBFA" has a different object type in the dataset from
         that in the target program "ZMM_SERVICE_PO". (Object types: Field, flat
          structure,
         deep structure, flat table, deep table).
    Missing Handling of System Exception
        Program                                 ZMM_SERVICE_PO
    Trigger Location of Exception
        Program                                 ZMM_SERVICE_PO
        Include                                 ZMM_SERVICE_PO
        Row                                     43
        Module Name                             START-OF-SELECTION
    Source Code Extract
    Line  SourceCde
    REPORT  ZMM_SERVICE_PO.
    DATA: l_poheader      LIKE bapimepoheader.
    DATA: l_poheaderx     LIKE bapimepoheaderx.
    DATA: l_poitem        LIKE bapimepoitem     OCCURS 0 WITH HEADER LINE.
    DATA: l_poitemx       LIKE bapimepoitemx    OCCURS 0 WITH HEADER LINE.
    DATA: l_cond          LIKE BAPIMEPOCOND     OCCURS 0 WITH HEADER LINE.
    DATA: l_condx         LIKE BAPIMEPOCONDX    OCCURS 0 WITH HEADER LINE.
    DATA: l_poschedule    LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE.
    DATA: l_poschedulex   LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE.
    DATA: l_purchaseorder LIKE bapimepoheader-po_number.
    DATA: l_return        TYPE BAPIRET2 OCCURS 0.
    DATA: l_error_found   TYPE c.
    DATA: l_show_messages TYPE c.
    DATA: l_eindt(10)     TYPE c.
    DATA: l_answer        TYPE c.
    DATA: l_VBAK          TYPE STANDARD TABLE OF VBAK WITH HEADER LINE.
    DATA: l_VBFA          TYPE STANDARD TABLE OF VBFA WITH HEADER LINE.
    DATA: xlips           TYPE STANDARD TABLE OF LIPS WITH HEADER LINE.
    *DATA: xvbfa           TYPE STANDARD TABLE OF vbfa WITH HEADER LINE.
    DATA xvbfa like vbfa.
    DATA: l_key(60) type c.
          concatenate 'SERVICEPO' sy-datum into l_key.
    >>>>> import xvbfa = xvbfa
                      from shared buffer indx(st) id l_key.
          delete from shared buffer indx(st) id l_key.
    Could you help.
    Regads,
    Shobhit

  • FMS 4 FCUnpublish call external program

    Is it possible with server-side scripting for FMS to call an external program once a stream has been unpublished? Any links would be appreciated. Thanks.

    I've used the File Class from http://help.adobe.com/en_US/flashmediaserver/ssaslr/flashmediaserver_4.5_sslr.pdf to create a file each time an unPublish event is thrown. Then use an external program to monitor a directory where these log files get stored.
    Where there is a will there is always a way

  • Calling external program from PL/SQL

    Does anyone know whether it's possible to call an external program living outside of Oracle from PL/SQl eg. a from a stored procedure?
    Specifically i want to call back into my java appserver (ejb server) when a trigger/stored proc. is executed.
    The call does not have to be synchronous, some sort of queue will do - eg JMS??
    Any help greatly appreciated.
    null

    Hi
    Which version of oracle you are using.
    If it 8i, you can use external procedures/libraries. REfer to ORacle PLSQL documentation.
    If you are using Oracle 7+ you can use dbms pipes to post your command string and a cron job to read the pipe and execute the string.
    An alternate ugly way is to write to a file and some process reading the file at a regular interval.
    HTH
    Arvind Balaraman

  • Programs in Application server/Hard Disk

    Hi,
    When we program a report in ABAP , where is it stored in the hard disk of
    the system and what will be its extension?
    Is it possible to get a view of all ABAP programs without logging into R/3  and directly from Windows Search?
    Regards,
    Neeraja

    Hi,
    It's been a confusion actually.
    Just note that the programs and all the objects in the SAP are stored in the "Application Server".(Not ur hard disk).
    Here the Application Server refers to the server where the only way interaction between ur presentation server and the Database server.
    Hope it is clear.
    Cheers,
    Simha.
    Reward all the helpful answers..

  • Language other than bash for calling external programs

    Hi,
    sorry for the unspecific title, I couldn't think of a better summary.
    The problem is this: I have written a script to encode a DVD to H264 and Vorbis. Since it basically just performs some (OK, by now: A lot of.) management and then calls a external programs, Bash was the obvious choice.
    However, the administrative stuff the script does (evaluating user input, calculations etc.) was already a nightmare to code in Bash (lack of arithmetic, lack of data types, proper functions, lack of c-like structs etc.), and I now want to make it even more flexible in what the user (me) can ask of it (it's also going to use a config file, which is another thing that gets ugly fast). Frankly, I can't stomach that.
    So the question is this: What language would be sensible for a program the most important function of which is calling other programs?
    Simply executing them from the main program isn't enough, unfortunately, because I want to make use of multicore system by for example simultaneously extracting streams and encoding them (right now that is done through named pipes), ideally I'd need a way to multithread not internal functions/routines but external programs (Through pipes or whatever).
    I'd prefer an interpreted language, but it's not a requirement.

    I second what peets said. Perl is definitely you're best option here, in my opinion anyways. It has the best (by which I mean easiest) system interface of any scripting langauge I've worked with, and if you want a simple configuration file reader, perl's regex'es are king. Perl also takes a lot of features from the shells, such as the file test operations. If the project get's really big and hairy though, it might be worth considering python as a cleaner, stricter alternative.
    Hope that helps!

  • Calling External Program

    Hi all,
    I’m currently doing a program that will trigger an external batch (.bat) program. I’m using WS_EXECUTE function module to trigger the external program. I need to know that whether ABAP will wait until the external bat program run completed then only will go back to the calling program and execute the rest of the ABAP code; or the WS_EXECUTE will just trigger the external program then continue the rest of the code in ABAP.
    Best regards,
    Patrick

    Hi Uma,
    FYI, I've run a thorough test, it will run synchronously though it calls an external program.
    I shall take note of the obsolete FM.
    Many thanks,
    Patrick

  • Calling external programs using labview

    I have a LV program running to collect and display data, but also need to call an external program while doing this. I have a menu set up where one button launches my system control .vi, one launches my data display .vi, but there is another feature that is handled by a program a co-worker has written. Is there a way that whenever a button is pressed, LV can launch an external .exe file? Basically, I just need LV to call the executeable... the program that is called will be terminated by the user.
    Jim

    Try function palette -> Communication -> System Exec.vi
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • Call external program without intermediate step

    When I call an external program (Nik Color Efex) a window opens asking me wether I want to continue with the image having all Lr stpes applied etc. How can I circumvent this "annoying" step and directly call the external program without interruption?

    Thanks, I understand that before transferring the file you need to do these preparations, but then the window shows up asking me wether I want to transfer the copy or the original...  I am looking for a mechanism to supress that screen.

  • Calling external programs from Java?

    Hi All,
    Is there a way of calling external applications from Java without using Runtime.exec(). That method seems quite messy when you are dealing with streaming data from an input file to an output file. Basically what I'm asking is there a way to run a command the same way you would type it in a command shell?
    Thanks

    LeWalrus wrote:
    Ok, I've an external application that I want to be called inside a Java GUI. It has several input arguements, which the format looks something like:
    programname inputfile > outputfile
    Simple enough.
    >
    Works fine from a shell command line. From what I understand, this won't work using Runtime.exec() because that method will just start the application. Works fine from Runtime.exec(). Since you are'>' to write stdout to a file you need to us a shell to execute the command.
    String[] command = {"sh", "-c","programname inputfile > outputfile"};
    Process process = runtime.exec(command);
    You need to read, digest and implement the recommendations given in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .
    File input and output from the application has to be taken care of programatically (java.io stuff). Fine if you've only one input and output. But if you have several input files and hundreds of output files, where does this leave you. It would be much easier if you could pass a string command to the shell directly as if you typed it in the command line yoursel!

Maybe you are looking for

  • Need to help in alv grid graph

    Hi All,    I made alv grid report.I put graph button in screen using pf status(&graph). Now when I execute the report output come and my graph button is also working fine.But when I click the graph button, the graph shows defalut column wise.Now I ri

  • Migrating reports from Crystal Enterprise 8.5 to BO Enterprise 11.5

    Hi, We have an application configured on Crystal Enterprise 8.5 that uses unmanaged url reports method. Now we have to migrate the application to Business Object Enterprise 11.5. We are done with the installation of Business Object Enterprise 11.5 an

  • Merge and remove duplicates

    I would like to use a utility or 3rd party app to go through my two 90gb libraries of photos (iPhoto libraries) and merge them while also removing duplicates and potentially trimming it (the library was originally but in iPhoto 08 or 07, probably) Ho

  • Proposal list not displayed correctly when selected with a layout

    Dear All I have an issue with payment proposal list. When i select EDit tab on F11o and click on proposal list, i can see the proposal list for all company codes selected in parameters.When i click on change layout the system asks me maintain variant

  • Sql And Report Builder

    Hi To All, I Have a Little Problem Whit a my Query created in Report Builder 6i. this is a Query : select c.id rv_cashreg_id, m.code rv_cod_shop, m.description rv_desc_shop, c.code rv_cod_cassa, c.description rv_desc_cassa, nvl(sum(decode(a.type,0, (