<?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 Display fromant using grid function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087807#M433702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created table types (tt1) with f1,f2,f3 and f4  and (tt2) f5 and f6 using different line types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want display column order f6,f4,f3,f2,f5 and f1 in alv output .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should happen before displaying the alv out put.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don'T want go for ALV varient methood and change layout after ALV display. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; any thoughts about this logic...&lt;/P&gt;&lt;P&gt;...Nandha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2007 18:51:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-28T18:51:12Z</dc:date>
    <item>
      <title>ALV Display fromant using grid function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087807#M433702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created table types (tt1) with f1,f2,f3 and f4  and (tt2) f5 and f6 using different line types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want display column order f6,f4,f3,f2,f5 and f1 in alv output .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should happen before displaying the alv out put.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don'T want go for ALV varient methood and change layout after ALV display. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; any thoughts about this logic...&lt;/P&gt;&lt;P&gt;...Nandha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 18:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087807#M433702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T18:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Display fromant using grid function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087808#M433703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When building the field catalog, simply add them to the field cat internal table in that order.  Or if you are using the MERGE function module, you could possible loop thru it and reset the column number in the order that you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 18:56:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087808#M433703</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-28T18:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Display fromant using grid function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087809#M433704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, say you are using the MERGE field catalog,  notice in this example, i'm loop thru the field catalog and changing the column position numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

type-pools: slis.

data: begin of xma,
       matnr like makt-matnr,
       maktx like makt-maktx,
       fld1(10) type c,
       fld2(10) type c,
       end of xma.

data: ima like standard table of xma with header line.
data: fieldcat type slis_t_fieldcat_alv.
data: wa_fieldcat like line of fieldcat.
data: repid type syrepid.

repid = sy-repid.

select matnr maktx
                 into table ima
                       from makt
                             up to 100 rows
                                where spras = sy-langu.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'
     exporting
          i_program_name     = repid
          i_internal_tabname = 'XMA'
          i_inclname         = repid
          i_bypassing_buffer = 'X'
     changing
          ct_fieldcat        = fieldcat.


loop at fieldcat into wa_fieldcat.
  case wa_fieldcat-fieldname.
    when 'FLD1'.
      wa_fieldcat-col_pos = '1'.
    when 'FLD2'.
      wa_fieldcat-col_pos = '2'.
    when 'MATNR'.
      wa_fieldcat-col_pos = '3'.
    when 'MAKTX'.
      wa_fieldcat-col_pos = '4'.
  endcase.
  modify fieldcat from wa_fieldcat index sy-tabix.
endloop..

call function 'REUSE_ALV_GRID_DISPLAY'
     exporting
          it_fieldcat = fieldcat
     tables
          t_outtab    = ima.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 19:01:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087809#M433704</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-28T19:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Display fromant using grid function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087810#M433705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nandha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a field catalog of whichever order in which you need the fields and then pass this fieldcatalog to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you are use REUSE* fm then pass this as import  parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;of &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you are using class set_table_first_display then pass fieldcatalog as import table parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search this site , you will get lot of example programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 19:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087810#M433705</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-03-28T19:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Display fromant using grid function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087811#M433706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do the same thing when building your field catalog manually,  just give the COL_POS  a value for the sequence you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 19:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display-fromant-using-grid-function-module/m-p/2087811#M433706</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-28T19:01:51Z</dc:date>
    </item>
  </channel>
</rss>

