<?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: Unix command not working properly in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765380#M1305562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the way you suggested. But, it is still not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sy-subrc value is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2009 09:39:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-22T09:39:14Z</dc:date>
    <item>
      <title>Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765377#M1305559</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 am using Unix command to concatenate all the child files into one target file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the child filenames in one internal table. So, I am looping on that table and concatenating each file with the target file in each iteration as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT t_childjobs_files INTO e_childjobs_files.

    CONDENSE e_childjobs_files-file.

    OPEN DATASET e_childjobs_files-file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

    IF sy-subrc EQ 0.

*Command to concatenate the child file into main file
      CONCATENATE 'cat '
                  e_childjobs_files-file
                  ' &amp;gt;&amp;gt; '
                  p_file
             INTO w_command
RESPECTING BLANKS.

      CONDENSE w_command.

      CALL 'SYSTEM' ID 'COMMAND' FIELD w_command.

      MESSAGE s025 WITH sy-subrc.

      DELETE DATASET e_childjobs_files-file.

    ENDIF.

    CLEAR: w_command,
           e_childjobs_files.

  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, the above piece of code is working fine only in debugging mode, but not in foreground/background mode. Also, the sy-subrc value of the ABAP statement which processes the unix command is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know what could be the problem? It looks strange for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 09:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765377#M1305559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T09:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765378#M1305560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;replace the below code with &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL 'SYSTEM' ID 'COMMAND' FIELD w_command.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below code.&lt;/P&gt;&lt;P&gt;Check the it_return what is the message you are getting, instead of sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of it_return occurs 0,
        line(400),
      end of it_return.

  call 'SYSTEM' id 'COMMAND' field w_command
                id 'TAB'    field  it_return[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 09:24:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765378#M1305560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T09:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765379#M1305561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I once solved the problem by defining the command in SM69 and execute it in my report with fm SXPG_COMMAND_EXECUTE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 09:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765379#M1305561</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2009-06-22T09:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765380#M1305562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the way you suggested. But, it is still not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sy-subrc value is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 09:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765380#M1305562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T09:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765381#M1305563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is Unix command is getting executed properly. But, as I am deleting the file in the next step, the OS is not able to find the file and hence the results are nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I removed the Delete statement and it is working fine. But, the problem is how would I know that the merging of the files is done completely?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On what basis would I know that it has finished off copying the complete source file into the target file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 03:35:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765381#M1305563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T03:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765382#M1305564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;call 'SYSTEM' id 'COMMAND' field w_command
                id 'TAB'    field  it_return[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the it_return, First try to see what is there inside that ( Don't depend on Sy-subrc )&lt;/P&gt;&lt;P&gt;Success or failure you can get the complete information inside the it_return.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 04:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765382#M1305564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T04:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765383#M1305565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call 'SYSTEM' id 'COMMAND' field w_command
                id 'TAB'    field  it_return[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the command is getting executed, but it_return[] has nothing in it.&lt;/P&gt;&lt;P&gt;It is INITIIAL.It has no records...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that mean we will always have to use it as per above statement ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question here is, I have seen few more example which has code written in the following way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call 'SYSTEM' id 'COMMAND' field w_command
                id 'TAB'    field  it_return-*sys*.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does &lt;STRONG&gt;sys&lt;/STRONG&gt; mean? Also when you declare it using the above statement the internal table should always be of type with header line. But, internal table declaration with header line is obsolete in ECC6.0 right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me some hints or suggestions on this? Also, I have not got F1 help on these commands.&lt;/P&gt;&lt;P&gt;I tried to search in SDN to get good blogs/stuff. But, I couldnt find any. If you have some pointers please &lt;/P&gt;&lt;P&gt;post the same. Will be helpful for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 04:45:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765383#M1305565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T04:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unix command not working properly</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765384#M1305566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just provided the sample. for ECC environment you need to declare with out header.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types: begin of t_return ,
        line(400),
      end of t_return.

 data: it_return type STANDARD TABLE OF t_return.

  call 'SYSTEM' id 'COMMAND' field w_command
                id 'TAB'    field  it_return.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_return-&lt;STRONG&gt;sys&lt;/STRONG&gt; considers the body of the internal table incase of internal table declared with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_return-&lt;STRONG&gt;sys&lt;/STRONG&gt;   is equivalent to it_return[] ( when you declare internal table with header line ) &lt;STRONG&gt;or&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;it_return-&lt;STRONG&gt;sys&lt;/STRONG&gt;   is equivalent to   it_return ( when you declare the internal table with out header line).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 09:15:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unix-command-not-working-properly/m-p/5765384#M1305566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T09:15:20Z</dc:date>
    </item>
  </channel>
</rss>

