ALV tree - Displaying of footer
Hi Experts,
I have an ALV report which has a tree output.I want to display some text in the footer.How can I do that?
I searched a lot but I just got information on how to display the footer in an alv grid but nothing about alv tree.
Thanks in advance.
Regards,
Puja
hii puja,
check below code where ALV footer is printed which will display the selection screen parameter at bottom of output ________________________________________________________________ SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001. "General Selections SELECT-OPTIONS: s_bukrs FOR gs_knb1-bukrs NO INTERVALS OBLIGATORY, "Company code s_grupp for gv_grupp no intervals no-extension. "Customer credit group SELECT-OPTIONS: s_kunnr FOR gs_kna1-kunnr . "Customer number SELECTION-SCREEN: END OF BLOCK blk1. "General Selections SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME . SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 1(41) text-002. PARAMETERS : p_tmoney(3) TYPE c . "Target money at risk SELECTION-SCREEN END OF LINE. SELECTION-SCREEN: END OF BLOCK blk2. _______________________________________________________________ CLASS lcl_event_receiver DEFINITION. PUBLIC SECTION. METHODS: end_of_list FOR EVENT end_of_list OF cl_gui_alv_grid IMPORTING e_dyndoc_id. ENDCLASS. "lcl_event_receiver DEFINITION &---- *& CLASS IMPLEMENTATION &---- &---- * CLASS lcl_event_receiver IMPLEMENTATION &---- * Class implementation for TOP-OF-PAGE &---- CLASS lcl_event_receiver IMPLEMENTATION. METHOD end_of_list. "implementation DATA : lv_text TYPE sdydo_text_element, lv_tbmar(15) TYPE c, " All Customers Base Money at Risk lv_tmr(15) TYPE c, " Total Money at Risk lv_emr(15) TYPE c, " Excess Money at Risk lv_mtemr(15) TYPE c, " Monthly Target Excess Money at Risk lv_var(15) TYPE c, " Variance lv_bukrs TYPE bukrs, lv_grupp TYPE grupp_cm, lv_kunnr TYPE kunnr, lv_kunnr1 TYPE kunnr, lv_tmoney(6) TYPE c. * To display all the parameters in selection screen *Company code CALL METHOD go_dyndoc_id->new_line. CALL METHOD go_dyndoc_id->new_line. MOVE s_bukrs-low TO lv_bukrs. CONCATENATE text-027 lv_bukrs INTO lv_text SEPARATED BY space. CALL METHOD go_dyndoc_id->add_text EXPORTING text = lv_text sap_style = cl_dd_area=>key. *Customer Credit Group CALL METHOD go_dyndoc_id->new_line. MOVE s_grupp-low TO lv_grupp. CONCATENATE text-028 lv_grupp INTO lv_text SEPARATED BY space. CALL METHOD go_dyndoc_id->add_text EXPORTING text = lv_text sap_style = cl_dd_area=>key. *Customer Number CALL METHOD go_dyndoc_id->new_line. MOVE s_kunnr-low TO lv_kunnr. MOVE s_kunnr-high TO lv_kunnr1. IF lv_kunnr1 IS INITIAL. CONCATENATE text-029 lv_kunnr INTO lv_text SEPARATED BY space. ELSE. CONCATENATE text-029 lv_kunnr ' TO ' lv_kunnr1 INTO lv_text SEPARATED BY space. ENDIF. CALL METHOD go_dyndoc_id->add_text EXPORTING text = lv_text sap_style = cl_dd_area=>key. *Target Excess Money at risk CALL METHOD go_dyndoc_id->new_line. MOVE p_tmoney TO lv_tmoney. CONCATENATE text-030 lv_tmoney INTO lv_text SEPARATED BY space. CALL METHOD go_dyndoc_id->add_text EXPORTING text = lv_text sap_style = cl_dd_area=>key. IF go_html_cntrl IS INITIAL. CREATE OBJECT go_html_cntrl EXPORTING parent = go_parent_html. ENDIF. DATA: lv_background_id TYPE sdydo_key VALUE space. CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET' EXPORTING document = go_dyndoc_id bottom = space. CALL METHOD go_dyndoc_id->merge_document. CALL METHOD go_dyndoc_id->set_document_background EXPORTING picture_id = lv_background_id. go_dyndoc_id->html_control = go_html_cntrl. CALL METHOD e_dyndoc_id->display_document EXPORTING reuse_control = abap_true parent = go_parent_html EXCEPTIONS html_display_error = 1. IF sy-subrc 0. MESSAGE i014. ENDIF. ENDMETHOD. "END_OF_LIST ENDCLASS. "lcl_event_receiver IMPLEMENTATION _________________________________________________________ &---- *& Module mod_init_9000 OUTPUT &---- * Place the values from grid object to custom container for ALV display ---- MODULE mod_init_9000 OUTPUT. DATA: lo_event_receiver TYPE REF TO lcl_event_receiver."#EC * IF cl_gui_alv_grid=>offline( ) IS INITIAL. IF go_container IS INITIAL. * Create a custom container control for ALV control CREATE OBJECT go_container EXPORTING container_name = 'CN_GRID_CONTROL'. * Split Controls CREATE OBJECT go_splitter EXPORTING parent = go_container rows = 2 columns = 1. CALL METHOD go_splitter->set_row_height EXPORTING id = 1 height = 68. CALL METHOD go_splitter->get_container EXPORTING row = 2 column = 1 RECEIVING container = go_parent_html. CALL METHOD go_splitter->get_container EXPORTING row = 1 column = 1 RECEIVING container = go_parent_grid. * Create a ALV Control CREATE OBJECT go_grid EXPORTING i_parent = go_parent_grid. CREATE OBJECT go_dyndoc_id EXPORTING style = gc_style. "ALV_GRID PERFORM sub_fieldcat_layout. CREATE OBJECT lo_event_receiver. SET HANDLER lo_event_receiver->end_of_list FOR go_grid. CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid. * Set Table for first display PERFORM sub_table_display. CALL METHOD go_dyndoc_id->initialize_document. CALL METHOD go_grid->list_processing_events EXPORTING i_event_name = gc_event "END_OF_LIST i_dyndoc_id = go_dyndoc_id. ENDIF. ENDIF. ENDMODULE. " mod_init_9000 OUTPUT _____________________________________________________ &---- *& Form SUB_TABLE_DISPLAY &---- * Display the output ---- FORM sub_table_display . DATA gs_layo TYPE lvc_s_layo. gs_layo-zebra = abap_true. gs_layo-sel_mode = gc_save. CALL METHOD go_grid->set_table_for_first_display EXPORTING i_save = gv_save i_default = gc_Default is_layout = gs_layo CHANGING it_outtab = gt_final[] it_fieldcatalog = gt_fcat. ENDFORM. " SUB_TABLE_DISPLAY
regards,
Shweta
Similar Messages
-
Editable Field in ALV TREE Display Using OOPs
Hi,
I am trying to make a field editable on the ALV Tree display. I could create an editable check box. But could not make a field Editable. I have made EDIT = 'X' in the fieldcatalog for the particular field. but it is not working.
Please help me in solving this. Its very urgent.You do this with the following code example
DATA: ls_layout TYPE lvc_s_layi.
CLEAR ls_layout.
ls_layout-class = cl_item_tree_control=>item_class_text.
ls_layout-editable = 'X'.
ls_layout-fieldname = your fieldname.
APPEND ls_layout TO lt_layout.
add PO header to tree
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key = space
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_po_item
is_node_layout = wa_layout_node
it_item_layout = lt_layout
Roy -
Double click in ALV tree display....
Hi all,
I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
My code as of now is as below:
Please tell how to handle events in this report tree display and how and where to write the code for this functionlity of double click.
FORM alv_tree.
PERFORM build_sort_table. ----
table is sorted
create container for alv-tree
DATA: l_tree_container_name(30) TYPE c,
l_custom_container TYPE REF TO cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
create tree control
CREATE OBJECT tree1
EXPORTING
i_parent = l_custom_container
i_node_selection_mode =
cl_gui_column_tree=>node_sel_mode_multiple
i_item_selection = 'X'
i_no_html_header = ''
i_no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
create info-table for html-header
DATA: lt_list_commentary TYPE slis_t_listheader.
PERFORM build_comment USING
lt_list_commentary. ----
already created
repid for saving variants
DATA: ls_variant TYPE disvariant.
ls_variant-report = sy-repid.
register events
PERFORM register_events.
create hierarchy
CALL METHOD tree1->set_table_for_first_display
EXPORTING
it_list_commentary = lt_list_commentary
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
CHANGING
it_sort = gt_sort[]
it_outtab = itab_outtab
it_fieldcatalog = t_fieldcat. "gt_fieldcatalog.
expand first level
CALL METHOD tree1->expand_tree
EXPORTING
i_level = 1.
optimize column-width
CALL METHOD tree1->column_optimize
EXPORTING
i_start_column = tree1->c_hierarchy_column_name
i_end_column = tree1->c_hierarchy_column_name.
ENDFORM. " alv_tree
FORM register_events.
define the events which will be passed to the backend
data: lt_events type cntl_simple_events,
l_event type cntl_simple_event.
define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_click.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
append l_event to lt_events.
call method tree1->set_registered_events
exporting
events = lt_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
ENDFORM. " register_eventshi
(also check u have refresh the field)
Check the demo program,In this double click the data fields it will display some field in screen,You can check it
BCALV_GRID_DND_TREE
Thanks
Edited by: dharma raj on Jun 17, 2009 7:41 PM -
Call Transaction in ALV Tree Display on Double Click
Hi Experts,
How can i call any Transaction on Double clicking a field in ALV Tree?
I'm able to call the transaction when Double clicked a field but it is not reading the value of the field on which i double click. It calls the transaction skipping the first screen with always the same value of the field.
E.g : Whether i click on Purchase order no. 450000010 or 450000003 it displays the purchase order 4500000010 after it goes to ME23N transaction skipping the first screen.
I am Trying Method ITEM_DOUBLE_CLICK of Class CL_GUI_COLUMN_TREE
by passing the parameter NODE_KEY.But it's not working.
Thanks & Regards,
Vinit Ranjanhi
(also check u have refresh the field)
Check the demo program,In this double click the data fields it will display some field in screen,You can check it
BCALV_GRID_DND_TREE
Thanks
Edited by: dharma raj on Jun 17, 2009 7:41 PM -
How to handle the check box in the alv tree display
Hello,
in my ALV Tree Report i have a check box in the output.
I have one check box in the selection screen as select all .
if this is selected then all the check boxes in the output must be selected that is (X).
am using CL_GUI_ALV_TREE for this.
Please give me some input how to make that check boxes 'X' in the above mentioned case.
With Regards,
Sumodh.PSumodh,
check this
Re: Select all checkbox in ALV tree
please search before posting
Thanks
Bala Duvvuri -
I need to create a hyperlink option in my ALV tree display output.
As the ALV output appears clicking on PO number --Hyperlink should take me a company's website.Can any just suggest me some info regarding the same???
Regarding making hyperlink in OOPs ALV
hyperlink in an column (ALV REPORT)
how to handle the hyperlink in alv
Please give me reward points
Thanks
Murali Poli -
Hi,
I have to make a list with three hierarchical levels.
By the 2nd level I know how.
My dout is how to add the 3rd hierarchical level?
The code i use is:
FORM create_alvtree_hierarchy .
DATA: ld_ebeln_key TYPE lvc_nkey,
ld_ebelp_key TYPE lvc_nkey,
ld_zekkn_key type lvc_nkey.
LOOP AT it_ekko INTO wa_ekko.
PERFORM add_ekko_node USING wa_ekko
CHANGING ld_ebeln_key.
LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln EQ wa_ekko-ebeln.
PERFORM add_ekpo_line USING wa_ekpo
ld_ebeln_key
CHANGING ld_ebelp_key.
LOOP AT it_ekbe INTO wa_ekbe WHERE ebeln EQ wa_ekpo-ebeln
AND ebelp EQ wa_ekpo-ebelp.
PERFORM add_ekbe_line USING wa_ekbe
ld_ebelp_key
CHANGING ld_zekkn_key.
ENDLOOP.
ENDLOOP.
ENDLOOP.
FORM add_ekko_node USING ps_ekko LIKE wa_ekko
value(p_relate_key)
CHANGING p_node_key.
DATA: ld_node_text TYPE lvc_value.
Set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
ls_item_layout-style = cl_gui_column_tree=>style_default.
ld_node_text = ps_ekko-ebeln.
APPEND ls_item_layout TO lt_item_layout.
Add node
CALL METHOD gd_tree->add_node
EXPORTING
i_relat_node_key = p_relate_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = ld_node_text
is_outtab_line = ps_ekko
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " ADD_EKKO_NODE
FORM add_ekpo_line USING ps_ekpo LIKE wa_ekpo
value(p_relate_key)
CHANGING p_node_key.
DATA: ld_node_text TYPE lvc_value.
Set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
ls_item_layout-style = cl_gui_column_tree=>style_default.
ld_node_text = ps_ekpo-ebelp.
APPEND ls_item_layout TO lt_item_layout.
Add node
CALL METHOD gd_tree->add_node
EXPORTING
i_relat_node_key = p_relate_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = ld_node_text
is_outtab_line = ps_ekpo
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " ADD_EKPO_LINE
Thanks in advance.
RuiHI!
TRY THIS CODE
TYPE-POOLS : fibs,stree.
TYPE-POOLS:slis.
DATA : t_node TYPE snodetext.
DATA : it_node LIKE TABLE OF t_node,
wa_node LIKE t_node.
DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
fs_fieldcat TYPE slis_fieldcat_alv.
DATA:w_repid LIKE sy-repid.
*Internal Table declarations
DATA: BEGIN OF fs_scarr,
carrid LIKE scarr-carrid,
END OF fs_scarr.
DATA:BEGIN OF fs_spfli,
carrid LIKE spfli-carrid,
connid LIKE spfli-connid,
END OF fs_spfli.
DATA:BEGIN OF fs_sflight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
END OF fs_sflight.
DATA:BEGIN OF fs_sbook,
carrid LIKE sbook-carrid,
connid LIKE sbook-connid,
fldate LIKE sbook-fldate,
bookid LIKE sbook-bookid,
END OF fs_sbook.
DATA:
t_scarr LIKE
TABLE
OF fs_scarr,
t_spfli LIKE
TABLE
OF fs_spfli,
t_sflight LIKE
TABLE
OF fs_sflight,
t_sbook LIKE
TABLE
OF fs_sbook.
START-OF-SELECTION.
PERFORM get_data.
PERFORM build_tree.
PERFORM display_tree.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT carrid
FROM scarr
INTO TABLE t_scarr.
SELECT carrid
connid
FROM spfli
INTO TABLE t_spfli
FOR ALL ENTRIES IN t_scarr
WHERE carrid EQ t_scarr-carrid.
SELECT CARRID
CONNID
FLDATE
FROM SFLIGHT
INTO CORRESPONDING FIELDS OF TABLE T_SFLIGHT
FOR ALL ENTRIES IN T_SPFLI
WHERE CONNID EQ T_SPFLI-CONNID.
ENDFORM. " GET_DATA
*& Form BUILD_TREE
* text
* --> p1 text
* <-- p2 text
FORM build_tree .
CLEAR: it_node,
wa_node.
SORT: t_scarr BY carrid,
t_spfli BY carrid connid,
t_sflight BY carrid connid fldate,
t_sbook BY carrid connid fldate bookid.
wa_node-type = 'T'.
wa_node-name = 'Flight Details'.
wa_node-tlevel = '01'.
wa_node-nlength = '15'.
wa_node-color = '4'.
wa_node-text = 'Flight'.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
LOOP AT t_scarr INTO fs_scarr.
wa_node-type = 'C'.
wa_node-name = 'CARRID'.
wa_node-tlevel = '02'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = fs_scarr-carrid.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
LOOP AT t_spfli INTO fs_spfli WHERE carrid EQ fs_scarr-carrid.
wa_node-type = 'C'.
wa_node-name = 'CONNID'.
wa_node-tlevel = '03'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = fs_spfli-connid.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
ENDLOOP.
LOOP AT t_sflight INTO fs_sflight WHERE connid eq fs_spfli-connid.
wa_node-type = 'C'.
wa_node-name = 'FLDATE'.
wa_node-tlevel = '04'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = fs_sflight-FLDATE.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
ENDLOOP.
ENDLOOP.
ENDFORM. " BUILD_TREE
*& Form DISPLAY_TREE
* text
* --> p1 text
* <-- p2 text
FORM display_tree .
CALL FUNCTION 'RS_TREE_CONSTRUCT'
* EXPORTING
* INSERT_ID = '000000'
* RELATIONSHIP = ' '
* LOG =
TABLES
nodetab = it_node
EXCEPTIONS
tree_failure = 1
id_not_found = 2
wrong_relationship = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
w_repid = sy-repid.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = w_repid
* callback_user_command = 'USER_COMMAND'
* CALLBACK_TEXT_DISPLAY =
* CALLBACK_MOREINFO_DISPLAY =
* CALLBACK_COLOR_DISPLAY =
* CALLBACK_TOP_OF_PAGE =
* callback_gui_status = 'SET_PF'
* CALLBACK_CONTEXT_MENU =
* STATUS = 'IMPLICIT'
* CHECK_DUPLICATE_NAME = '1'
* COLOR_OF_NODE = '4'
* COLOR_OF_MARK = '3'
* COLOR_OF_LINK = '1'
* COLOR_OF_MATCH = '5'
* LOWER_CASE_SENSITIVE = ' '
* MODIFICATION_LOG = ' '
* NODE_LENGTH = 30
* TEXT_LENGTH = 75
* TEXT_LENGTH1 = 0
* TEXT_LENGTH2 = 0
* RETURN_MARKED_SUBTREE = ' '
* SCREEN_START_COLUMN = 0
* SCREEN_START_LINE = 0
* SCREEN_END_COLUMN = 0
* SCREEN_END_LINE = 0
* SUPPRESS_NODE_OUTPUT = ' '
* LAYOUT_MODE = ' '
* USE_CONTROL = STREE_USE_LIST
* IMPORTING
* F15 =
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
* I_STRUCTURE_NAME =
* IS_LAYOUT =
* IT_FIELDCAT =
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = T_SFLIGHT
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_TREE -
Hi Experts ,
Could you suggest if we can use traffic lights in ALV tree Display and if possible program(T-code ) you have gone thorugh.
I already checked BCALV_TREE_06 , its totally different just showing icons .
Regards,
Karan
Edited by: Karan_Chowdary on Dec 24, 2011 7:28 AMFirst in your output table for ALV.. add the light coloum.
for example:
DATA: BEGIN OF IMARA OCCURS 0,
LIGHT(4) TYPE C,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MAKTX TYPE MAKT-MAKTX,
COLOR_LINE(4) TYPE C,
TCOLOR TYPE SLIS_T_SPECIALCOL_ALV, "cell
END OF IMARA.
Then in the get data section, you have to put if-else class and upate that column as follows
WRITE ICON_GREEN_LIGHT AS ICON TO IMARA-LIGHT.
The use that light column in the catalog section
Regards,
Venkat -
Hi,
I have an ALV Tree report developed using the OOPS. In my ALV Tree output, I have some buttons which will update the database after clicking. The data is correctly updating in the database. But, it is not getting updated in the ALV Tree display. That means, it is not REFRESHing the ALV Tree display. We have to again execute the program in order to see the updated output.
Could anyone please suggest me how to Refresh the ALV Tree display..?
We can't use the method 'REFRESH_TABLE_DISPLAY' as it is a PRIVATE method is the class CL_GUI_ALV_TREE.
Please share your valuable thoughts.
Thanks & Regards,
Paddu.Hi paddu.
please check out the link mentioned below,this will help u.
How to Refresh data on ALV tree
Regards
Theres -
How to provide Hotspot in ALV tree????
Hi experts,
I have provided a double click event in ALV tree display. As of now I am able to open the transactions when I click on some the fields in output. But now I want to have a hotspot on those fields. See plz help me with this.
This is my catalog:
** get fieldcatalog
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZPP_STR_BAR'
CHANGING
ct_fieldcat = t_fieldcat.
LOOP AT t_fieldcat INTO ls_fieldcat.
CASE ls_fieldcat-fieldname.
WHEN 'AUFNR'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-key = 'X'.
ls_fieldcat-scrtext_s = text-t21.
ls_fieldcat-tooltip = text-t01.
WHEN 'TXT'.
ls_fieldcat-outputlen = 40.
** ls_fieldcat-do_sum = 'X'.
ls_fieldcat-scrtext_s = text-t22.
ls_fieldcat-tooltip = text-t02.
WHEN 'CHARG'.
ls_fieldcat-outputlen = 16.
ENDCASE.
MODIFY t_fieldcat FROM ls_fieldcat.
ENDLOOP.
Is there any field in field catalog which i need to set?
or is there any event to provide hotspot?
<REMOVED BY MODERATOR>
Thanks in advance,
Sachin
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 2:31 PMhi,
You Can give hotspot using the Fieldcatalog.
hotspot_fieldname type slis_fieldname, " fieldname flag hotspot
key_hotspot(1) type c, " keys as hotspot " K_KEYHOT
Hope this helps u,
Reagrds,
Arunsri. -
Hi all,
I have a requirement to display the Data in ALV tree format with some fields as editable.I have to display data in 3 levels,which are of differents structures.
To achieve editable in ALV tree display,I have used ALV GRID along with Tree display but here in GRID the 3 levels data is of same structure,but my requirement is of different structures.
Inputs regarding this will be highly appreciated.
Thanks,
Sravanthi .VHi Simone,
Thanks for your quick reply,I have used this Class also but iam not able to get the Fields editable even though it has the method for EDITABLE feature.
Thanks,
Sravanthi.V -
Hi ,
i am doing a alv tree display. in which i want to display the average amount .but i find only do_sum. is there any possiblity to do average.
thanks,
madhuIn the 'end_of_list' event of the ALV you can calculate the avarage and display.
Ex:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_html_end_of_list = 'END_OF_LIST_HTML'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
*& Form end_of_list_html
output at the end of the list - not in printed output *
FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
calculate the avarage and display.
ENDFORM. "end_of_list_html. -
Editing of a Column of ALV Tree(OOPS) node
is it possible to edit a column of node of ALV tree.
i am using ALV class "CL_GUI_ALV_TREE".
After searching existing threads, for the same issue..i found the following.
1) Editable Tree ALV
( displays pop up window where user can change values and then transfer these changes back to ALV tree)
2) Editable Field in ALV TREE Display Using OOPs
(this approach is not working for ALV Tree)
But i want to edit directly coulmn of a node of ALV tree.
is it possible in OOPS ALV Tree?
if it possible, can any one provide the sample code,As you already noticed, this is not possible, but you may edit your fields outside the tree and bring your changes back to tree. I struggled with the same once but eventually used described alternative. If you use saplink you may check upgrade [chain and rename|http://code.google.com/p/saplink-chain-and-rename/downloads/list] where this approach is released. The code is free so you will be able to study and copy whatever you need from it.
Editing in a pop up is also an alternative here.
Regards
Marcin -
Hi everyone!
I have this ALV Tree report and need to implement the Footer on the end of the report.
Did you already have the same problem?
I am open for suggestions...
Thanks in advance,
Leandrocheck below code where ALV footer is printed which will display the selection screen parameter at bottom of output
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
"General Selections
SELECT-OPTIONS: s_bukrs FOR gs_knb1-bukrs NO INTERVALS OBLIGATORY, "Company code
s_grupp for gv_grupp no intervals no-extension. "Customer credit group
SELECT-OPTIONS: s_kunnr FOR gs_kna1-kunnr . "Customer number
SELECTION-SCREEN: END OF BLOCK blk1. "General Selections
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(41) text-002.
PARAMETERS : p_tmoney(3) TYPE c . "Target money at risk
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK blk2.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: end_of_list
FOR EVENT end_of_list
OF cl_gui_alv_grid
IMPORTING e_dyndoc_id.
ENDCLASS. "lcl_event_receiver DEFINITION
*& CLASS IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION
Class implementation for TOP-OF-PAGE
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD end_of_list. "implementation
DATA : lv_text TYPE sdydo_text_element,
lv_tbmar(15) TYPE c, " All Customers Base Money at Risk
lv_tmr(15) TYPE c, " Total Money at Risk
lv_emr(15) TYPE c, " Excess Money at Risk
lv_mtemr(15) TYPE c, " Monthly Target Excess Money at Risk
lv_var(15) TYPE c, " Variance
lv_bukrs TYPE bukrs,
lv_grupp TYPE grupp_cm,
lv_kunnr TYPE kunnr,
lv_kunnr1 TYPE kunnr,
lv_tmoney(6) TYPE c.
To display all the parameters in selection screen
*Company code
CALL METHOD go_dyndoc_id->new_line.
CALL METHOD go_dyndoc_id->new_line.
MOVE s_bukrs-low TO lv_bukrs.
CONCATENATE text-027 lv_bukrs INTO lv_text SEPARATED BY space.
CALL METHOD go_dyndoc_id->add_text
EXPORTING
text = lv_text
sap_style = cl_dd_area=>key.
*Customer Credit Group
CALL METHOD go_dyndoc_id->new_line.
MOVE s_grupp-low TO lv_grupp.
CONCATENATE text-028 lv_grupp INTO lv_text SEPARATED BY space.
CALL METHOD go_dyndoc_id->add_text
EXPORTING
text = lv_text
sap_style = cl_dd_area=>key.
*Customer Number
CALL METHOD go_dyndoc_id->new_line.
MOVE s_kunnr-low TO lv_kunnr.
MOVE s_kunnr-high TO lv_kunnr1.
IF lv_kunnr1 IS INITIAL.
CONCATENATE text-029 lv_kunnr INTO lv_text SEPARATED BY space.
ELSE.
CONCATENATE text-029 lv_kunnr ' TO ' lv_kunnr1 INTO lv_text SEPARATED BY space.
ENDIF.
CALL METHOD go_dyndoc_id->add_text
EXPORTING
text = lv_text
sap_style = cl_dd_area=>key.
*Target Excess Money at risk
CALL METHOD go_dyndoc_id->new_line.
MOVE p_tmoney TO lv_tmoney.
CONCATENATE text-030 lv_tmoney INTO lv_text SEPARATED BY space.
CALL METHOD go_dyndoc_id->add_text
EXPORTING
text = lv_text
sap_style = cl_dd_area=>key.
IF go_html_cntrl IS INITIAL.
CREATE OBJECT go_html_cntrl
EXPORTING
parent = go_parent_html.
ENDIF.
DATA: lv_background_id TYPE sdydo_key VALUE space.
CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
EXPORTING
document = go_dyndoc_id
bottom = space.
CALL METHOD go_dyndoc_id->merge_document.
CALL METHOD go_dyndoc_id->set_document_background
EXPORTING
picture_id = lv_background_id.
go_dyndoc_id->html_control = go_html_cntrl.
CALL METHOD e_dyndoc_id->display_document
EXPORTING
reuse_control = abap_true
parent = go_parent_html
EXCEPTIONS
html_display_error = 1.
IF sy-subrc <> 0.
MESSAGE i014.
ENDIF.
ENDMETHOD. "END_OF_LIST
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*& Module mod_init_9000 OUTPUT
Place the values from grid object to custom container for ALV display
MODULE mod_init_9000 OUTPUT.
DATA: lo_event_receiver TYPE REF TO lcl_event_receiver."#EC *
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
IF go_container IS INITIAL.
Create a custom container control for ALV control
CREATE OBJECT go_container
EXPORTING
container_name = 'CN_GRID_CONTROL'.
Split Controls
CREATE OBJECT go_splitter
EXPORTING
parent = go_container
rows = 2
columns = 1.
CALL METHOD go_splitter->set_row_height
EXPORTING
id = 1
height = 68.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_parent_html.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_parent_grid.
Create a ALV Control
CREATE OBJECT go_grid
EXPORTING
i_parent = go_parent_grid.
CREATE OBJECT go_dyndoc_id
EXPORTING
style = gc_style. "ALV_GRID
PERFORM sub_fieldcat_layout.
CREATE OBJECT lo_event_receiver.
SET HANDLER lo_event_receiver->end_of_list FOR go_grid.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = go_grid.
Set Table for first display
PERFORM sub_table_display.
CALL METHOD go_dyndoc_id->initialize_document.
CALL METHOD go_grid->list_processing_events
EXPORTING
i_event_name = gc_event "END_OF_LIST
i_dyndoc_id = go_dyndoc_id.
ENDIF.
ENDIF.
ENDMODULE. " mod_init_9000 OUTPUT
*& Form SUB_TABLE_DISPLAY
Display the output
FORM sub_table_display .
DATA gs_layo TYPE lvc_s_layo.
gs_layo-zebra = abap_true.
gs_layo-sel_mode = gc_save.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_save = gv_save
i_default = gc_Default
is_layout = gs_layo
CHANGING
it_outtab = gt_final[]
it_fieldcatalog = gt_fcat.
ENDFORM. " SUB_TABLE_DISPLAY
Rewards if useful..........
Minal Nampalliwar -
How to avoid blank column display in output in ALV TREE
how to avoid blank column display in output while decreasing the length of other columns in ALV Tree.
Example: please refer to BCALV_TREE_01 and see the output, then decrease the length of all columns . Then you can see a blank column appearing in screen at last, i.e in container. so how to avoid that.
Thanks for reply.
Edited by: morpeous on Jul 1, 2009 1:53 PMHi,
Check BCALV_TREE_02 on how to hide columns.
Thanks & Regards,
Anand Patil
Maybe you are looking for
-
Auto Update configuration values in PO
Hi all,, For Configurable material we have characteristics values. In PO, we have nth number of Material item and each item have different characteristics values. User has to manually maintained characteristics values at each item level. Can't it be
-
Memory leak in Waveform Graph?
Either thier is a huge memory leak in the waveform graph or I am really doing something wrong. I created an example app with a waveform graph and a button the contructor looks as follows: Form1(void) InitializeComponent(); vals = gcnew array<double>(
-
Error in exporting project in OSB 11.1.5
Hi All, I am facing problem while exporting my resource in OSB console. The export failed with exception: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/sy
-
When is global context memory freed?
Hi: I've got a package that I call for each user on logon that gets their unique ID and then sets values particular to that user in a global context after setting the CLIENT_IDENTIFIER for the session. I'm basically using the "One Big App User" appro
-
Purchasing external monitor for macbook
I am interested in purchasing an external monitor for my white 2.2 gig macbook. I would appreciate any suggestions or ideas including estimated prices. Thank you.