<?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: Interactive ALV ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403466#M817280</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;Can you please bit more clear about that how to use that EMPHASIZE in the ALV.&lt;/P&gt;&lt;P&gt;With code ite really appriciatable...&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Sakthi c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2008 05:25:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-20T05:25:05Z</dc:date>
    <item>
      <title>Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403463#M817277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my interactive ALV report I want to give different color to selected rows in my alv.&lt;/P&gt;&lt;P&gt;How to proceed with that in interactive alv?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sakthi C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 05:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403463#M817277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T05:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403464#M817278</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;Try using EMPHASIZE option of columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMPHASIZE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comp. type&lt;/P&gt;&lt;P&gt;LVC_EMPHSZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defined Length&lt;/P&gt;&lt;P&gt;Char(4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value range&lt;/P&gt;&lt;P&gt;SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the field is set to 'X', the ALV uses a pre-defined color for highlighting the column. If the character field begins with 'C' (color code), the remaining numbers have the following meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x: color number &lt;/P&gt;&lt;P&gt;y: intensified display on/off &lt;/P&gt;&lt;P&gt;y: inverse display on/off&lt;/P&gt;&lt;P&gt;For more information on color coding, see the F1 help on the FORMAT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vasudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 05:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403464#M817278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T05:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403465#M817279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The follow program demonstrates how to change the colour of individual rows of an ALV grid. Changes required&lt;/P&gt;&lt;P&gt;from a basic ALV grid include adding a new field to ALV grid data table(it_ekko), Populating this field with color&lt;/P&gt;&lt;P&gt;attribute and adding an entry to layout control table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;amp;---------------------------------------------------------------------
*&amp;amp; Report ZDEMO_ALVGRID *
*&amp;amp; *
&amp;amp;---------------------------------------------------------------------
*&amp;amp; *
*&amp;amp; Example of a simple ALV Grid Report *
*&amp;amp; ................................... *
*&amp;amp; *
*&amp;amp; The basic ALV grid, Enhanced to display each row in a different *
*&amp;amp; colour *
&amp;amp;---------------------------------------------------------------------

REPORT zdemo_alvgrid .

TABLES: ekko.

type-pools: slis. "ALV Declarations
*Data Declaration
*----------------
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4) type c, "Used to store row color attributes
END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.

*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.

************************************************************************
*Start-of-selection.
START-OF-SELECTION.

perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.


&amp;amp;---------------------------------------------------------------------
*&amp;amp; Form BUILD_FIELDCATALOG
&amp;amp;---------------------------------------------------------------------


Build Fieldcatalog for ALV Report 
----------------------------------------------------------------------
form build_fieldcatalog.


There are a number of ways to create a fieldcat. 
For the purpose of this example i will build the fieldcatalog manualy 
by populating the internal table fields individually and then 
appending the rows. This method can be the most time consuming but can 
also allow you more control of the final product. 


Beware though, you need to ensure that all fields required are 
populated. When using some of functionality available via ALV, such as 
total. You may need to provide more information than if you were 
simply displaying the result 
I.e. Field type may be required in-order for 
the 'TOTAL' function to work. 

fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.

fieldcatalog-do_sum = 'X'. 
fieldcatalog-no_zero = 'X'. 
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.

fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG

&amp;amp;---------------------------------------------------------------------
*&amp;amp; Form BUILD_LAYOUT
&amp;amp;---------------------------------------------------------------------


Build layout for ALV grid report 
----------------------------------------------------------------------
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).

Set layout field for row attributes(i.e. color) 
gd_layout-info_fieldname = 'LINE_COLOR'.

gd_layout-totals_only = 'X'. 
gd_layout-f2code = 'DISP'. "Sets fcode for when double 
"click(press f2) 
gd_layout-zebra = 'X'. 
gd_layout-group_change_edit = 'X'. 
gd_layout-header_text = 'helllllo'. 
endform. " BUILD_LAYOUT

&amp;amp;---------------------------------------------------------------------
*&amp;amp; Form DISPLAY_ALV_REPORT
&amp;amp;---------------------------------------------------------------------


Display report using ALV grid 
----------------------------------------------------------------------
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM 
i_callback_user_command = 'USER_COMMAND' 
i_grid_title = outtext 
is_layout = gd_layout
it_fieldcat = fieldcatalog[]

it_special_groups = gd_tabgroup 
IT_EVENTS = GT_XEVENTS 
i_save = 'X'

is_variant = z_template 

tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
endif.
endform. " DISPLAY_ALV_REPORT

&amp;amp;---------------------------------------------------------------------
*&amp;amp; Form DATA_RETRIEVAL
&amp;amp;---------------------------------------------------------------------


Retrieve data form EKPO table and populate itab it_ekko 
----------------------------------------------------------------------
form data_retrieval.
data: ld_color(1) type c.

select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.

*Populate field with color attributes
loop at it_ekko into wa_ekko.

Populate color variable with colour properties 
Char 1 = C (This is a color property) 
Char 2 = 3 (Color codes: 1 - 7) 
Char 3 = Intensified on/off ( 1 or 0 ) 
Char 4 = Inverse display on/off ( 1 or 0 ) 
i.e. wa_ekko-line_color = 'C410' 
ld_color = ld_color + 1.


Only 7 colours so need to reset color value 
if ld_color = 8.
ld_color = 1.
endif.
concatenate 'C' ld_color '10' into wa_ekko-line_color.

wa_ekko-line_color = 'C410'. 
modify it_ekko from wa_ekko.
endloop.
endform. " DATA_RETRIEVAL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 05:24:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403465#M817279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T05:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403466#M817280</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;Can you please bit more clear about that how to use that EMPHASIZE in the ALV.&lt;/P&gt;&lt;P&gt;With code ite really appriciatable...&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Sakthi c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 05:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403466#M817280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T05:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403467#M817281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT  ZDEMO_ALVGRID_EDIT                 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:     ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;TYPES: BEGIN OF t_ekko,&lt;/P&gt;&lt;P&gt; ebeln TYPE ekpo-ebeln,&lt;/P&gt;&lt;P&gt; ebelp TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt; statu TYPE ekpo-statu,&lt;/P&gt;&lt;P&gt; aedat TYPE ekpo-aedat,&lt;/P&gt;&lt;P&gt; matnr TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt; menge TYPE ekpo-menge,&lt;/P&gt;&lt;P&gt; meins TYPE ekpo-meins,&lt;/P&gt;&lt;P&gt; netpr TYPE ekpo-netpr,&lt;/P&gt;&lt;P&gt; peinh TYPE ekpo-peinh,&lt;/P&gt;&lt;P&gt; field_style  TYPE lvc_t_styl, "FOR DISABLE&lt;/P&gt;&lt;P&gt;END OF t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;     wa_ekko TYPE t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;     wa_fieldcat TYPE lvc_s_fcat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     gd_tab_group TYPE slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;     gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,&lt;/P&gt;&lt;P&gt;     gd_repid     LIKE sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; PERFORM data_retrieval.&lt;/P&gt;&lt;P&gt; PERFORM set_specific_field_attributes.&lt;/P&gt;&lt;P&gt; PERFORM build_fieldcatalog.&lt;/P&gt;&lt;P&gt; PERFORM build_layout.&lt;/P&gt;&lt;P&gt; PERFORM display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'EBELN'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Purchase Order'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 0.&lt;/P&gt;&lt;P&gt; wa_fieldcat-outputlen   = 10.&lt;/P&gt;&lt;P&gt; wa_fieldcat-emphasize   = 'X'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-key         = 'X'.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'EBELP'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'PO Item'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 1.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'STATU'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Status'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 2.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'AEDAT'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Item change date'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 3.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'MATNR'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Material Number'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 4.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'MENGE'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'PO quantity'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 5.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'MEINS'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Order Unit'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 6.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'NETPR'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Net Price'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-edit        = 'X'. "sets whole column to be editable&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 7.&lt;/P&gt;&lt;P&gt; wa_fieldcat-outputlen   = 15.&lt;/P&gt;&lt;P&gt; wa_fieldcat-datatype     = 'CURR'.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_fieldcat-fieldname   = 'PEINH'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-scrtext_m   = 'Price Unit'.&lt;/P&gt;&lt;P&gt; wa_fieldcat-col_pos     = 8.&lt;/P&gt;&lt;P&gt; APPEND wa_fieldcat TO it_fieldcat.&lt;/P&gt;&lt;P&gt; CLEAR  wa_fieldcat.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_layout.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set layout field for field attributes(i.e. input/output)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; gd_layout-stylefname = 'FIELD_STYLE'.&lt;/P&gt;&lt;P&gt; gd_layout-zebra             = 'X'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_alv_report.&lt;/P&gt;&lt;P&gt; gd_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;           i_callback_program      = gd_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_lvc               = gd_layout&lt;/P&gt;&lt;P&gt;           it_fieldcat_lvc             = it_fieldcat&lt;/P&gt;&lt;P&gt;           i_save                  = 'X'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;           t_outtab                = it_ekko&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  ne 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Retrieve data form EKPO table and populate itab it_ekko&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM data_retrieval.&lt;/P&gt;&lt;P&gt; SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh&lt;/P&gt;&lt;P&gt;  UP TO 100 ROWS&lt;/P&gt;&lt;P&gt;   FROM ekpo&lt;/P&gt;&lt;P&gt;   INTO  CORRESPONDING FIELDS OF TABLE it_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  set_specific_field_attributes&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      populate FIELD_STYLE table with specific field attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form set_specific_field_attributes .&lt;/P&gt;&lt;P&gt; DATA ls_stylerow TYPE lvc_s_styl .&lt;/P&gt;&lt;P&gt; DATA lt_styletab TYPE lvc_t_styl .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate style variable (FIELD_STYLE) with style properties&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The NETPR field/column has been set to editable in the fieldcatalog...&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The following code sets it to be disabled(display only) if 'NETPR'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;is gt than 10.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; LOOP AT it_ekko INTO wa_ekko.&lt;/P&gt;&lt;P&gt;   IF wa_ekko-netpr GT 10.&lt;/P&gt;&lt;P&gt;     ls_stylerow-fieldname = 'NETPR' .&lt;/P&gt;&lt;P&gt;     ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.&lt;/P&gt;&lt;P&gt;                                            "set field to disabled&lt;/P&gt;&lt;P&gt;     APPEND ls_stylerow  TO wa_ekko-field_style.&lt;/P&gt;&lt;P&gt;     MODIFY it_ekko FROM wa_ekko.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " set_specific_field_attributes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 05:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403467#M817281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T05:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive ALV ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403468#M817282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Have a look on the following code,you can get the solution.&lt;/P&gt;&lt;P&gt;Demo program to color particular row or column or cell of an ALV list using 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt;SPFLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS:&lt;/P&gt;&lt;P&gt;SLIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;P_COL TYPE I,&lt;/P&gt;&lt;P&gt;P_ROW TYPE I,&lt;/P&gt;&lt;P&gt;P_COLOR(4) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,&lt;/P&gt;&lt;P&gt;FS_FIELDCAT LIKE LINE OF T_FIELDCAT,&lt;/P&gt;&lt;P&gt;FS_LAYOUT TYPE SLIS_LAYOUT_ALV,&lt;/P&gt;&lt;P&gt;W_COLOR(4),&lt;/P&gt;&lt;P&gt;W_ROW TYPE I,&lt;/P&gt;&lt;P&gt;W_FIELDNAME(20),&lt;/P&gt;&lt;P&gt;W_PROG TYPE SY-REPID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;BEGIN OF T_SPFLI OCCURS 0,&lt;/P&gt;&lt;P&gt;COLOR(4),&lt;/P&gt;&lt;P&gt;CHECKBOX ,&lt;/P&gt;&lt;P&gt;CELL TYPE SLIS_T_SPECIALCOL_ALV,&lt;/P&gt;&lt;P&gt;CARRID TYPE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;CONNID TYPE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;CITYFROM TYPE SPFLI-CITYFROM,&lt;/P&gt;&lt;P&gt;CITYTO TYPE SPFLI-CITYTO,&lt;/P&gt;&lt;P&gt;DISTANCE TYPE SPFLI-DISTANCE,&lt;/P&gt;&lt;P&gt;END OF T_SPFLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;FS_CELL LIKE LINE OF T_SPFLI-CELL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM SPFLI&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;W_COLOR = P_COLOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T_SPFLI-COLOR = P_COLOR.&lt;/P&gt;&lt;P&gt;IF P_COL IS INITIAL AND P_ROW GT 0.&lt;/P&gt;&lt;P&gt;MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-FIELDNAME = 'CARRID'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-REF_TABNAME = 'SPFLI'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-COL_POS = 1.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-KEY = 'X'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-HOTSPOT = 'X'.&lt;/P&gt;&lt;P&gt;APPEND FS_FIELDCAT TO T_FIELDCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR FS_FIELDCAT .&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-FIELDNAME = 'CONNID'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-REF_TABNAME = 'SPFLI'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-COL_POS = 2.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-KEY = 'X'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-HOTSPOT = 'X'.&lt;/P&gt;&lt;P&gt;APPEND FS_FIELDCAT TO T_FIELDCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR FS_FIELDCAT .&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-FIELDNAME = 'DISTANCE'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-REF_TABNAME = 'SPFLI'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-COL_POS = 3.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-KEY = ' '.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-EDIT = 'X'.&lt;/P&gt;&lt;P&gt;APPEND FS_FIELDCAT TO T_FIELDCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR FS_FIELDCAT.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-FIELDNAME = 'CITYFROM'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-REF_TABNAME = 'SPFLI'.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-COL_POS = 4.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-KEY = ' '.&lt;/P&gt;&lt;P&gt;APPEND FS_FIELDCAT TO T_FIELDCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT T_FIELDCAT INTO FS_FIELDCAT.&lt;/P&gt;&lt;P&gt;IF FS_FIELDCAT-COL_POS EQ P_COL.&lt;/P&gt;&lt;P&gt;FS_FIELDCAT-EMPHASIZE = P_COLOR.&lt;/P&gt;&lt;P&gt;W_FIELDNAME = FS_FIELDCAT-FIELDNAME.&lt;/P&gt;&lt;P&gt;IF P_ROW IS INITIAL AND P_COL GT 0.&lt;/P&gt;&lt;P&gt;MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FS_CELL-FIELDNAME = W_FIELDNAME .&lt;/P&gt;&lt;P&gt;FS_CELL-COLOR-COL = 6.&lt;/P&gt;&lt;P&gt;FS_CELL-NOKEYCOL = 'X'.&lt;/P&gt;&lt;P&gt;APPEND FS_CELL TO T_SPFLI-CELL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.&lt;/P&gt;&lt;P&gt;FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.&lt;/P&gt;&lt;P&gt;FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.&lt;/P&gt;&lt;P&gt;FS_LAYOUT-F2CODE = '&amp;amp;ETA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;W_PROG = SY-REPID.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_CALLBACK_PROGRAM = W_PROG&lt;/P&gt;&lt;P&gt;IS_LAYOUT = FS_LAYOUT&lt;/P&gt;&lt;P&gt;IT_FIELDCAT = T_FIELDCAT&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;T_OUTTAB = T_SPFLI&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;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE &lt;/P&gt;&lt;P&gt; Column and Row are colored with a coded color &amp;#145;Cxyz&amp;#146;.&lt;/P&gt;&lt;P&gt;    Where C: Color (coding must begin with C)&lt;/P&gt;&lt;P&gt;                 X: Color Number&lt;/P&gt;&lt;P&gt;                 Y: Bold&lt;/P&gt;&lt;P&gt;                 Z: Inverse. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;chandu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 06:24:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3403468#M817282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T06:24:50Z</dc:date>
    </item>
  </channel>
</rss>

