<?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: execute bat-files in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891675#M53494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the source of cl_gui_fronent_services-&amp;gt;execute, I see that command an parameters are simply concatenated and then transferred to a FM where they are then sent to the SAP GUI "as is":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
concatenate name space parameter into name separated by space.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you put the following debugging code at the start of  your batch file in order to test what's going on exactly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
echo &amp;gt;dump.txt Command line: {%*} 
set cnt=1
:loop
if 1%1==1 goto end
echo &amp;gt;&amp;gt;dump.txt Command line arg #%cnt%: {%1}
shift
set /a cnt=%cnt% + 1
goto loop
:end

rem Rest of batch file starts here.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2005 11:54:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-08T11:54:41Z</dc:date>
    <item>
      <title>execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891672#M53491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with the new method execute.&lt;/P&gt;&lt;P&gt;We have used gui_exec to run a bat-file with&lt;/P&gt;&lt;P&gt;&amp;gt; command   = c:\file.bat&lt;/P&gt;&lt;P&gt;&amp;gt; parameter = "c:\my file.txt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we do the same with the execute.&lt;/P&gt;&lt;P&gt;&amp;gt; application = c:\file.bat&lt;/P&gt;&lt;P&gt;&amp;gt; parameter   = "c:\my file.txt" &lt;/P&gt;&lt;P&gt;but this does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works without the quotes, when the path&lt;/P&gt;&lt;P&gt;has no blanks in it. But it's the user&lt;/P&gt;&lt;P&gt;how chose the path ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2005 10:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891672#M53491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-08T10:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891673#M53492</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;I suppose the problem isn't GUI_EXEC, but the batch-file. If I create a batch file like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
notpad %1
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and execute&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
GUI_EXEC with 
command = c:temptest.bat and 
parameter = "C:TEMPNEU TEXTDATEI.TXT" 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(first without, second with quotes), everything works fine...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps (please reward me if it does &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2005 10:44:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891673#M53492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-08T10:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891674#M53493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joerg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the gui_exec works, the problem is the new &lt;/P&gt;&lt;P&gt;cl_gui_frontend_services=&amp;gt;execute!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have also modify the batch with something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;notepad "%*"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this doesn't work with NT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have noticed this:&lt;/P&gt;&lt;P&gt;I can debug the batch-file when I call it like&lt;/P&gt;&lt;P&gt;this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_gui_frontend_services=&amp;gt;Execute&lt;/P&gt;&lt;P&gt; exporting&lt;/P&gt;&lt;P&gt;  application = c:\test.bat&lt;/P&gt;&lt;P&gt;  parameter   = 'c:\te st.txt'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  parameter   = c:\te st.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the dos-window close immediatly without&lt;/P&gt;&lt;P&gt;showing anything when I use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  parameter   = "c:\te st.txt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2005 11:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891674#M53493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-08T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891675#M53494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the source of cl_gui_fronent_services-&amp;gt;execute, I see that command an parameters are simply concatenated and then transferred to a FM where they are then sent to the SAP GUI "as is":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
concatenate name space parameter into name separated by space.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you put the following debugging code at the start of  your batch file in order to test what's going on exactly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
echo &amp;gt;dump.txt Command line: {%*} 
set cnt=1
:loop
if 1%1==1 goto end
echo &amp;gt;&amp;gt;dump.txt Command line arg #%cnt%: {%1}
shift
set /a cnt=%cnt% + 1
goto loop
:end

rem Rest of batch file starts here.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2005 11:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891675#M53494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-08T11:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891676#M53495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joerg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the debugging code for the batch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done a lot of tests with NT and XP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************&lt;/P&gt;&lt;P&gt;      para = l_parameter.&lt;/P&gt;&lt;P&gt;      com  = l_application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CALL FUNCTION 'GUI_EXEC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   COMMAND          = com&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PARAMETER        = para.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;EXECUTE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    APPLICATION            = l_application&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    PARAMETER              = l_parameter.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Testing with NT&lt;/P&gt;&lt;P&gt;With the GUI_EXEC I get the file dump.txt with:&lt;/P&gt;&lt;P&gt; Command line: { "D:\test mit leer\mit_.txt"} &lt;/P&gt;&lt;P&gt; Command line arg #1: {"D:\test mit leer\mit_.txt"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same with EXECUTE: there is no dump.txt-file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Testing with XP:&lt;/P&gt;&lt;P&gt;both the GUI_EXEC and the EXECUTE are writing&lt;/P&gt;&lt;P&gt;the dump.txt-file with the same content as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problem is only with NT and there are &lt;/P&gt;&lt;P&gt;only a few with it left. They have to use path&lt;/P&gt;&lt;P&gt;without blank or use XP ...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2005 10:40:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891676#M53495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-11T10:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: execute bat-files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891677#M53496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you mind closing this thread?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2005 07:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-bat-files/m-p/891677#M53496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-12T07:29:26Z</dc:date>
    </item>
  </channel>
</rss>

