Tcode SM69 - External OS Command

Hi guys,
I need help for tcode SM69
How do we access a BAT file from a directory path for example
C:\Program Files\Software_ABC\Deeper_folder\genxy.bat
Operating System = windows nt
Type = Customer
But I have no idea how to go about for the Operating System Command.
I'm supposed to run it like
C:\Program Files\Software_ABC\Deeper_folder\genxy.bat  "E:\usr\sap\EWD\DVEBMGS00\data\File_20110107114455.xml"
Any advice? Appreciate it

you create external command and pass command name in FM
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
or u can use following way
CONSTANTS: c_extcom    TYPE sxpgcolist-name VALUE 'ZTEST',
           c_oper      TYPE syopsys VALUE 'Windows NT'.
DATA: v_dir_input      TYPE sxpgcolist-parameters.  " Input Directory
DATA: t_result         TYPE STANDARD TABLE OF btcxpm.
v_dir_input = 'cmd /c C:\Program Files\Software_ABC\Deeper_folder\genxy.bat'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                   = c_extcom
    additional_parameters         = v_dir_input
    operatingsystem               = c_oper
  TABLES
    exec_protocol                 = t_result
  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.

Similar Messages

  • External System command is not working

    Hi Experts,
    I have a requirement to copy some files (K&R ) from one directory to another directory on my application server. For that I made one external operating systems command through Tcode sm69.
    I took operating system as "DOS" and put the operating system command
    "copy d:\usr\sap\e70-trans\data\r900425.e70 d:\usr\sap\trans\test"
    and left the "Parameters for operating system command" blank. I executed it by FM SXPG_COMMAND_EXECUTE., it gives me an error message
    Can't exec external program (No such file or directory)
    WaitForSingleObject failedwith %d (No such device or address)
    the above DOS command is working fine when i am running it directly from dos prompt.
    I didn't give any RFC in above FM. and changed the operating system to DOS by default it comes as Windows NT, gave the command name. Remaining things were defaulted.
    My application server is on Windows Server 2003.
    Can you please let me know what I am missing?
    Thanks
    Yogesh Gupta

    Hi,
    Since you ave tried it from command prompt, simplest would be create a batch file & include your copy command in that & in SM69 define a new command say ZCOPY, give operating system command as batch file name along with full path. Test the above via SM49. If it works then just use:
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
             EXPORTING
                commandname            = 'zcopy'
              additional_parameters  = w_additional_parameters
                status                              = statusline
             TABLES
                exec_protocol                       = t_copy
             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
    I hope this helps,
    Regards
    Raju Chitale
    Edited by: Raju Chitale on Apr 15, 2009 8:16 AM
    Edited by: Raju Chitale on Apr 15, 2009 8:18 AM

  • External OS Command SM49

    Hi All,
    Is it possible to run External OS Command created in Tcode SM49 by File Adapter.
    We are running SAP PI IBM OS i5 and need to call RPG program from File Adapter, if i create custom OS command in SM49 and able to execute the same command from File adapter then my problem has been fix.
    In out BI environment we are doing the same but i never use it PI.
    With Regards
    Sunil

    Sunil,
    You mentioned if i create custom OS command in SM49 and able to execute the same command from File adapter:
    I dont see any difference in calling this script from the file adapter. Put all the commands in the script and you can call the script directly from the file adapter.  What ever you can achieve from sm49 you can achieve the same from file adapter also.  I didnot work this practically, but I dont see you should run into any issues.
    Regards,
    ---Satish

  • "Open with External Editor" command bug?

    Seems to be a bug with "open with external editor" command. If I try it just after Aperture has been opened, it usually works (sometimes not). And then after a couple of photos being edited in photoshop, it sometimes stops working. When I try it, it simply gives me SBBOD for a few seconds (which it does when it's working as well), and then nothing happens. No new master created in Aperture, and nothing in Photoshop. If I restart the program, it usually takes care of the problem, and it will work again for a bit. Sometimes restarting the program doesn't even work, and I have to reboot. Very strange.
    Any one else getting this? Any ideas?
    I'm using 1.1.1 and Photoshop CS2.
    powerbook G4 1.5 Ghz   Mac OS X (10.4.6)   2 GB RAM, ATI Radeon 9700 (64MB VRAM), 80 GB ATA HD (5400rpm)

    Anyone out there? No one else experiencig this "bug"?
    Help, please.

  • Edit with external editor command in iPhoto

    I know there is a way to set IPhoto so you can use both iPhoto and PS Elements editors to edit photos.  I have seen the "*Edit with external editor*" command within the Edit header within iPhoto but can't figure out how to do this.  I found the below and tried it but it doesn't allow me to set two editors within Preferences.  What am I doing wrong?
    +"If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and select "Edit in external editor" in the Contextual menu). This way you get the best of both worlds"+
    Thanks,
    Scott

    FIRST set external editor to PSE
    THEN change the selection back (NOT TWO selections - just this one) edit in main window leaving PSE as the external editor
    once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window".
    +You are working VERY hard to make this dificult - *it is simple*+
    Set PSE as the external editor THEN select edit in main window as the default without changing PSE being the external editor - One selection - EDIT IN MAIL WINDOW
    NOW double clicking will edit in iPhoto -- Right clicking (or control clicking) will give you a contextual menu allowing you to choose PSE as the editor
    LN

  • EXTERNAL LINE COMMAND

    HI
    MY CUESTION IS: I CAN´T EXECUTE IN THE EXTERNAL LINE COMMAND THE RESPONSE IS THAT I´M NOT LOGIN BUT I´M LOGIN IN THE DATABASE AND I CAN EXECUTE COMMAND IN THE BROWSER BUT I WANT IN THE EXTERNAL...
    SOMEONE HELP ME PLEASE
    I WILL BACK
    Edited by: user12887371 on 01-abr-2010 1:13

    Please browse internet about Scheduled External Job this procedure can help you.

  • SM69 - external command

    Hi,
    My developer is asking for a unix "mv" command to move files from one location to another (after successful processing of that file).  The "mv" command will be coded in the ABAP.
    I'm using SM69 to create a "ZMV" external command so that it can be called within ABAP.
    Now, I would like to control the location of where the files are moved to. 
    Does anyone know how I can use the "Parameters for operating system command" & "Additional parameters" fields in SM69 to control the location?
    Or is there another approach to tackle this issue?
    Thanks in advance.

    Hello Sisab,
    It is simple. Keep parameters blank if you don't want any special parameters lie <i> etc. However addtional parameters is important.
    Basically the syntax of move command would be
    mv <original path> <new path>.
    This part <original path> <new path> needs to be specified into addtional parameters.
    However you to give complete path.
    This would do the job for you.
    With Regards.
    Ruchit.

  • SM69 (external operating system commands)

    how can i use the MKDIR dos command in SAP using SM69

    Here i am using LS command in SAP :
    data: begin of t_tabl occurs 0,
    line(132),
    end of t_tabl.
    data: lc_command(100) type c.
    start-of-selection.
    Get all the file name falling under specified directory...
    lc_command(3) = 'ls '.
    lc_command+3(45) = p_dir. " Directory of file path
    call 'SYSTEM' id 'COMMAND' field lc_command
    id 'TAB' field t_tabl-sys.
    Check any files exits in the directory.......................
    if t_tabl[] is initial.
    message e006 with 'No files exist in the specified directory ' p_dir.
    endif.
    You can use MKDIR instaed of LS
    Thanks
    Seshu

  • External OS command script in file adapter - return value check possible?

    Is it possible to check return value of external OS script execution which is called in the file adapter? We want to see the result in the adapter monitoring. The documentation says: "Message processing is independent of any errors that occur during the execution of a configured operating system command."

    Hi Sanjay ,
    Seems possible : Try this :
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Regards ,

  • Unable to execute external OS command in Sm49

    Hi All,
    I am trying to copy a file from another application server to BW application server.Below are the steps that I followed:
    1. Created a Batch file and placed it on the BW application server.Below is the contents of the flat file:
    xcopy
    MDHCLST01\mdhreports\lossreports\20080522_Comp.*
    WSAGLDWIVM76.aglcloud1.int\OUTPUT-SCS\
    2. I have created a command in sm49 to execute this batch file
    3. When i am trying to execute this command in sm49 it is giving me following error:
    E:\usr\sap\BSP\DVEBMGS30\work>xcopy
    MDHCLST01\mdhreports\lossreports\20080522_Comp.*
    WSAGLDWIVM76.aglcloud1.int\OUTPUT-SCS\                                                                                Invalid drive specification                                                                                0 File(s) opied                                                                                External program terminated with exit code 4
    When I executed this Batch file directly from application server it is copying the files but when I am executing the file in SM49
    it is giving me error.Please suggest me in this regard.
    Warm Regards,
    Nanduri Aditya

    Hello
    We will move this thread to the SAP NetWeaver BW forum. You will get a better response on that forum.
    Regards
    XI/PI Moderator

  • External system commands in java application

    I'm trying to run a molscript command in Unix, in a java application. I want to view a molscript graphic via the application. I have been using the following command
    Process p = Runtime.getRuntime().exec("molscript -opengl < " + file);
    Is this possible? Ihave ben able to run simple Unix commands such as 'ls' or 'dir' through the application but when I try a molscript command the error says
    java.io.IOException: molscript: not found
    Perhaps somebody could help me on this subject?

    The standard input redirection in:
    molscript -opengl <filenameis handled by the command interpreter, that is, one of the shells.
    "sh","-c","molscript -opengl <filename"

  • Execute External OS Command

    Hi Gurus,
      Im trying to execute a OS Command inside the file adapter.
      Its a .exe file which I have written. The exe file will take in 2 parameters.
      I entered this in the OS Command
      F:\test\run.exe test.xml output.txt
      However, it seems that the command is not be executed. Am I missing anything?
    Thanks in advance.

    Hi,
    Refer these blogs:
    Executing Unix shell script using Operating System Command in XI
    The specified item was not found.
    The specified item was not found.
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    Re: RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESING { Aashish Sinha }
    Its is better you write the code in the batch file (.bat) and call the batch file at runtime rather than using .exe file
    Regards,
    Nithiyanandam

  • Execute external java command line in Java

    But I can not get any result ( It does not create file test.svg) . the code is as follow
    Runtime.getRuntime().exec("java -jar c:/XSLT/saxon7.jar ../webapps/wfscontroller/gml.xml ../webapps/wfscontroller/SVG.xsl > ../webapps/wfscontroller/test.svg");
    If I execute "java -jar c:/XSLT/saxon7.jar ../webapps/wfscontroller/gml.xml ../webapps/wfscontroller/SVG.xsl > ../webapps/wfscontroller/test.svg" in DOS command. it works.
    Anybody knows what happened?
    Many thanks in advance.

    The > is interpreted by the shell. When you use Runtime.exec, you don't go through the shell, you exec the executable directory. So when you exec that command, you're passing ">" as an argument to "java -jar c:/...", and chances are the main() method in that doesn't interpret ">".
    So the upshot is you can't use ">", "|", "<", etc., that you can in a shell, with Runtime.exec().
    Other options are to run a batch file which invokes that command line.
    Or, you can get the standard output from the exec'ed process, and save it to a new file yourself.

  • Netctl, systemd and 'external' vpn command

    I am trying to use netctl to connect to a vpn (a microsoft vpn). The `pon` command works, but I would like to use netctl  to set up routing, dns, et cetera. I am confused about how netctl and systemd should work together, and I have not found  any documentation where this is explained in a way that I can  follow.
    What I did gather, is that netctl delegates vpn connections to systemd. This is the contents of      /etc/systemd/system/myvpn.service:
    [Unit]
    Description=myvpn connection
    [Service]
    Type=forking
    ExecStart=/usr/bin/pon
    PIDFile=/var/run/ppp0.pid
    Unclear to me is how I should set up an additional netctl file, and how that one should make use of, or, being used by,  the systemd-file.
    Pointers are very much appreciated!

    Could very well be possible that I've been on the wrong track 
    But I cannot make the pppoe-configuration to work.
    * Where would I put the `pon`-command? I have grepped the files of netctl, but the pon-command is not built in... 
    * Why would I need to put in username and password? That is already handled by my chaps-secret file, that is pointed to    via the OptionsFile...
    * And what should I choose for the Interface? If I give it the name ppp0 (what is being used by pon), netctl complains as follows:
    Interface 'ppp0' does not exist
    Anyway, here is my current config:
    $ grep -vE '^(#|$)' /etc/netctl/myvpn
    Description='Example PPPoE connection'
    Interface=ppp0
    Connection=pppoe
    User='myuser'
    Password='mypassword'
    PPUnit=0
    OptionsFile=/etc/ppp/peers/myvpn
    IP=dhcp
    ConnectionMode='persist'
    DefaultRoute=false
    UsePeerDNS=false
    $ cat /etc/ppp/peers/myvpn
    pty "pptp <ip-address> --nolaunchpppd"
    name myvpn
    remotename FW-ROADWAR
    require-mppe-128
    require-mschap
    file /etc/ppp/myvpn.options
    ipparam myvpn
    $ cat /etc/ppp/myvpn.options
    lock
    # debug
    name vpn
    noauth
    user myusername
    # mppe required,no40,no56
    refuse-eap
    lcp-echo-failure 30
    lcp-echo-interval 20
    idle 0
    defaultroute
    maxfail 1

  • Auto-Reaction Method - External Operating System Command

    Hello ,
    I am trying to run a script (test.cmd) on a monitored java system out of solution manager via ccms auto-reaction method, but without success.
    I have created a RFC Connection to the java system in transaction sm59, defined an external operation command in transaction sm69 (/usr/sap/test.cmd) and an auto-reaction method using that command. But when I test the command in transaction sm49 with the RFC connection as target destination, the command is executed on the local CEN system (SolutionManager system) instead of the monitored java system. I have no clue where's the problem???
    Thanks for any help (points, points, points)
    Mirko

    Hi Anand,
    can you please send me that doc too pleae.
    [email protected]
    I really appreciate your help.
    Thanks,

Maybe you are looking for

  • How do I move a project from an external drive back into Imovie

    I recently bought an Iomega external hard drive to store documentary movies so that I wouldn't jam up my Imac's free space. However, after I moved an imovie/idvd project to it, and wanted to make changes, I could not move the project back into the Im

  • Scope does not trigger

    Hello, I am trying to trigger a scope at a certain point. I have a test signal coming after a regular sinusoid. I want to measure the output when the test signal arrives. What happens is that when my test signal comes after 1 second the trigger works

  • Does Weblogic support SSL v3.1?

    The documentation for both Weblogic 9 and 10 refer to v3.0, but I cannot find any reference to 3.1. Does either version support SSL 3.1? Thanks, Doug

  • Import Receiving manually by using ROI  (using interface).

    Hi all, I'm trying to build a program about Receiving. I insert the data in  RCV_HEADERES_INTERFACE and RCV_TRANSACTIONS_INTERFACE after i commit the SQL. i execute Receiving Transaction Processor to process my data. the data in RCV_TRANSACTIONS_INTE

  • Opportunity Team - Opportunity Role

    Hi, We're trying to make the Opportunity Team RI > Opportunity Role field to be auto populated when a user is added, by having this default value: JoinFieldValue('<User>',[<UserId>], '<Division>') NOTE: We're using Division field from User record typ