<?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: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821360#M1128296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg Kern,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs.&lt;/P&gt;&lt;P&gt;I will try this by entering in system commands thru sm69.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am closing this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Nov 2008 10:34:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-25T10:34:13Z</dc:date>
    <item>
      <title>return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821354#M1128290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As part of an interface implementation, i need to create and delete directories.&lt;/P&gt;&lt;P&gt;I am using the following method to create directory on our Unix sap server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*to create directory
  CONCATENATE
  'mkdir'
  LV_DIR
  INTO UNIXCOM
  SEPARATED BY SPACE.

  CALL 'SYSTEM' ID 'COMMAND' FIELD UNIXCOM
                ID 'TAB'     FIELD TABL[].
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting sy-subrc = -1 but directory is created. Same is the case with Delete directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to ensure whether directory is created or not from sy-subrc?&lt;/P&gt;&lt;P&gt;I think ideally i should get sy-subrc = 0, but why am i getting -1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls help to resolve this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 10:52:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821354#M1128290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T10:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821355#M1128291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;  'mkdir'&lt;/P&gt;&lt;P&gt;  LV_DIR&lt;/P&gt;&lt;P&gt;  INTO UNIXCOM&lt;/P&gt;&lt;P&gt;  SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL 'SYSTEM' ID 'COMMAND' FIELD UNIXCOM&lt;/P&gt;&lt;P&gt;                ID 'TAB'     FIELD TABL[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Loop and write the contents og the internal table that should help you.&lt;/P&gt;&lt;P&gt;loop at itabl.&lt;/P&gt;&lt;P&gt;write/:itabl-line.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 12:01:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821355#M1128291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T12:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821356#M1128292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contents of the table is empty.&lt;/P&gt;&lt;P&gt;This will be run in the background, so i would not know and will not be able to decide on the contents of the retuned Internal table TABL[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am i supposed to get sy-subrc = 0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 12:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821356#M1128292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T12:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821357#M1128293</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 think that we ran into this situation during an upgrade.   The sy-subrc used to be 0 if &lt;/P&gt;&lt;P&gt;successful and then after the upgrade it changed to -1.&lt;/P&gt;&lt;P&gt;The command was always successful even though the return code was -1 and the &lt;/P&gt;&lt;P&gt;return table was always empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way to do this is to create OS commands in SM69 and thne execute them with the&lt;/P&gt;&lt;P&gt;FM: SXPG_COMMAND_EXECUTE.  If you do this you avoid using a 'feature' that is not&lt;/P&gt;&lt;P&gt;offically supported by SAP ( is CALL SYSTEM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Greg Kern&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 17:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821357#M1128293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T17:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821358#M1128294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg Kern,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs. Points noted, but what could be the reason for this change?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But can i take sy-subrc = -1 as success always?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 04:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821358#M1128294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T04:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821359#M1128295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Simha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We did assume that -1 was a successful return from the call system.  However, since&lt;/P&gt;&lt;P&gt;we could not assume that this would not change in the future we worked at converting&lt;/P&gt;&lt;P&gt;the call systems to call  fm sxpg*.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for a reason, the call system method is not officaily supported by SAP so then can &lt;/P&gt;&lt;P&gt;change whatever they want to with no notice or explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Greg Kern&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 17:52:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821359#M1128295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T17:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821360#M1128296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg Kern,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs.&lt;/P&gt;&lt;P&gt;I will try this by entering in system commands thru sm69.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am closing this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 10:34:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821360#M1128296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T10:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821361#M1128297</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I am getting return code 2 for my command. I am trying to decrypt a file using linux command. What does the return code 2 mean? I didn't find anything on SAP help yet.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Avinash Vaishya&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821361#M1128297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-06-21T19:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: return code - CALL 'SYSTEM' ID 'COMMAND' FIELD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821362#M1128298</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/688556/avinashvaishya.html"&gt;Avinash Vaishya&lt;/A&gt; it's normal that you don't find anything on SAP help because all C programs are undocumented and you shouldn't call them. Instead of CALL 'SYSTEM', you should use the official and documented way: define your OS command (mkdir or whatever you want) via transaction code SM49, and call it via the function module SXPG_COMMAND_EXECUTE (documentation supplied within the function module itself).&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 09:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-code-call-system-id-command-field/m-p/4821362#M1128298</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-06-22T09:25:34Z</dc:date>
    </item>
  </channel>
</rss>

