<?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: Issues using FM - SXPG_COMMAND_EXECUTE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681491#M1291410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The FM seems to be fine. Please try to execute th FM directly from SE37. There are sometimes few authorization issue when this FM is called. Check out what exception the FM is throwing and try to investigate it around that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If FM gets executed correctly then check in debug mode that variable Z_DIR is getting correct value. make sure that variable Z_DIR should be of type "sxpgcolist-parameters".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 May 2009 06:08:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-25T06:08:13Z</dc:date>
    <item>
      <title>Issues using FM - SXPG_COMMAND_EXECUTE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681490#M1291409</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 have a requirement to create a unique folder in the SAP Application server based on the Production Order number and to dump certain files into this folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no issues creating the contents of the file, but am having issues creating the folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is how I am trying to acheive what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;z_dir =  '/sapfiles/200/machinefiles/laser/&amp;amp;order/'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REPLACE '&amp;amp;order' WITH z_char7 INTO z_dir.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where Z_char7 is the Production Order number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SM69, I have created an Operating System Command with &lt;/P&gt;&lt;P&gt;Command Name = ZTEST&lt;/P&gt;&lt;P&gt;Operating System Command = mkdir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I test this using additional parameters as /sapfiles/200/machinefiles/laser/1111 [for example], the folder is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program, I use the FM SXPG_COMMAND_EXECUTE to execute my ZTEST operating system command name with the below parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    COMMANDNAME                                =    'ZTEST'&lt;/P&gt;&lt;P&gt;    ADDITIONAL_PARAMETERS                =    z_dir&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OPERATINGSYSTEM                         = SY-OPSYS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TARGETSYSTEM                             = SY-HOST&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DESTINATION                         =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STDOUT                              = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STDERR                              = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TERMINATIONWAIT                     = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TRACE                               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DIALOG                              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STATUS                              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXITCODE                            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXEC_PROTOCOL                       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   NO_PERMISSION                       = 1&lt;/P&gt;&lt;P&gt;   COMMAND_NOT_FOUND                   = 2&lt;/P&gt;&lt;P&gt;   PARAMETERS_TOO_LONG                 = 3&lt;/P&gt;&lt;P&gt;   SECURITY_RISK                       = 4&lt;/P&gt;&lt;P&gt;   WRONG_CHECK_CALL_INTERFACE          = 5&lt;/P&gt;&lt;P&gt;   PROGRAM_START_ERROR                 = 6&lt;/P&gt;&lt;P&gt;   PROGRAM_TERMINATION_ERROR           = 7&lt;/P&gt;&lt;P&gt;   X_ERROR                             = 8&lt;/P&gt;&lt;P&gt;   PARAMETER_EXPECTED                  = 9&lt;/P&gt;&lt;P&gt;   TOO_MANY_PARAMETERS                 = 10&lt;/P&gt;&lt;P&gt;   ILLEGAL_COMMAND                     = 11&lt;/P&gt;&lt;P&gt;   WRONG_ASYNCHRONOUS_PARAMETERS       = 12&lt;/P&gt;&lt;P&gt;   CANT_ENQ_TBTCO_ENTRY                = 13&lt;/P&gt;&lt;P&gt;   JOBCOUNT_GENERATION_ERROR           = 14&lt;/P&gt;&lt;P&gt;   OTHERS                              = 15&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above FM in my program doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know if I am missing anything or direct me to any other suitable method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 05:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681490#M1291409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T05:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issues using FM - SXPG_COMMAND_EXECUTE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681491#M1291410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The FM seems to be fine. Please try to execute th FM directly from SE37. There are sometimes few authorization issue when this FM is called. Check out what exception the FM is throwing and try to investigate it around that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If FM gets executed correctly then check in debug mode that variable Z_DIR is getting correct value. make sure that variable Z_DIR should be of type "sxpgcolist-parameters".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 06:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681491#M1291410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T06:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issues using FM - SXPG_COMMAND_EXECUTE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681492#M1291411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Richa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable z_dir had the wrong type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 06:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-using-fm-sxpg-command-execute/m-p/5681492#M1291411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T06:26:27Z</dc:date>
    </item>
  </channel>
</rss>

