<?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: sorting in ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093283#M978788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is a table in the REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this to specify which field u want to use for sorting and in which sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jul 2008 06:53:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-08T06:53:58Z</dc:date>
    <item>
      <title>sorting in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093282#M978787</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 have created an alv and i have written a code to get the invoice type, invoice date and material group.but the problem i face is that when i try to sort out by material group, i was unable to do so.the following is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;SELECT  VBRK&lt;SUB&gt;FKDAT VBRK&lt;/SUB&gt;FKART VBRP~MATKL INTO CORRESPONDING FIELDS OF ITAB&lt;/P&gt;&lt;P&gt; FROM VBRK&lt;/P&gt;&lt;P&gt;INNER JOIN VBRP&lt;/P&gt;&lt;P&gt;ON VBRK&lt;SUB&gt;VBELN = VBRP&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;  WHERE VBELN = ITAB-RDOC AND&lt;/P&gt;&lt;P&gt;        VBRK~FKART IN FKART AND&lt;/P&gt;&lt;P&gt;       VBRP~MATKL IN MATKL.&lt;/P&gt;&lt;P&gt;MODIFY ITAB.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help me in sorting it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 06:52:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093282#M978787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T06:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: sorting in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093283#M978788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is a table in the REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this to specify which field u want to use for sorting and in which sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 06:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093283#M978788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T06:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: sorting in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093284#M978789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can sort the internal table before calling the ALV funcation module depending on which fields. add the below code just after endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ITAB by  field1....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 06:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093284#M978789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T06:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: sorting in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093285#M978790</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;Perhaps you can retreive the data in SELECT Query with  ORDER BY DESC clause on Material Group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might solve Your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 07:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093285#M978790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T07:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: sorting in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093286#M978791</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;For sorting use the sort table for ALV function module :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After fetching the data into final table , fill the sort table and pass:&lt;/P&gt;&lt;P&gt;example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT T_FINAL BY VKORG KUNRG KUNAG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  RS_SORT-SPOS        = 1.&lt;/P&gt;&lt;P&gt;  RS_SORT-FIELDNAME   = 'VKORG'.&lt;/P&gt;&lt;P&gt;  RS_SORT-UP          = 'X'.&lt;/P&gt;&lt;P&gt;  RS_SORT-GROUP       = '*'.&lt;/P&gt;&lt;P&gt;  APPEND RS_SORT TO T_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  RS_SORT-SPOS        = 2.&lt;/P&gt;&lt;P&gt;  RS_SORT-FIELDNAME   = 'KUNRG'.&lt;/P&gt;&lt;P&gt;  RS_SORT-UP          = 'X'.&lt;/P&gt;&lt;P&gt;  RS_SORT-GROUP       = '*'.&lt;/P&gt;&lt;P&gt;  APPEND RS_SORT TO T_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  RS_SORT-SPOS        = 3.&lt;/P&gt;&lt;P&gt;  RS_SORT-FIELDNAME   = 'KUNAG'.&lt;/P&gt;&lt;P&gt;  RS_SORT-UP          = 'X'.&lt;/P&gt;&lt;P&gt;  RS_SORT-GROUP       = '*'.&lt;/P&gt;&lt;P&gt;  RS_SORT-SUBTOT      = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND RS_SORT TO T_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_BACKGROUND_ID          = 'SIWB_WALLPAPER'&lt;/P&gt;&lt;P&gt;      I_CALLBACK_PROGRAM       = SY-REPID&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     i_callback_user_command  = 'USER_COMMAND'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      IS_LAYOUT                = S_LAYOUT&lt;/P&gt;&lt;P&gt;      IT_FIELDCAT              = T_FIELDCAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IT_SORT                  = T_SORT[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I_SAVE                   = V_SAVE&lt;/P&gt;&lt;P&gt;      IS_VARIANT               = S_VARIANT&lt;/P&gt;&lt;P&gt;      IT_EVENTS                = T_EVENTS&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      T_OUTTAB                 = T_FINAL&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      PROGRAM_ERROR            = 1&lt;/P&gt;&lt;P&gt;      OTHERS                   = 2.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see in the above function module it_sort[].&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;sravanthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 07:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-in-alv/m-p/4093286#M978791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T07:17:46Z</dc:date>
    </item>
  </channel>
</rss>

