<?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 Grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351823#M1232266</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;data:&lt;/P&gt;&lt;P&gt;   t_sort type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;wa_sort like line of t_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_sort-spos = 1.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;wa_sort-tabname = 'T_SPFLI'.&lt;/P&gt;&lt;P&gt;wa_sort-up = 'X'.&lt;/P&gt;&lt;P&gt;*WA_SORT-DOWN = 'X'.&lt;/P&gt;&lt;P&gt;append wa_sort to t_sort.&lt;/P&gt;&lt;P&gt;clear wa_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort up is for ascending,&lt;/P&gt;&lt;P&gt;Sort down is for descending.&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;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Mar 2009 12:08:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-09T12:08:29Z</dc:date>
    <item>
      <title>ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351821#M1232264</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;Please reply me if anybody knows how to 'SORT' Currency field Value in ALV grid display.&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>Mon, 09 Mar 2009 11:05:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351821#M1232264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-09T11:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351822#M1232265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Busam,&lt;/P&gt;&lt;P&gt;  While displaying ypur ALV report, You write a select query right?So there itself &lt;STRONG&gt;sort&lt;/STRONG&gt; it by currency field.&lt;/P&gt;&lt;P&gt;Or else in your ALV report who have a symbol to sort.Choose your field and sort it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much Regards,&lt;/P&gt;&lt;P&gt;Amuktha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2009 11:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351822#M1232265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-09T11:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351823#M1232266</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;data:&lt;/P&gt;&lt;P&gt;   t_sort type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;wa_sort like line of t_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_sort-spos = 1.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;wa_sort-tabname = 'T_SPFLI'.&lt;/P&gt;&lt;P&gt;wa_sort-up = 'X'.&lt;/P&gt;&lt;P&gt;*WA_SORT-DOWN = 'X'.&lt;/P&gt;&lt;P&gt;append wa_sort to t_sort.&lt;/P&gt;&lt;P&gt;clear wa_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort up is for ascending,&lt;/P&gt;&lt;P&gt;Sort down is for descending.&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;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2009 12:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351823#M1232266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-09T12:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351824#M1232267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, I have tried this but this logic not working for 'Currency (VALUE) fields' , and there is no TABNAME field in LVC_S_SORT structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any other solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2009 12:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351824#M1232267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-09T12:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351825#M1232268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Busam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at this wiki.It explains the SORT statement with screen shots and example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[https://wiki.sdn.sap.com/wiki/display/ABAP/SORT&lt;EM&gt;in&lt;/EM&gt;ALV]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hareesh Menon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2009 17:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351825#M1232268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-09T17:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351826#M1232269</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;there are 3 possible ways of sorting..&lt;/P&gt;&lt;P&gt;1. Sort the Internal Table w.r.t the curr field and than pass that to alv.&lt;/P&gt;&lt;P&gt;2. Use the Sort Class and appl;y the sort on the sort field.&lt;/P&gt;&lt;P&gt;3. In table choose the sort tool from the standard  toolbar of alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 05:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351826#M1232269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T05:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351827#M1232270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Busam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have done a small example for u.I have checked with both CUURENCY and PRICE fields. Its working fine.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:

R_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
R_GRID TYPE REF TO CL_GUI_ALV_GRID.

data:
      t_sort type lvc_t_sort,
      fs_sort type lvc_s_sort,
      t_sflight type table of sflight.

select * from sflight into table t_sflight.

 fs_sort-SPOS = 4.
*  fs_sort-SPOS = 5.
*fs_sort-FIELDNAME = 'CURRENCY'.
fs_sort-FIELDNAME = 'PRICE'.
fs_sort-down = 'X'.
append fs_sort to t_sort.
CALL SCREEN 100.

MODULE LIST_OUTPUT OUTPUT.

CREATE OBJECT
R_CONTAINER
EXPORTING
CONTAINER_NAME = 'CONTAINER1'.

CREATE OBJECT R_GRID
EXPORTING
I_PARENT = R_CONTAINER.

CALL METHOD R_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
CHANGING
IT_OUTTAB = T_SFLIGHT
IT_SORT = T_SORT.

ENDMODULE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPOS - position of the field in the display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 05:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351827#M1232270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T05:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351828#M1232271</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;Inorder to SORT the table data,you have to create an internal table of type LVC_T_SORT.&lt;/P&gt;&lt;P&gt;LVC_T_SORT is a table type whic has a line type LVC_S_SORT.&lt;/P&gt;&lt;P&gt;You need to create a work area of type LVC_S_SORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then populate the internal table using this work area and pass it to the method&lt;/P&gt;&lt;P&gt;SET_TABLE_FOR_FIRST_DISPLAY using the parameter IT_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 05:43:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351828#M1232271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T05:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351829#M1232272</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;declare a data type as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_sort type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;          wa_sort type slis_sortinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then after creating the fieldcatalog give&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_sort-spos = '1'.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'name of d field u wanna sort'.&lt;/P&gt;&lt;P&gt;wa_sort-tabname = 'name of the table u hv used'.&lt;/P&gt;&lt;P&gt;wa_sort-up = ' X'.&lt;/P&gt;&lt;P&gt;wa_sort-down = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;use any 1 either up or down,up is used for ascending and down for descending&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;append wa_sort to it_sort&lt;/P&gt;&lt;P&gt;clear wa_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then in fm&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;IT_SORT                           = IT_SORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think this wl solve ur problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;shivraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 06:31:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351829#M1232272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T06:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351830#M1232273</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;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Sort Using sort structure&lt;/STRONG&gt;----- This is can be used while displaying the data using "REUSE_ALV_GRID_DISPLAY" or " REUSE_ALV_GRID_DISPLAY_LVC" .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps for sorting in this way ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using REUSE_ALV_GRID_DISPALY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a). We have to decare a structure of sort type slis_sortinfo_alv &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_sort TYPE TABLE OF slis_sortinfo_alv "Internal Table&lt;/P&gt;&lt;P&gt;wa_sort TYPE slis_sortinfo_alv, "Work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) Then before calling the function REUSE_ALV_GRID_DISPALY sort like... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_sort-spos = '01' .&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'RACCT'.&lt;/P&gt;&lt;P&gt;wa_sort-tabname = 'IT_FAGLFLEXA'.&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 it_sort .&lt;/P&gt;&lt;P&gt;CLEAR wa_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) When calling the function REUSE_ALV_GRID_DISPALY ,U must have to specify the sorting structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_sort = it_sort&lt;/P&gt;&lt;P&gt;Note: This field is optional and will be commented while u are calling the fucntion..So u have to uncomment this particular field and assign the sorting internal table of ur program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using REUSE_ALV_GRID_DISPALY_LVC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a). We have to decare a structure of sort type lvc_t_sort &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_sort TYPE TABLE OF lvc_t_sort "Internal Table&lt;/P&gt;&lt;P&gt;wa_sort TYPE lvc_s_sort, "Work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) Then before calling the function REUSE_ALV_GRID_DISPALY sort like... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_sort-spos = '01' .&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'RACCT'.&lt;/P&gt;&lt;P&gt;wa_sort-tabname = 'IT_FAGLFLEXA'.&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 it_sort .&lt;/P&gt;&lt;P&gt;CLEAR wa_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) When calling the function REUSE_ALV_GRID_DISPALY_LVC , U must have to specify the sorting structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_sort_lvc = it_sort&lt;/P&gt;&lt;P&gt;Note: This field is optional and will be commented while u are calling the fucntion..So u have to uncomment this particular field and assign the sorting internal table of ur program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will help you.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;lokesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Lokesh Tripathi on Apr 21, 2009 4:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 11:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351830#M1232273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T11:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351831#M1232274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can try this code for sorting :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sort Criteria.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IT_SORT-FIELDNAME = 'Give you field name'.&lt;/P&gt;&lt;P&gt;IT_SORT-UP = 'X'.&lt;/P&gt;&lt;P&gt;APPEND IT_SORT.&lt;/P&gt;&lt;P&gt;CLEAR IT_SORT.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT_SORT-FIELDNAME = 'Give you field name'.&lt;/P&gt;&lt;P&gt;IT_SORT-UP = 'X'.&lt;/P&gt;&lt;P&gt;APPEND IT_SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use the Function module then there is a Internale table Caled IT_SORT, &lt;/P&gt;&lt;P&gt;if you use the Class then there is also a Internal table IT_SORT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sarita Singh Rathour&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 12:57:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351831#M1232274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T12:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351832#M1232275</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;when u r selecting data from database table you get data n sorted order (if the field is of type n).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. even after writing sort if u r not geting currency field in sorted order the probably you have taken currency field as type text. if so make it as type P or num with x decimal places. and jst sorting using sort statement will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: sort itab with &amp;lt;currency&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. else it_sort-up = 'X' in your layout should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. you can even give in function module REUSE_ALV_GRID_DISPLAY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 02:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351832#M1232275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T02:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351833#M1232276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want you can use it with &lt;STRONG&gt;alv_grid_object_name_here-&amp;gt;set_table_for_first_diplay&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM build_fieldsort  CHANGING p_field_sort TYPE lvc_t_sort.
  DATA: wa_sort TYPE lvc_s_sort.
  REFRESH p_field_sort.
  CLEAR wa_sort.
  wa_sort-spos = '2'.  " number of the col in the fieldcatalog corresponding to the fieldname
  wa_sort-fieldname = 'BDEGR'.
  wa_sort-down = 'X'.
  APPEND wa_sort TO p_field_sort.
  CLEAR wa_sort.
ENDFORM.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

CALL METHOD g_grid_03-&amp;gt;set_table_for_first_display
    EXPORTING
      is_layout            = gs_layout
      it_toolbar_excluding = lt_exclude
    CHANGING
      it_sort              = gs_field_sort   " required
      it_fieldcatalog      = gt_fieldcat   " required 
      it_outtab            = it_zhrgt_t705l[]. " required

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's a catch if &lt;STRONG&gt;you want cells to merge&lt;/STRONG&gt; when they have equal fields&lt;/P&gt;&lt;P&gt;you must not use the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;alv_grid_object_name_here-&amp;gt;SET_READY_FOR_INPUT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- or change the fieldcatlog &lt;STRONG&gt;edit&lt;/STRONG&gt; property to editable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 15:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/5351833#M1232276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T15:15:22Z</dc:date>
    </item>
  </channel>
</rss>

