<?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: Problem in SORT statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440182#M1648463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ jitu188 	thank man, your comment did not solve the problem but it definately lead me to the solution,&lt;/P&gt;&lt;P&gt;all i had to do was declare a string variable, transfer the value accross and then sort SOLVED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ AnupamPratapSingh 	as of my understanding there is no difference between LIKE and TYPE there are 100% same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think one is newer version and other one is classic i am not sure which one though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;correct me if i am wrong &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Dec 2011 04:47:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-26T04:47:53Z</dc:date>
    <item>
      <title>Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440179#M1648460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;I have this problem, I am trying to sort a internal table with the syntax after endselect statement and before read table statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT ITAB_SBOOK BY NAME&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name is a field in the table of type CHAR length 25 in actual table and here is how i am declaring name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;name LIKE stravelag-name&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the sort statement is not executing properly, names are being printed on the screen but they are not&lt;/P&gt;&lt;P&gt;being formated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can some one tell me whare am i wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator Message: Please use more descriptive subject line in future post.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Dec 25, 2011 7:55 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Dec 2011 14:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440179#M1648460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-25T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440180#M1648461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hisheeraz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use  " As text " addition of sort statement for sorting character strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls see this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_470/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_470/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jitendra soni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Dec 2011 17:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440180#M1648461</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-12-25T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440181#M1648462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use 'type' instead of 'like'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Dec 2011 21:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440181#M1648462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-25T21:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440182#M1648463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ jitu188 	thank man, your comment did not solve the problem but it definately lead me to the solution,&lt;/P&gt;&lt;P&gt;all i had to do was declare a string variable, transfer the value accross and then sort SOLVED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ AnupamPratapSingh 	as of my understanding there is no difference between LIKE and TYPE there are 100% same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think one is newer version and other one is classic i am not sure which one though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;correct me if i am wrong &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2011 04:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440182#M1648463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-26T04:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440183#M1648464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per my knowledge there is slight diff between type and like keywords&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;type&lt;/STRONG&gt; key refer the data type of a field where as &lt;STRONG&gt;like&lt;/STRONG&gt; key refer the reference of existing  internal table in this just refer the data types not content(data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:BEGIN OF ty_itab,&lt;/P&gt;&lt;P&gt;      matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;      matkl type mara-matkl,&lt;/P&gt;&lt;P&gt;      mbrsh type mara-mbrsh,&lt;/P&gt;&lt;P&gt;      ersda type mara-ersda,&lt;/P&gt;&lt;P&gt;  END OF ty_itab.&lt;/P&gt;&lt;P&gt;  data:itab type STANDARD TABLE OF ty_itab.&lt;/P&gt;&lt;P&gt;  data:wa_itab type ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; we want to create one more internal table with the existing structure  at this time  we will go through the &lt;STRONG&gt;like&lt;/STRONG&gt; keyword.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jtab like itab occurs 10.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also check the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  sort.
types:BEGIN OF ty_itab,
      matnr type mara-matnr,
      matkl type mara-matkl,
      mbrsh type mara-mbrsh,
      ersda type mara-ersda,
  END OF ty_itab.

 data:itab type STANDARD TABLE OF ty_itab.

  data:wa_itab type ty_itab.


  select matnr matkl mbrsh ersda from mara into wa_itab.

    APPEND wa_itab to itab.
ENDSELECT.

SORT itab by mbrsh.

write:/ 'matno',' mat group','industry sector','created on'.
loop at itab into wa_itab.

  write:/ wa_itab-matnr,wa_itab-matkl,wa_itab-mbrsh,wa_itab-ersda.

  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;sreenivas p&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2011 05:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440183#M1648464</guid>
      <dc:creator>sreenivas_pachva</dc:creator>
      <dc:date>2011-12-26T05:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in SORT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440184#M1648465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per my knowledge there is slight diff between type and like keywords&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;type&lt;/STRONG&gt; key refer the data type of a field where as &lt;STRONG&gt;like&lt;/STRONG&gt; key refer the reference of existing  internal table in this just refer the data types not content(data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:BEGIN OF ty_itab,&lt;/P&gt;&lt;P&gt;      matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;      matkl type mara-matkl,&lt;/P&gt;&lt;P&gt;      mbrsh type mara-mbrsh,&lt;/P&gt;&lt;P&gt;      ersda type mara-ersda,&lt;/P&gt;&lt;P&gt;  END OF ty_itab.&lt;/P&gt;&lt;P&gt;  data:itab type STANDARD TABLE OF ty_itab.&lt;/P&gt;&lt;P&gt;  data:wa_itab type ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; we want to create one more internal table with the existing structure  at this time  we will go through the &lt;STRONG&gt;like&lt;/STRONG&gt; keyword.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jtab like itab occurs 10.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also check the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  sort.
types:BEGIN OF ty_itab,
      matnr type mara-matnr,
      matkl type mara-matkl,
      mbrsh type mara-mbrsh,
      ersda type mara-ersda,
  END OF ty_itab.

 data:itab type STANDARD TABLE OF ty_itab.

  data:wa_itab type ty_itab.


  select matnr matkl mbrsh ersda from mara into wa_itab.

    APPEND wa_itab to itab.
ENDSELECT.

SORT itab by mbrsh.

write:/ 'matno',' mat group','industry sector','created on'.
loop at itab into wa_itab.

  write:/ wa_itab-matnr,wa_itab-matkl,wa_itab-mbrsh,wa_itab-ersda.

  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;sreenivas p&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2011 05:06:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-sort-statement/m-p/8440184#M1648465</guid>
      <dc:creator>sreenivas_pachva</dc:creator>
      <dc:date>2011-12-26T05:06:24Z</dc:date>
    </item>
  </channel>
</rss>

