<?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 report code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640455#M607814</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How the following code useful for the same?&lt;/P&gt;&lt;P&gt;I have no idea.......we can call Transaction CO27 when double click on field of ALV output report.....&lt;/P&gt;&lt;P&gt;&lt;/P&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 pf_status_set using extab type slis_t_extab.&lt;/P&gt;&lt;P&gt;  set pf-status 'STD' excluding extab.&lt;/P&gt;&lt;P&gt;endform.                    "pf_status_set&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="11" type="ul"&gt;&lt;P&gt;calling transaction CO27 ******************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;form user_command using r_ucomm like sy-ucomm&lt;/P&gt;&lt;P&gt;rs_selfield type slis_selfield.&lt;/P&gt;&lt;P&gt;  case r_ucomm.&lt;/P&gt;&lt;P&gt;    when '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;      if rs_selfield-fieldname = 'AUFNR'.&lt;/P&gt;&lt;P&gt;        read table itab into wa_itab index rs_selfield-tabindex.&lt;/P&gt;&lt;P&gt;        submit ppiom000&lt;/P&gt;&lt;P&gt;         and return&lt;/P&gt;&lt;P&gt;        with p_profid eq 'PPPP'&lt;/P&gt;&lt;P&gt;         with s_aufnr eq wa_itab-aufnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;endform.                    "user_command&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2007 12:50:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-21T12:50:50Z</dc:date>
    <item>
      <title>ALV report code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640453#M607812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get results in rows &amp;amp; columnwise in ALV report. Suppose I select any field &amp;amp; double click , I want to call any function further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl' tell the example how to give this event action in code ??&lt;/P&gt;&lt;P&gt;Pl ' give sample examples.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 12:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640453#M607812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T12:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640454#M607813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Pushbuttons On The List&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;To make a cell to be displayed as a pushbutton, we have two steps. Firstly, insert a new inner table of type &amp;#147;LVC_T_STYL&amp;#148; into your list data table.&lt;/P&gt;&lt;P&gt;Inserting an inner table to store cell display styles&lt;/P&gt;&lt;P&gt;*--- Internal table holding list data&lt;/P&gt;&lt;P&gt;DATA BEGIN OF gt_list OCCURS 0 .&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE SFLIGHT .&lt;/P&gt;&lt;P&gt;DATA rowcolor(4) TYPE c .&lt;/P&gt;&lt;P&gt;DATA cellcolors TYPE lvc_t_scol .&lt;/P&gt;&lt;P&gt;DATA carrid_handle TYPE int4 .&lt;/P&gt;&lt;P&gt;DATA connid_handle TYPE int4 .&lt;/P&gt;&lt;P&gt;DATA cellstyles TYPE lvc_t_styl .&lt;/P&gt;&lt;P&gt;DATA END OF gtlist .&lt;/P&gt;&lt;P&gt;Fill this inner table for each field to be displayed as pushbutton.&lt;/P&gt;&lt;P&gt;A sample code to make the cell at row 7 and column &amp;#145;SEATSMAX&amp;#146; displayed as pushbutton&lt;/P&gt;&lt;P&gt;DATA ls_style TYPE lvc_s_styl .&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;READ TABLE gt_list INDEX 7 .&lt;/P&gt;&lt;P&gt;ls_style-fieldname = 'SEATSMAX' .&lt;/P&gt;&lt;P&gt;ls_style-style = cl_gui_alv_grid=&amp;gt;mc_style_button .&lt;/P&gt;&lt;P&gt;APPEND ls_style TO gt_list-cellstyles .&lt;/P&gt;&lt;P&gt;MODIFY gt_list INDEX 7 .&lt;/P&gt;&lt;P&gt;As usual, we state our list data table field related with styles in the layout structure at field &amp;#145;STYLEFNAME&amp;#146;.&lt;/P&gt;&lt;P&gt;e.g. ps_layout-stylefname = 'CELLSTYLES' .&lt;/P&gt;&lt;P&gt;Button click event is handled like hotspot click via the event &amp;#147;button_click&amp;#148; through its parameters &amp;#147;es_col_id&amp;#148; and &amp;#147;es_row_no&amp;#148; which contain the address of the clicked pushbutton cell.&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;Ravish&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if useful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 12:34:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640454#M607813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640455#M607814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How the following code useful for the same?&lt;/P&gt;&lt;P&gt;I have no idea.......we can call Transaction CO27 when double click on field of ALV output report.....&lt;/P&gt;&lt;P&gt;&lt;/P&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 pf_status_set using extab type slis_t_extab.&lt;/P&gt;&lt;P&gt;  set pf-status 'STD' excluding extab.&lt;/P&gt;&lt;P&gt;endform.                    "pf_status_set&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="11" type="ul"&gt;&lt;P&gt;calling transaction CO27 ******************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;form user_command using r_ucomm like sy-ucomm&lt;/P&gt;&lt;P&gt;rs_selfield type slis_selfield.&lt;/P&gt;&lt;P&gt;  case r_ucomm.&lt;/P&gt;&lt;P&gt;    when '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;      if rs_selfield-fieldname = 'AUFNR'.&lt;/P&gt;&lt;P&gt;        read table itab into wa_itab index rs_selfield-tabindex.&lt;/P&gt;&lt;P&gt;        submit ppiom000&lt;/P&gt;&lt;P&gt;         and return&lt;/P&gt;&lt;P&gt;        with p_profid eq 'PPPP'&lt;/P&gt;&lt;P&gt;         with s_aufnr eq wa_itab-aufnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;endform.                    "user_command&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 12:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640455#M607814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T12:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640456#M607815</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;take help' of  this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTESTDEMO_INTERACTIVE_LIST_2
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  ZTESTDEMO_INTERACTIVE_LIST_2.

TABLES: MARA,MARC,MARD.


* internal table itab_mara 3 fields matnr, ernam,mtart
DATA: BEGIN OF ITAB_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,  " material number
ERNAM LIKE MARA-ERNAM,  " name of person who create
MTART LIKE MARA-MTART,  " Material Type
END OF ITAB_MARA.

* internal table itab_marc 3 fields matnr, werks,lvorm

DATA: BEGIN OF ITAB_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,  " Plant
LVORM LIKE MARC-LVORM,  " Flag Material for Deletion at Plant Level
END OF ITAB_MARC.

* internal table itab_mard 2 fields

DATA: BEGIN OF ITAB_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,  " Storage Location
END OF ITAB_MARD.

SELECT-OPTIONS: S_MTART FOR MARA-MTART.

INITIALIZATION.

S_MTART-LOW = 'HALB'.
S_MTART-HIGH = 'HAWA'.
S_MTART-OPTION = 'BT'.
APPEND S_MTART.

START-OF-SELECTION.

SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
S_MTART.

PERFORM DISPLAY.


TOP-OF-PAGE.
WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.


FORM DISPLAY.

LOOP AT ITAB_MARA.
WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
HIDE: ITAB_MARA-MATNR.
ENDLOOP.

ENDFORM.

AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.

SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
ITAB_MARA-MATNR.
PERFORM DISPLAY1.

WHEN 2.

SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
ITAB_MARC-MATNR.
PERFORM DISPLAY2.

when 3.
sy-lsind = 0.
ENDCASE.

FORM DISPLAY1.
LOOP AT ITAB_MARC.
WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
HIDE: ITAB_MARC-MATNR.
ENDLOOP.

WRITE:/ SY-LSIND.
ENDFORM.

FORM DISPLAY2.
LOOP AT ITAB_MARD.
WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
ENDLOOP.
WRITE:/ SY-LSIND.

ENDFORM.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravish&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;plz reward points if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 12:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640456#M607815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T12:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640457#M607816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See following link for various simple examples of ALV grid functionality&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 13:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-code/m-p/2640457#M607816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T13:41:42Z</dc:date>
    </item>
  </channel>
</rss>

