<?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 reports with ALVS. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750701#M325497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at below link which gives you a source code to generate secondary list in ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://www.sap-img.com/abap/an-interactive-alv-report.htm"&amp;gt;Interactive ALV&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 03:54:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T03:54:45Z</dc:date>
    <item>
      <title>interactive reports with ALVS.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750698#M325494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to generate the secondary list using ALV's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 03:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750698#M325494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T03:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: interactive reports with ALVS.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750699#M325495</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; Check this code: Also goto se38, search for &amp;lt;b&amp;gt;BC&lt;STRONG&gt;ALV&lt;/STRONG&gt;&amp;lt;/b&amp;gt;, you will get plenty of SAP Sample ALV Programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

include zalv_adv_top                            .                      "

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.
copy_ok_code = ok_code.

clear ok_code.

case copy_ok_code.

when 'BACK' .

leave program.

endcase.

endmodule.                 " USER_COMMAND_0100  INPUT

module status_0100 output.

set pf-status 'SCREEN_0100'.

endmodule.                 " STATUS_0100  OUTPUT

module init_control_processing output.

if ref_container is initial.

* create container object

create object ref_container

exporting

extension = 2500.

* create alv grid object and link to container

create object ref_alv

exporting

i_parent = ref_container.

* send basic list to alv grid control

call method ref_alv-&amp;gt;set_table_for_first_display

exporting

i_structure_name = 'SPFLI'
changing

it_outtab = it_spfli.

* event handling --&amp;gt; only ABAP Objects part,

set handler:lcl_event_handler=&amp;gt;on_double_click for ref_alv.


endif.

endmodule.                 " init_control_processing  OUTPUT

*---------------------------

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Include ZALV_ADV_TOP                                                *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
program  zalv_adv .

data: ok_code type sy-ucomm.

types: begin of ty_sflight.

include structure sflight.

types: percentage type i,

sign type c,

end of ty_sflight.

data: copy_ok_code like ok_code,

* control specific: object references

ref_container type ref to cl_gui_docking_container,

ref_alv type ref to cl_gui_alv_grid,

box_container type ref to cl_gui_dialogbox_container,

box_alv type ref to cl_gui_alv_grid,

* internal tables
it_spfli type table of spfli,

it_sflight type table of ty_sflight,

it_popup type table of ty_sflight,


* work areas

wa_spfli like line of it_spfli,

wa_sflight like line of it_sflight.

select-options:so_carr for wa_spfli-carrid no-extension no intervals.

select * from spfli into table it_spfli where carrid in so_carr

 order by carrid connid.

call screen '0100'.

* event handler class
*------------------------------------------------------------------*

* CLASS lcl_event_handler DEFINITION

*------------------------------------------------------------------*

class lcl_event_handler definition.

public section.

class-methods:

on_double_click for event double_click of cl_gui_alv_grid

importing e_row,

* -------------------------------------------------------------

on_close for event close of cl_gui_dialogbox_container

importing sender.

endclass.
*-----------------------------------------------------------------*

* CLASS lcl_event_handler IMPLEMENTATION

*-----------------------------------------------------------------*

class lcl_event_handler implementation.

method on_double_click.

* local data

data: wa_popup like line of it_popup.


* find out selected line (double click)

read table it_spfli into wa_spfli index e_row-index.

* copy corresponding flight data to it_popup

clear it_popup.

loop at it_sflight into wa_sflight

where carrid = wa_spfli-carrid

and connid = wa_spfli-connid.

insert wa_sflight into table it_popup.

endloop.

if sy-subrc ne 0.

select * from sflight into wa_sflight

where carrid = wa_spfli-carrid

and connid = wa_spfli-connid.

insert wa_sflight into table: it_sflight,

it_popup.

endselect.

endif.

if box_container is initial.

* create dialog box container

create object box_container

exporting width = 800 height = 200 top = 120 left = 120.

* set event handler for dialogbox container: --&amp;gt; close
*
set handler on_close for box_container.

endif.

if box_alv is initial.

* create avl grid object and link to dialogbox container

create object box_alv

exporting i_parent = box_container.

* send popup data to new alv object

call method box_alv-&amp;gt;set_table_for_first_display

exporting i_structure_name = 'SFLIGHT'

changing it_outtab = it_popup.


if sy-subrc &amp;lt;&amp;gt; 0.

message a012(bc412).

endif.

else. " do only refresh alv contents

call method box_alv-&amp;gt;refresh_table_display.

endif.

endmethod.

* -----------------------------------------------------------------

method on_close.

call method sender-&amp;gt;free.

free: box_container, box_alv.

endmethod.

endclass.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Raja T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Raja T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 03:52:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750699#M325495</guid>
      <dc:creator>raja_thangamani</dc:creator>
      <dc:date>2006-12-06T03:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: interactive reports with ALVS.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750700#M325496</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;TYPE-POOLS : slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF itab OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE t001.&lt;/P&gt;&lt;P&gt;DATA : flag tyPE c,&lt;/P&gt;&lt;P&gt;END OF itab.&lt;/P&gt;&lt;P&gt;DATA : alvfc TYPE slis_t_fieldcat_alv.&lt;/P&gt;&lt;P&gt;DATA : alvly TYPE slis_layout_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; Select Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM t001 INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*------- Field Catalogue&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_program_name = sy-repid&lt;/P&gt;&lt;P&gt;i_internal_tabname = 'ITAB'&lt;/P&gt;&lt;P&gt;i_inclname = sy-repid&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;ct_fieldcat = alvfc&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;inconsistent_interface = 1&lt;/P&gt;&lt;P&gt;program_error = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;Display&lt;/P&gt;&lt;P&gt;alvly-box_fieldname = 'FLAG'.&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_fieldcat = alvfc&lt;/P&gt;&lt;P&gt;i_callback_program = sy-repid "&amp;lt;-------Important&lt;/P&gt;&lt;P&gt;i_callback_user_command = 'ITAB_USER_COMMAND' "&amp;lt;------ Important&lt;/P&gt;&lt;P&gt;is_layout = alvly&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = itab&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL BACK FORM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE&lt;/P&gt;&lt;P&gt;slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; IMPORTANT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : m(100) type c.&lt;/P&gt;&lt;P&gt;m = whatrow-tabindex.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;condense m.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;concatenate 'Row Number is ' m into m separated by space.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*concatenate m ' : Field Clicked is ' whatrow-fieldname into m separated&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by space.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;message m type 'I'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;Display&lt;/P&gt;&lt;P&gt;alvly-box_fieldname = 'FLAG'.&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_fieldcat = alvfc&lt;/P&gt;&lt;P&gt;i_callback_program = sy-repid "&amp;lt;-------Important&lt;/P&gt;&lt;P&gt;i_callback_user_command = 'ITAB_USER_COMMAND' "&amp;lt;------ Important&lt;/P&gt;&lt;P&gt;is_layout = alvly&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = itab&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. "ITAB_user_command&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;A href="http://www.sapgenie.com/abap/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1871148"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1779747"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1455866"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1172693"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1699824"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RGDS,&lt;/P&gt;&lt;P&gt;SHAN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 03:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750700#M325496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T03:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: interactive reports with ALVS.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750701#M325497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at below link which gives you a source code to generate secondary list in ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://www.sap-img.com/abap/an-interactive-alv-report.htm"&amp;gt;Interactive ALV&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 03:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-reports-with-alvs/m-p/1750701#M325497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T03:54:45Z</dc:date>
    </item>
  </channel>
</rss>

