<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tcode SM69 - External OS Command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605541#M1568757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like the .BAT file will be accessed online! If so try CL_GUI_FRONTEND_SERVICES=&amp;gt;EXECUTE instead of 'SXPG_COMMAND_EXECUTE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jan 2011 10:18:03 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2011-01-10T10:18:03Z</dc:date>
    <item>
      <title>Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605534#M1568750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help for tcode SM69&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do we access a BAT file from a directory path for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Program Files\Software_ABC\Deeper_folder\genxy.bat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Operating System = windows nt&lt;/P&gt;&lt;P&gt;Type = Customer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have no idea how to go about for the Operating System Command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm supposed to run it like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Program Files\Software_ABC\Deeper_folder\genxy.bat  "E:\usr\sap\EWD\DVEBMGS00\data\File_20110107114455.xml"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice? Appreciate it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jan 2011 13:06:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605534#M1568750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-08T13:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605535#M1568751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone can assist?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically how do we run the .bat file from a directory?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That .bat will then run to encrypt a xml file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jan 2011 06:47:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605535#M1568751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-09T06:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605536#M1568752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SM69 you have two fields for this.&lt;/P&gt;&lt;P&gt;In operating system command (obligatory) you put the actual command, this means the full path to your executable and the name of the executable, in your case : C:\Program Files\Software_ABC\Deeper_folder\genxy.bat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the field Parameters for operating system command (not obligatory) : you put all your arguments, in your case the XML file.&lt;/P&gt;&lt;P&gt;The parameters field can be left empty, when you then start the command you can still define another value, in your case another XML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OS commands defined in SM69 are always executed on the server, sometimes there is a misunderstanding on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you want to execute a .bat file that remains on another computer, example a simple workstation PC, you will need to use other SAP functionalities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wim Van den Wyngaert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jan 2011 11:48:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605536#M1568752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-09T11:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605537#M1568753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks but when I try to run it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm receiving &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'C:\Program' is not recognized as an internal or external command,                                                                                operable program or batch file.                                                                                External program terminated with exit code 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 09:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605537#M1568753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T09:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605538#M1568754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to execute the external command in online mode or in background mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS:You can't run external commands in online mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 10:09:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605538#M1568754</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-01-10T10:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605539#M1568755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that your command is truncated after the first blank.&lt;/P&gt;&lt;P&gt;I do not know the Windows world that much but did you try to put your command between double quotes ?&lt;/P&gt;&lt;P&gt;Example : "C:\Program Files\Software_ABC\Deeper_folder\genxy.bat"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wim Van den Wyngaert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 10:10:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605539#M1568755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T10:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605540#M1568756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hhm &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My program(web dynpro) will call it from a class which I have created. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So its like web dynpro &amp;gt; call a method from class &amp;gt; then method will execute FM SXPG_COMMAND_EXECUTE with the created External Command at SM69?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 10:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605540#M1568756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605541#M1568757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like the .BAT file will be accessed online! If so try CL_GUI_FRONTEND_SERVICES=&amp;gt;EXECUTE instead of 'SXPG_COMMAND_EXECUTE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 10:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605541#M1568757</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-01-10T10:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605542#M1568758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you create external command and pass command name in FM&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or u can use following way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 12:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605542#M1568758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T12:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode SM69 - External OS Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605543#M1568759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of using .bat extension use .xls or .xml bcoz in windows doesn't knw for which pgm the .bat file is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so using .xls would be easy and would get the output immediately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;akshay ruia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 12:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-sm69-external-os-command/m-p/7605543#M1568759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T12:44:05Z</dc:date>
    </item>
  </channel>
</rss>

