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

Similar Messages

  • 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

  • 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.

  • Re: Error while Execute External Operating System Command using T.code SM49

    Dear Experts,
    I Have uploaded one .exe file in the application server (eg: sum.exe) and created the OS command in SM69 transaction .
    And maintained the application server path in the 'operating system command' field in SM69 t.code.
    Our SAP system, oprating system is UNIX.
    After I have executed the external command using transaction SM49 , but I got the below error.
    Can not execute external program (permission denied) , External program terminated with exit code 1
    Immediately I run the SU53 transaction code to check the authorization, but Authorization was successful.
    Could any one please help on this error.
    Thanks in advance.

    >>Can not execute external program (permission denied) , External program terminated with exit code 1
    You need to give the permission as 755 to your file.
    >>I Have uploaded one .exe file in the application server (eg: sum.exe)
    You are on UNIX and do not expect to any result of .exe file as UNIX doesn't know about this.

  • Problem executing external command in OS400

    Hi,
    When i try to run an external os command from SM49, i am getting the following message, but ideally the message should display, job has been sent.
    Can anyone one help this out.
    Command executed:       sbmjob : CMD(CALL PGM(SEAEDIPGM/EDISLCCL)) JOB(SsIN) JOBD(G3X0DTASEA/GENTRAN) JOBQ(SEAEDIPGM/SAPSEAEDI)
                            outq(jobd) user(rkey) INLLIBL(JOBD) :
    Target host:            R3SDSNAB
    sapxpg: executing "sbmjob".
                Program output follows
          Spooled Files:
    (no spooled files)
          Joblog:
    <CPC1221> Job 589241/P0662/R3_62 submitted to job queue R3_62 in library R3P06400.
    <CPC2206> Ownership of object JLQMHLJOBL in QTEMP type *USRSPC changed.
                Program output ends
    sapxpg: Program "sbmjob"returned 0.
    Thanks,
    Sailesh K

    Hi Sailesh,
    did you patch SAPXPG & SAPCMD "up to the roof" ?
    Regards
    Volker Gueldenpfennig, consolut.gmbh
    http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de

  • Executing external command and program in background

    Hi,
    how to execute external command and external program in background.
    please provide me some tips on the same.
    while creating external command, what is the significance of "operating system command" and "parameters for operating system command".
    Thanks,
    Dinesh.

    Hi,
    You can define external commands using transaction code SM69.
    External commands are commands which would be executed at your operating 
    system with or without parameters.
    Operating system commands are those which you execute at OS level like
    mkdir, cat, rm, cp, ls
    Parameters are options that you add to os commands to get more functionalities.
    like, < ls -l > : will give you a long listing of files where " l " is the parameter
            < ls -lt > : will give you a long listing with last changed file at top where " lt " is the parameter.
    You can mention these in SM69 when you define the external commands.
    Now, in order to execute these in your background job. In the steps click on "external command" and give your command name in SM36 while creating your job.
    " Points for solution ".
    Thanks and Regards,
    Sandeep.

  • Error 801 when executing external command on

    Hello,
    I have installed CCMS agents and CCMS ping in my system yesterday. And activated the CPH BGD jobs for SL reporting purpse. Now I am getting an error "Error 801 when executing external command on" under class LC 2. I am not able to find any relevant note or help for this error. Any idea why this happens? How can I solve this? The details as follows:
    EXTERNAL COMMAND: rc = Error 801
    SXPG_COMMAND_EXECUTE(LONG):
    <timestamp>: 20100310144206
    COMMANDNAME: PING
    ADDITIONAL_PARAMETERS: s-sapcae
    LONG_PARAMS:
    OPERATINGSYSTEM: AIX
    TARGETSYSTEM: sapasmc1
    DESTINATION:
    SY-SUBRC:  801
    Regards,
    Rajeev

    Hi,
    I have activated the trace level to 3 and now I get some messages in dev_cp which is as follows:
    Trace file of control program (trace level 3)
    < Function: BtcTrcInit> Function: main  SAPXPG 720
    2010-03-11  08-52-09 : Before BtcXpgDetach
      > Function: BtcXpgDetach  < Function: BtcXpgDetach  Accept RFC connection from R/3 system
    2010-03-11  08-52-09 : Before RfcAccept
    2010-03-11  08-52-09 : RfcAccept returned OK
    Begin of check_if_security_list
    security check switched OFF
    End of check_if_security_list
    Begin of check_trace_option
    End of check_trace_option
      Install RFC call SAPXPG_START_XPG
      Install RFC call SAPXPG_START_XPG_LONG
      Install RFC call SAPXPG_END_XPG
      Wait for RFC call SAPXPG_START_XPG or SAPXPG_START_XPG_LONG
    2010-03-11  08-52-09 : Before first call of RFCDispatch
    Security: rfcexec_logon_check
      rfcexec_logon_check: logon_user = TT4WNUC
      sapxpg_logon_check: rfc_attr.user = TT4WNUC
      rfcexec_logon_check: client = 100
    2010-03-11  08-52-09 : After first call of RFCDispatch
    2010-03-11  08-52-09 : Before call of RfcClose (sequencing error)
    2010-03-11  08-52-09 : After call of RfcClose (sequencing error)
    < Function: main
    2010-03-11  08-52-09 : End of SAPXPG: main
    I think the issue is with the user TT4WNUC. Could you please let me know from where I can change this user?
    Rajeev

  • Sm_SolmanSID error 503 when executing external command

    Hello,
    On one of my managed system (my productive ECC),
    I have the following error ,everyday at 20:00,
    for the user SM_SolamnSID.
    "Error 503 when executing external command on (xpgid=0,convid=.)"
    The role ZSAP_SOLMAN_READ has been given to this user.
    Could you tell me what I should perform to avoid this problem?
    Regards,

    Hi Benoit,
    Pls refer below threads for external error of 503,
    Cannot run SM69 external commands from application server
    Cannot run SM69 external commands from application server,&amp;nbsp;SM21&amp;nbsp;|&amp;nbsp;ABAP,&amp;nbsp;SAP,&amp;nbs…
    Regards
    K.N

  • Error 801 when executing external command

    Dear all,
    One of our PRODcution system (PI) system getting lot of  below error in SM21.
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.)
    OS : HP-UX , DB : Oracle and sapnetweaver2004s
    Kindly advise and let me know what should i check SM49 ?
    Thanks
    Edited by: satheesh0812 on Aug 18, 2011 4:37 PM

    Hi,
    Perhaps the steps and solution in this thread could help.:
    Error 801 when executing external command on
    Regards,
    Srikishan

  • LC  2 Error 1003 when executing external command brconnect on (xpgid=0,con

    Dear all,
    I am getting error in sm21.Please suggest .
    Details Page 2 Line 23 System Log: Local Analysis of clusa                    1
    Time     Type Nr  Clt User TCode Grp N Text
    10:00:32 DIA  000 600 DDIC       LC  2 Error 1003 when executing external command brconnect on (xpgid=0,convid=.)
    Error 1003 when executing external command brconnect on (xpgid=0,convid=.)
    Details
    Recording at local and central time........................ 10.05.2010 10:00:32
    Task...... Process                     User...... Terminal Session TCode Program  Cl Problem cl      Package
    06952      Dialog work process No. 000 DDIC                      1       SAPMSSY1 S  Operation Trace SBTC
    No documentation for syslog message LC 2 exists
    Parameter
      1 .... xpgid=0,convid=.
    Technical details
    File Offset RecFm System log Grp N variable message data
      224 260640                  LC  2 brconnect & &Error 1003 & & &
    Regards,
    Kumar

    Dear Juan,
    Please find the logs.Please suggest.
    dev_cp log
    Trace file of control program (trace level 3)
    < Function: BtcTrcInit> Function: main  SAPXPG 720
    2010-05-10--09-33-29 : Before BtcXpgDetach
      > Function: BtcXpgDetach  < Function: BtcXpgDetach  Accept RFC connection from R/3 system
    2010-05-10--09-33-29 : Before RfcAccept
    2010-05-10--09-33-29 : RfcAccept returned OK
    Begin of check_if_security_list
    security check switched OFF
    End of check_if_security_list
    Begin of check_trace_option
    End of check_trace_option
      Install RFC call SAPXPG_START_XPG
      Install RFC call SAPXPG_START_XPG_LONG
      Install RFC call SAPXPG_END_XPG
      Wait for RFC call SAPXPG_START_XPG or SAPXPG_START_XPG_LONG
    2010-05-10--09-33-29 : Before first call of RFCDispatch
    Security: rfcexec_logon_check
      rfcexec_logon_check: logon_user =
      sapxpg_logon_check: rfc_attr.user = BASIS      
      rfcexec_logon_check: client =   
      > Function: BtcXpgStartXpgLong   
    2010-05-10--09-33-29 : Beginning of BtcXpgStartXpgLong
        > Function: BtcXpgStartXpgImportLong      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgParam      < Function: BtcXpgParam      > Function: BtcXpgTable      < Function: BtcXpgTable    < Function: BtcXpgStartXpgImportLong   
    BtcXpgStartXpgLong: special_trace_flag = <6>
        > Function: BtcXpgStartXpgInt      > Function: BtcXpgItTransfer        Content of source log table:
              Line  Text
              <No StdOut/StdErr output reported>
            Target log table is not identical to source
            ItGetLine terminated with NULL
          < Function: BtcXpgItTransfer      > Function: BtcTrcReset      < Function: BtcTrcReset      Call mode: VIA RFC
          Input arguments of BtcXpgStartXpg:
            External program: brtools
          tracecntl = : 6
          Display of Parameter string switched off !!
            Contents of control flags:
              StdIn control flag: redirect StdIn
              StdOut control flag: store StdOut output in memory
              StdErr control flag: store StdErr output in memory
              Trace control flag: unknown contents
              Termination control flag: control program will wait for termination
          > Function: BtcXpgCheck        > Function: BtcXpgArgv
              parameter number 1:
              parameter number 2:
              parameter number 3:
              parameter number 4:
              parameter number 5:
              parameter number 6:
              parameter number 7:
              Total number of arguments scanned: 7
              Argument argv[0]: brtools
            < Function: BtcXpgArgv      < Function: BtcXpgCheck      > Function: BtcXpgSigInst      < Function: BtcXpgSigInst      > Function: BtcXpgStart        Rearrange stderr to be collected in memory
            Rearrange stdout to be collected in memory
            Redirect stdin, read from NUL:
            > Function: BtcTrcInit< Function: BtcXpgStartStart status of external program: external program successfully started
    Id of external process: 0000005296
    StdOut/StdErr collected in memory
      Line  Text
      <No StdOut/StdErr output reported>
    < Function: BtcXpgStartXpgInt> Function: BtcXpgStartXpgExport  > Function: BtcXpgParam  < Function: BtcXpgParam  > Function: BtcXpgParam  < Function: BtcXpgParam  > Function: BtcXpgParam  < Function: BtcXpgParam< Function: BtcXpgStartXpgExport
    2010-05-10--09-33-29 : End of BtcXpgStartXpgLong
    < Function: BtcXpgStartXpgLong
    2010-05-10--09-33-29 : After first call of RFCDispatch
    Wait for RFC call SAPXPG_END_XPG
    2010-05-10--09-33-29 : Before second call of RFCDispatch
    Security: rfcexec_logon_check
    rfcexec_logon_check: logon_user =
    sapxpg_logon_check: rfc_attr.user = BASIS      
    rfcexec_logon_check: client =
    > Function: BtcXpgEndXpg 
    2010-05-10--09-33-29 : Beginning of BtcXpgEndXpg
      > Function: BtcXpgStartXpgExport    > Function: BtcXpgTable    < Function: BtcXpgTable  < Function: BtcXpgEndXpgImport  > Function: BtcXpgEndXpgInt    > Function: BtcXpgItTransfer      Content of source log table:
            Line  Text
            <No StdOut/StdErr output reported>
          Target log table is not identical to source
          ItGetLine terminated with NULL
        < Function: BtcXpgItTransfer    > Function: BtcXpgReadChild      Output of external command not written to log !!
          Process executing external program has terminated
        < Function: BtcXpgReadChild    > Function: BtcXpgEnd    < Function: BtcXpgEnd    Termination status of external program: no errors reported
        StdOut/StdErr collected in memory
      < Function: BtcXpgEndXpgInt  > Function: BtcXpgEndXpgExport    > Function: BtcXpgParam    < Function: BtcXpgParam    > Function: BtcXpgParam    < Function: BtcXpgParam  < Function: BtcXpgEndXpgExport 
    2010-05-10--09-33-30 : End of BtcXpgEndXpg
    < Function: BtcXpgEndXpg
    2010-05-10--09-33-30 : After second call of RFCDispatch
    2010-05-10--09-33-30 : After call of RfcClose (wait)
    < Function: main
    2010-05-10--09-33-30 : End of SAPXPG: main
    dev_xpg
    Trace file of External Program (trace level 3)
    < Function: BtcTrcInit> Function: BtcXpgStart  External program: brtools -sid prd -F printout alert_log 20100401000000 0128
    Regards,
    Kumar

  • Error1006 when executing external command mv ...

    This error concerns one of the several daily batch most critical. It was not detected before because even if there is an error the program won't never fail (we will review for sure this program).
    The error appears at the call of an external command ZRENAME that corresponds to the OS command "mv" to rename a physical file on directory /interface.
    This error seems corresponds to a timeout when the SAP system tries to call the mv command on the OS level ...
    ERROR:
    Time          Type      Nr       Clt      User            TCode      Priority      Grp      N      Text                                                                               
    12:00:51      BTC       034      120      BUSER_HK20                           LC       2      *Error1006 when executing external command mv on %_TCPIP_%1 (in=R,out=M,err=M,trc=0,trm=C. strtstat=,xpgid=0,convid=. msg:timeout during a)*
    Thanks in advance for help

    Hello
    Check note #1406178 Error 1006 occurs when you execute an external
    Regards
    Mark

  • Executing external commands

    I am trying to write a small program that will execute an external DOS command (net send). What is the proper format for that? Help!
    Tony

    Tony,
    Did you try searching this forum's archives before posting this question?
    Have you read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Hope this helps.
    Good Luck,
    Avi.

  • To execute external command using   RFC_REMOTE_exec

    Hi
    i want to execute the ext command using RFC_REMOTE_EXEC .
    i have used like below in WINDOWS XP:
    data: v_cmnd(120) type C VALUE 'dir C:\SAP\rfcsdk\bin >RFEXEC -D ESM_R'.
    call function 'RFC_REMOTE_EXEC' destination D_DESTI
    exporting
    command = v_cmnd
    exceptions
    system_failure = 1 message D_ERMSG
    communication_failure = 2 message D_ERMSG.
    manually at command line the program getting registerd but
    not throuergh RFC_REMOTE_EXEC 
    in v_cmnd  what is the exact value we have to give
    Regards

    you create the command in SM69 with some name and Directly give the Same name when you are executing.
    Check this Function also.
    SXPG_COMMAND_EXECUTE

  • How can I execute external application?

    Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.
    I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?
    Thanks
    Mehmet
    P.S. I have been writing this message with details may be somebody can give me a simple way for this

    Well, I can suggest you following steps. May be it works for you .
    -Create an external OS command in SM69
    -Test OS command in SM49 ( <u><i>about OS command if you search in SDN you’ll get lot of material</i></u> )
    -Create a Script at your OS level, I’m assuming you might have some UNIX flavor or Sun solaria’s.
    -Create a Shell script , which execute the printer job from OS .
    -Shell script will have parameters . ( e.g. printer name, destination etc )
    -set the path of shell script directory in SM69 ( the command you just created )
    -Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )
    In the ABAP  program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .
    FYI
    For UNIX script, if you search in www.google.com ( UNIX forums) . you’ll get shell script .
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • 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

Maybe you are looking for

  • Problem remove in -master-detail  JBO-(27101)

    Hello everybody i have a problem with master detail ,i made application module that contains in his data model 2 view object , the master is 'typeVO' and under this is the detail "productVO" ,when i run the application module and create new product u

  • Can not use gb2312 charset in mysql!

    I just come from Mandrake Linux. And my MYSQL database's date in Mandrake has been output to a .sql file. When in input the .sql file in to MYSQL of Arch using phpmyadmin, the GB2312 char becom ?????????? Oh..... I have set the gb2312 char in httpd.c

  • 6233 HELP NEEDED!!.... Email / Multi-Media Messagi...

    Can someone pleeease tell me if/how you can send a picture from the phone to an email address?? It worked like a dream on my old phone (6230i) ??? And failing that.. how on earth do you send an email from this phone?? Thank you

  • Trying to create 3 schemas from one schema

    DB version : 11.2.0.2 Enterprise Edition Platform : RHEL 5.6 I have an expdp dump of a schema (HRTB_AP_PROD). I wanted to create 3 schemas from this dump in one go. So i tried this ## The parfile I used DIRECTORY=DPUMP_DIR DUMPFILE=HRTB_AP_PROD%u.dmp

  • 10.5.1 add to library file corruption?

    I manually download podcasts to my desktop with Safari and then use itunes' add to library with 'copy files to itunes folder' feature to import them from there. Since October, using 10.5 or 10.5.1 (not sure when problem started) every mp3 added in th