<?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 ALV sorting for 2 fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589295#M1274239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ,&lt;/P&gt;&lt;P&gt;SORTING issue in ALV GRID,i kept code for sorting on material so material displays only once for all that particular line items, now the plant also should display only once for that materail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I AM getting the output as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATERIAL PLANT     TEXT&lt;/P&gt;&lt;P&gt;1231245	1000	# OF RINGS &lt;/P&gt;&lt;P&gt;56784901	1000	CENTERS (&lt;/P&gt;&lt;P&gt;	1000	BLACK MAT'L.&lt;/P&gt;&lt;P&gt;	1000         EXPOSED RIVETS: NO&lt;/P&gt;&lt;P&gt;	1000	BACK&lt;/P&gt;&lt;P&gt;	1000	SHEET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the output should as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATERIAL PLANT     TEXT&lt;/P&gt;&lt;P&gt;1231245	1000	# OF RINGS &lt;/P&gt;&lt;P&gt;56784901	1000	CENTERS (&lt;/P&gt;&lt;P&gt;		BLACK MAT'L.&lt;/P&gt;&lt;P&gt;	                EXPOSED RIVETS: NO&lt;/P&gt;&lt;P&gt;		BACK&lt;/P&gt;&lt;P&gt;		SHEET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the code i have written for sorting  but its not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_sort-fieldname =  'MATNR'.&lt;/P&gt;&lt;P&gt; wa_sort-tabname = 'lt_data'.&lt;/P&gt;&lt;P&gt;  wa_sort-spos      = '1'.&lt;/P&gt;&lt;P&gt; wa_sort-up          = 'X'.&lt;/P&gt;&lt;P&gt;  wa_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND wa_sort TO gt_sort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   wa_sort-fieldname =  'WERKS'.&lt;/P&gt;&lt;P&gt; wa_sort-tabname = 'lt_data'.&lt;/P&gt;&lt;P&gt; wa_sort-spos      = '2'.&lt;/P&gt;&lt;P&gt; wa_sort-down          = 'X'.&lt;/P&gt;&lt;P&gt; wa_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND wa_sort TO gt_sort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help.&lt;/P&gt;&lt;P&gt;thanks i advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 May 2009 09:50:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-12T09:50:21Z</dc:date>
    <item>
      <title>ALV sorting for 2 fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589295#M1274239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ,&lt;/P&gt;&lt;P&gt;SORTING issue in ALV GRID,i kept code for sorting on material so material displays only once for all that particular line items, now the plant also should display only once for that materail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I AM getting the output as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATERIAL PLANT     TEXT&lt;/P&gt;&lt;P&gt;1231245	1000	# OF RINGS &lt;/P&gt;&lt;P&gt;56784901	1000	CENTERS (&lt;/P&gt;&lt;P&gt;	1000	BLACK MAT'L.&lt;/P&gt;&lt;P&gt;	1000         EXPOSED RIVETS: NO&lt;/P&gt;&lt;P&gt;	1000	BACK&lt;/P&gt;&lt;P&gt;	1000	SHEET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the output should as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATERIAL PLANT     TEXT&lt;/P&gt;&lt;P&gt;1231245	1000	# OF RINGS &lt;/P&gt;&lt;P&gt;56784901	1000	CENTERS (&lt;/P&gt;&lt;P&gt;		BLACK MAT'L.&lt;/P&gt;&lt;P&gt;	                EXPOSED RIVETS: NO&lt;/P&gt;&lt;P&gt;		BACK&lt;/P&gt;&lt;P&gt;		SHEET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the code i have written for sorting  but its not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_sort-fieldname =  'MATNR'.&lt;/P&gt;&lt;P&gt; wa_sort-tabname = 'lt_data'.&lt;/P&gt;&lt;P&gt;  wa_sort-spos      = '1'.&lt;/P&gt;&lt;P&gt; wa_sort-up          = 'X'.&lt;/P&gt;&lt;P&gt;  wa_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND wa_sort TO gt_sort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   wa_sort-fieldname =  'WERKS'.&lt;/P&gt;&lt;P&gt; wa_sort-tabname = 'lt_data'.&lt;/P&gt;&lt;P&gt; wa_sort-spos      = '2'.&lt;/P&gt;&lt;P&gt; wa_sort-down          = 'X'.&lt;/P&gt;&lt;P&gt; wa_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND wa_sort TO gt_sort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help.&lt;/P&gt;&lt;P&gt;thanks i advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2009 09:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589295#M1274239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-12T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sorting for 2 fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589296#M1274240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the below code. It is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  CLEAR x_sort.
  x_sort-fieldname = 'CARRID'.
  x_sort-tabname   = 'IT_DATE'.
  x_sort-up = 'X'.
  APPEND x_sort TO t_sort.
CLEAR x_sort.
  x_sort-fieldname = 'CONNID'.
  x_sort-tabname   = 'IT_DATE'.
  x_sort-up = 'X'.
  APPEND x_sort TO t_sort.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I gave positions in catalog filling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jyothi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jyothi on May 12, 2009 12:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2009 09:56:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589296#M1274240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-12T09:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sorting for 2 fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589297#M1274241</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;I think the code that you have written for sorting the Alv 1st by Material and then by Plant is code. The only thing is try passing the internal table name is CAPS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sort on Sequence.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR s_sortinfo.&lt;/P&gt;&lt;P&gt;  s_sortinfo-spos      = c_1.&lt;/P&gt;&lt;P&gt;  s_sortinfo-fieldname = 'SEQ'(026).&lt;/P&gt;&lt;P&gt;  s_sortinfo-tabname   = 'T_FINAL_ITEM'(028).&lt;/P&gt;&lt;P&gt;  s_sortinfo-up        = c_x.&lt;/P&gt;&lt;P&gt;  APPEND s_sortinfo TO rt_sortinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sort on BOM Material.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR s_sortinfo.&lt;/P&gt;&lt;P&gt;  s_sortinfo-spos      = c_2.&lt;/P&gt;&lt;P&gt;  s_sortinfo-fieldname = 'MATNR'(030).&lt;/P&gt;&lt;P&gt;  s_sortinfo-tabname   = 'T_FINAL_ITEM'(028).&lt;/P&gt;&lt;P&gt;  s_sortinfo-up        = c_x.&lt;/P&gt;&lt;P&gt;  s_sortinfo-subtot    = c_x.&lt;/P&gt;&lt;P&gt;  APPEND s_sortinfo TO rt_sortinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR s_sortinfo.&lt;/P&gt;&lt;P&gt;  s_sortinfo-spos        = c_7.&lt;/P&gt;&lt;P&gt;  s_sortinfo-fieldname  = 'LSTAR'(039).&lt;/P&gt;&lt;P&gt;  s_sortinfo-tabname   = 'T_FINAL_ITEM'(028).&lt;/P&gt;&lt;P&gt;  s_sortinfo-up            = c_x.&lt;/P&gt;&lt;P&gt;  s_sortinfo-subtot      = c_x.&lt;/P&gt;&lt;P&gt;  APPEND s_sortinfo TO rt_sortinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2009 11:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-for-2-fields/m-p/5589297#M1274241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-12T11:05:52Z</dc:date>
    </item>
  </channel>
</rss>

