<?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: OS command chmod execution through ABAP issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852410#M1474547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sateesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax looks a bit off, I'd expect something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call 'SYSTEM' id 'COMMAND' field LC_CHMOD id 'TAB' field TABL-*SYS*.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For testing it might help to redirect the output (stdout, stderr and return code) of the command to a file to check later in AL11 the results (assuming that you don't sit next to the basis guy with access to the server and that the directory you're looking at is mapped in AL11). As far as I remember &lt;EM&gt;chmod&lt;/EM&gt; does not return any output, so your internal table should be empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in general let me add some further comments. When running OS commands you should always check with a basis person who has access to the server to see if they execute the command if it's working. In theory you might be trying to change the access for files for which you (or to be more precise the OS user running the SAP system) has no access. So apart from return code 0, you're saying the file permissions don't change? Are you using a correct file path?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the command returned a non-zero return code on OS level, but you don't see that, check OSS note [1155864 - Call 'SYSTEM' returns incorrect exit code on UNIX|https://service.sap.com/sap/support/notes/1328083], which might be applicable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your &lt;EM&gt;chmod&lt;/EM&gt; permissions of 777 seems really odd, I know it's valid, but seems rather unusual for example to mark text files as executable (are you sure that this is what you want to be doing?)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'd refrain from using an approach like &lt;EM&gt;call 'SYSTEM' id 'COMMAND'&lt;/EM&gt; and instead first investigate usage of [external commands|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/fa/0971e1543b11d1898e0000e8322d00/frameset.htm]. Be prepared to have some talk with your security folks, because in most cases the execution of system commands is locked down (for good reasons).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Apr 2010 07:41:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-27T07:41:30Z</dc:date>
    <item>
      <title>OS command chmod execution through ABAP issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852409#M1474546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an OS command execution through ABAP issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am  trying to change the file permissions using os command chmod execution &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'SYSTEM' id 'COMMAND' field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code goes like this .........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :w_ospath like w_target,&lt;/P&gt;&lt;P&gt;      lc_chmod like w_target.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tabl occurs 500,&lt;/P&gt;&lt;P&gt;        line(400),&lt;/P&gt;&lt;P&gt;      end of tabl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE w_target '/*.txt' into w_ospath.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE 'chmod 777 ' w_ospath&lt;/P&gt;&lt;P&gt;          INTO lc_chmod SEPARATED BY space.&lt;/P&gt;&lt;P&gt;        CALL 'SYSTEM' ID 'COMMAND' FIELD lc_chmod&lt;/P&gt;&lt;P&gt;        id 'TAB'     field tabl[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But nothing happening and return code is sy-subrc=0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sateesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 06:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852409#M1474546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T06:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: OS command chmod execution through ABAP issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852410#M1474547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sateesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax looks a bit off, I'd expect something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call 'SYSTEM' id 'COMMAND' field LC_CHMOD id 'TAB' field TABL-*SYS*.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For testing it might help to redirect the output (stdout, stderr and return code) of the command to a file to check later in AL11 the results (assuming that you don't sit next to the basis guy with access to the server and that the directory you're looking at is mapped in AL11). As far as I remember &lt;EM&gt;chmod&lt;/EM&gt; does not return any output, so your internal table should be empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in general let me add some further comments. When running OS commands you should always check with a basis person who has access to the server to see if they execute the command if it's working. In theory you might be trying to change the access for files for which you (or to be more precise the OS user running the SAP system) has no access. So apart from return code 0, you're saying the file permissions don't change? Are you using a correct file path?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the command returned a non-zero return code on OS level, but you don't see that, check OSS note [1155864 - Call 'SYSTEM' returns incorrect exit code on UNIX|https://service.sap.com/sap/support/notes/1328083], which might be applicable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your &lt;EM&gt;chmod&lt;/EM&gt; permissions of 777 seems really odd, I know it's valid, but seems rather unusual for example to mark text files as executable (are you sure that this is what you want to be doing?)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'd refrain from using an approach like &lt;EM&gt;call 'SYSTEM' id 'COMMAND'&lt;/EM&gt; and instead first investigate usage of [external commands|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/fa/0971e1543b11d1898e0000e8322d00/frameset.htm]. Be prepared to have some talk with your security folks, because in most cases the execution of system commands is locked down (for good reasons).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 07:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852410#M1474547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T07:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: OS command chmod execution through ABAP issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852411#M1474548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact i have got limited access to our server operating system in order to check the file attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to change the file permissions with my OS login and my file path is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But through ABAP i am not able change the attributes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sateesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:16:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/os-command-chmod-execution-through-abap-issue/m-p/6852411#M1474548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T13:16:50Z</dc:date>
    </item>
  </channel>
</rss>

