<?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: ALV -- sorting fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384754#M1238145</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;&lt;/P&gt;&lt;P&gt;Refer to this link..https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/sort&lt;EM&gt;in&lt;/EM&gt;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Opp's sorry it is not possible...if the value is same for the corresponding two values in the different sort column then the values are merged and displayed at first instead of showing once again if any change in the any of the values in other sort column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead you can update the internal table in the same way as required and display as the output. The restriction on this you need to disable the sort buttons on the alv and no other operations to be performed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2009 16:07:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-08T16:07:48Z</dc:date>
    <item>
      <title>ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384753#M1238144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there experts...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m doing an alv report and I want to know if it's possible to sort the alv like I'm going to explain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WA_SORT-SPOS = 1.
  WA_SORT-FIELDNAME = 'EKGRP'.
  WA_SORT-TABNAME = 'T'.
  WA_SORT-UP = 'X'.
  APPEND WA_SORT TO IT_SORT.
  CLEAR WA_SORT.

  WA_SORT-SPOS = 2.
  WA_SORT-FIELDNAME = 'EKNAM'.
  WA_SORT-TABNAME = 'T'.
  WA_SORT-UP = 'X'.
  APPEND WA_SORT TO IT_SORT.
  CLEAR WA_SORT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sort this two fields in order that, i just want to group the equal values of EKNAM that correspond to a single value of EKGRP nad not to group all equal values of EKNAM with diferent EKGRP values.&lt;/P&gt;&lt;P&gt;Output Example of what I want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   EKGRP   |   EKNAM  |   DESC
-----------|----------|-------------
       1   |   001    | blabla1
           |----------|-------------
           |   002    | blabla2
           |          |-------------
           |          | blabla3
-----------|----------|-------------
      2    |   002    | blabla4
           |          |-------------
           |          | blalba5
           |--------- |--------------
           |   012    | blabla6&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With normal sort, value 002 for EKNAM field is grouped independently from the value of EKGRP field...&lt;/P&gt;&lt;P&gt;Is it possible to do??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Hermano.Andrade on Apr 8, 2009 5:59 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 15:58:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384753#M1238144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T15:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384754#M1238145</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;&lt;/P&gt;&lt;P&gt;Refer to this link..https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/sort&lt;EM&gt;in&lt;/EM&gt;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Opp's sorry it is not possible...if the value is same for the corresponding two values in the different sort column then the values are merged and displayed at first instead of showing once again if any change in the any of the values in other sort column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead you can update the internal table in the same way as required and display as the output. The restriction on this you need to disable the sort buttons on the alv and no other operations to be performed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 16:07:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384754#M1238145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T16:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384755#M1238146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hermano,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you try below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab by EKGRP   EKNAM ,&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;hope it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 16:08:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384755#M1238146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T16:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384756#M1238147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes it is possible with the way you are trying&lt;/P&gt;&lt;P&gt;just maintain the sequence...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 16:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384756#M1238147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T16:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384757#M1238148</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;Yes, you are right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the code to sort output w.r.t. these two fields (based on the combination of both).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know in case you have any doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2009 04:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384757#M1238148</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-04-09T04:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: ALV -- sorting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384758#M1238149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, check this one.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at itab.

AT NEW EKGRP.
FLAG = 'X'.
ENDAT.

AT NEW EKNAM.
FLAG1 = 'X'.
ENDAT.

IF FLAG ='X'.
MOVE CORRESPONDING ITAB TO WA_TAB.
APPEND WA_TAB TO ITAB1.
ELSE.
CLEAR ITAB-EKGRP.
MOVE CORRESPONDING ITAB TO WA_TAB.
APPEND WA_TAB TO ITAB1.
ENDIF.

IF FLAG1 ='X'.
MOVE CORRESPONDING ITAB TO WA_TAB.
APPEND WA_TAB TO ITAB1.
ELSE.
CLEAR ITAB-EKNAM.
MOVE CORRESPONDING ITAB TO WA_TAB.
APPEND WA_TAB TO ITAB1.
ENDIF.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2009 05:37:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sorting-fields/m-p/5384758#M1238149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-09T05:37:34Z</dc:date>
    </item>
  </channel>
</rss>

