‎2009 Apr 24 7:01 AM
Hi All,
In our requirement we are displaying the data in ALV Tree Using OOPS.
We need to achieve hot spot on one of the header field.
I am using Class 'CL_GUI_ALV_TREE'
Ex:
CreditAccnt/ Company codes DSO DDSO
26 15 15
8000 5 5
8545 10 10
In the above example for every credit accnt in header we r displaying the values ( DSO ,DDSO) for all company codes.
Now we require hot spot on Credit Accnt 26. Such that when user clicks on the credit accnt it should navigate to another transaction.
NOTE: we havent build any field catalogue for field CreditAccnt/ Company codes .
‎2009 Apr 24 8:13 AM
hi use this
https://wiki.sdn.sap.com/wiki/display/ABAP/ObjectModelALV-Interactive
https://wiki.sdn.sap.com/wiki/display/Snippets/ExampleaboutALV+Tree
‎2009 Apr 24 7:09 AM
Hi,
You can refer to the tutorial -
Or try using the code below-
*----
CLASS lcl_event_receiver DEFINITION
*----
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
Hot Spot Click
handle_hotspot
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id
e_column_id
es_row_no,
ENDCLASS.
Implementation
*&----
*& Method handle_hotspot
*&----
This method is called when the user clicks on a hotspot to drill down.
The following types are exported from the ALV
LVC_S_ROW
LVC_S_COL
LVC_S_ROID
*&----
METHOD handle_hotspot.
The hotspot processing coded in the form below.
PERFORM f9802_handle_hotspot USING e_row_id
e_column_id
es_row_no.
ENDMETHOD.
&----
*& Form f9802_handle_hotspot
&----
This form is called when the user clicks on a hotspot on the ALV grid
The parameters are of type
-
-->P_E_ROW text
-->P_E_COL text
-->P_E_ROID text
-
FORM f9802_handle_hotspot USING p_row
p_col
p_roid.
DATA: lw_output LIKE LINE OF i_output.
READ TABLE i_output INDEX p_row INTO lw_output.
SET PARAMETER ID 'MAT' FIELD lw_output-matnr.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDFORM. " f9802_handle_hotspot
FORM f9300_modify_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat.
Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.
LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'MATNR'.
<lfs_fieldcat>-hotspot = c_x.
<lfs_fieldcat>-key = c_x.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
ENDFORM.
In PBO,
module STATUS_9001 output.
Set handlers for events
SET HANDLER o_eventreceiver->handle_hotspot FOR o_Alvgrid.
ENDMODULE.
Hope this helps
‎2009 Apr 24 7:23 AM
Thanks for your reply...
But ,My case is ALV Tree. In Class 'cl_gui_alv_tree' There is no event for Hotspot.
‎2009 Apr 24 7:28 AM
‎2009 Apr 24 8:00 AM
Hi ,
you must be using g_alv->set_table_for_first_display , then pass fieldcatalog .
data : g_alv TYPE REF TO cl_gui_alv_tree.
DATA: ls_fieldcatalog TYPE lvc_s_fcat,
gt_fieldcatalog TYPE lvc_t_fcat..
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* i_structure_name = 'ZORDER' " if u have stucture then give the name
CHANGING
ct_fieldcat = gt_fieldcatalog.
LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
CASE ls_fieldcatalog-fieldname.
WHEN 'EBELN'. " in ur case ' CreditAccnt ' . change field name as per ur requirement
ls_fieldcatalog-hotspot = 'X'.
ENDCASE.
MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
ENDLOOP.
CALL METHOD g_alv->set_table_for_first_display
EXPORTING
is_hierarchy_header = l_hierarchy_header
CHANGING
it_fieldcatalog = gt_fieldcatalog " fill fieldcatalog.
it_outtab = gt_ekpo. "table must be empty !
hope this works.
Regards,
Aby
‎2009 Apr 24 8:13 AM
hi use this
https://wiki.sdn.sap.com/wiki/display/ABAP/ObjectModelALV-Interactive
https://wiki.sdn.sap.com/wiki/display/Snippets/ExampleaboutALV+Tree
‎2009 Apr 25 10:56 AM