Sap Alv Tree Change Cell Icons ?
How can i change this icons ?
Thanks & Regards...
Hello Burak,
in the node Table you can change image:
for example:
wa_node-n_image = icon_delete. "Folder closed
wa_node-exp_image = icon_delete. "Folder expanded
best regards
Werner
Similar Messages
-
ALV Tree - Change average value
Hi all,
I want to change the average value. For the follow example the hierarchy has 2 lines but it is a summarize of 13 lines. So the right average is (100.00 + 16.67) / 13
SAP average
Expectation:
I am using:
data: g_tree type ref to cl_gui_alv_tree_simple.
Is it possible to change it?
Regards,
AndréaHi,
Use CL_GUI_ALV_TREE method for creating the Tree, in that create each node by method ADD_NODE. With this method you can do calculation and update while building the ALV Tree.
Just refer the Demo program 'BCALV_TREE_DEMO'.
First get the final output table data.
Loop that table and create each node by using ADD_NODE method.
Thanks & Regards
Bala Krishna -
TP4 FileExplorer tree: change Folder icon when expanded/collapsed
I am trying to create a tree similar with FileExplorer from the Demo application. I am trying to use two icons for every node: one for expanded node and another one for collapsed.
I use a rowDisclosureListener tag
rowDisclosureListener="#{menuBean.menuRowDisclosureEvent}to fire an expand/collapse event. In a custom method menuRowDisclosureEvent(RowDisclosureEvent disclosureEvent) I retreive the selected node and programatically change the icon. The only thing is that the tree view itself is not refreshed on the same phase cycle. The node icons are refreshed only at the next requests.
Thanks,
/FlorinI have also tried to use:
AdfFacesContext.getCurrentInstance().addPartialTarget(tree);Didn't helped -
hello,
on a screen I have input fields such as year and below a container holding an ALV tree.
When I change the year value, that starts a new selection from a table and should result in changing many of the lines in the tree.
I was trying to use the methods "get_outtab_line" to retrieve the tree line data and then changing this data with method "change_node".
The problem is I cannot access the correct node-key. The node-key value is kept in memory somewhere and when I refresh the alv tree at PBO, the node-key is incremented from the stored value which means I cannot use get_outtab_line properly.
Any suggestions or example programs,
Thanks a lot,
KevinHi Kevin,
Try using method update_calculations instead of directly using frontend_update.
So the sequence should be,
IF NOT ref_tree IS INITIAL.
CALL METHOD ref_tree->free.
ENDIF.
CREATE OBJECT ref_tree...
CALL METHOD ref_tree->set_table_for_first_display...
****Data fill in a loop
CALL METHOD ref_tree->add_node..
****Expand if needed
CALL METHOD ref_tree->expand_node..
****Toolbar Logic if needed..
****Events Registration
****Finally call to update calculations
CALL METHOD ref_tree->update_calculations..
Hope this helps..
Sri -
Adf:tree change node icons
Hi ,
Is it possible to create adf tree like in this example - http://www.roseindia.net/jsf/RCFaces/RCF-tree-component.shtml.
There is two options for tree defaultExpandedImageURL and defaultImageURL . I need implement such functionality in adf tree
how can i do it ?
Thanks in advance.with help of : zero linecodes you can achieve this in adf tree.
so can you please tel the usecase. -
Report with ALV tree and ALV list?
I need to create a report with layout as same as this one
[http://trangiegie.com/MyFile/output.JPG]
It looks like a report with combination of ALV tree and list. The tree works like a navigation bar. Wonder if there are any demo programs like this. Will appreciate any help.For Tree alone - You can check program : BCALV_TREE_02
Program Name Report title
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
BCALV_TEST_SIMPLE_TREE Program BCALV_TEST_SIMPLE_TREE
BCALV_TREE_01 ALV Tree Control: Build Up the Hierarchy Tree
BCALV_TREE_02 ALV Tree Control: Event Handling
BCALV_TREE_03 ALV Tree Control: Use an Own Context Menu
BCALV_TREE_04 ALV Tree Control: Add a Button to the Toolbar
BCALV_TREE_05 ALV Tree Control: Add a Menu to the Toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree -
Drag and Drop between two ALV Tree.
Hi,
I am trying the drag and drop event between two ALV Tree.
After the occurence of drag and drop event , I am able to get the node key of the source tree node which is dragged . But when the node is dropped onto the target ALV Tree the target node does not gets selected, instead a plus mark appears focussing on the target node in the target ALV Tree. Can anyone suggest a way to get the node key of the focussed target node. Thanks.
Regards,
Prabaharanhey Prabaharan,
y don't u check this link once
u may get some idea
Re: ALV tree - change node text
Regards
Naveen -
Hi,
I 'm using an alv tree.
I need to change the toolbar to add an icon in which we have several choices as for example the icon "VARIANT" in wich we have 3 or 4 entries : "Save variant" (&SAVE), "Maintain variant" (&MAINTAIN), ...(&COL0") --> One icon and several choices
I'm using the method ADD_BUTTON from Class CL_GUI_TREE.
Can someone help me ?
thanksHi Robert
Hope below code can give you some idea:
*& Form CHANGE_TOOLBAR
FORM CHANGE_TOOLBAR .
DATA: TOOLBAR TYPE REF TO CL_GUI_TOOLBAR.
DATA: IT_BUTTON TYPE TTB_BUTTON.
CALL METHOD TREE1->GET_TOOLBAR_OBJECT
IMPORTING
ER_TOOLBAR = TOOLBAR.
CHECK NOT TOOLBAR IS INITIAL.
CALL METHOD TOOLBAR->ADD_BUTTON
EXPORTING
FCODE = ' '
ICON = ' '
BUTN_TYPE = CNTB_BTYPE_SEP
TEXT = ' '
QUICKINFO = 'This is Separator'.
CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
EXPORTING
FCODE = 'SUCC'
ICON = '@5B@'
BUTN_TYPE = CNTB_BTYPE_GROUP
TEXT = ' '
QUICKINFO = 'GREEN'
CHANGING
DATA_TABLE = IT_BUTTON.
CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
EXPORTING
FCODE = 'STOP'
ICON = '@5D@'
BUTN_TYPE = CNTB_BTYPE_GROUP
TEXT = ' '
QUICKINFO = 'WAIT'
CHANGING
DATA_TABLE = IT_BUTTON.
CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
EXPORTING
FCODE = 'ERR'
ICON = '@5C@'
BUTN_TYPE = CNTB_BTYPE_GROUP
TEXT = ' '
QUICKINFO = 'RED'
CHANGING
DATA_TABLE = IT_BUTTON.
CALL METHOD TOOLBAR->ADD_BUTTON_GROUP
EXPORTING
DATA_TABLE = IT_BUTTON.
ENDFORM. " CHANGE_TOOLBAR
Regards
Eswar -
Sort Icon/option in ALV tree repot using classes and methods
Hi all,
I have done an alv tree report using the class cl_gui_alv_tree
and i need to let users re-sort the report by using a sort icon(as visible in a normal alv report).Is there any possibility to create an icon and set the functionality such that the entire tree structure gets resorted depending upon the sort criteria?Please give me an example of doing so if there is an option.if u want without classes then i can give an example of Sort Icon/option.
example:-
DATA: wa_sortinfo TYPE slis_sortinfo_alv.
i_sortcat TYPE slis_t_sortinfo_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = report_id
i_grid_title = ws_title
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat[]
it_sort = i_sortcat
i_save = 'A'
it_events = i_events
TABLES
t_outtab = i_reportdata1
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.
PERFORM sortcat_init CHANGING i_sortcat.
FORM sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'EBELN'. (sales order)
wa_sortinfo-tabname = 'I_REPORTDATA1'.
wa_sortinfo-spos = 1. " First sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'EBELP'.
wa_sortinfo-tabname = 'I_REPORTDATA1'.
wa_sortinfo-spos = 2. " Sec sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
ENDFORM. " sortcat_init -
ALV Tree - Color Specific Column based on value in that cell?
Hi Forums,
I have searched the forum and I am unable to find the answer to my question.
I am using an ALV tree and I would like to color a cell RED is the value in the cell is negative.
I have set my field catalog to many different emphasize numbers and no luck either?
CLEAR ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'ORG_TXT'.
ls_fieldcatalog-coltext = text-d02.
ls_fieldcatalog-scrtext_m = text-d02.
ls_fieldcatalog-col_pos = 2.
ls_fieldcatalog-outputlen = '30'.
ls_fieldcatalog-no_out = 'X'.
ls_fieldcatalog-emphasize = 5.
APPEND ls_fieldcatalog TO et_fieldcatalog.
I am using
gr_alv_tree_control TYPE REF TO cl_gui_alv_tree
as my class to display my tree and I have found no methods that would set the color in there either?
What else could be checked?To those interested, i was able to color the TEXT of a First coloumn of the TREE. Using this code:
That said it will not work without BOTH
ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
ls_layout_item-style =
cl_gui_column_tree=>style_intensifd_critical.
IF ls_vip_display-vip_diff_tot > 0.
ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
ls_layout_item-style =
cl_gui_column_tree=>style_intensifd_critical.
ENDIF.
IF ls_vip_display-vip_diff > 0.
ls_layout_item-style =
cl_gui_column_tree=>style_intensifd_critical.
ENDIF.
ls_layout_item-t_image = '@GZ@'.
ls_layout_item-style =
cl_gui_column_tree=>style_intensifd_critical.
APPEND ls_layout_item TO lt_layout_item.
* add leaf nodes
CALL METHOD gr_alv_tree_control->add_node
EXPORTING
i_relat_node_key = lv_parent_id
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = lv_node_text
is_outtab_line = ls_vip_display
it_item_layout = lt_layout_item
is_node_layout = ls_node_layout
IMPORTING
e_new_node_key = lv_new_key
EXCEPTIONS
relat_node_not_found = 1
node_not_found = 2
OTHERS = 3.
Anybody else who can shed some light to why both are needed OR possibly how I can change the position of the colored text to a different cell?
Edited by: Keith Warnock on Feb 9, 2011 6:48 PM -
How to change the color of specific row in ALV tree
Hi,
I m using method set_table_for_first_display of a class CL_GUI_ALV_TREE.
The req is to change the color of specific row. Now can anybody tell me how to change the color of ALV tree. As in ALV tree and in this method 'set_table_for_first_display', there is no parameter IS_Layout.
Pls suggest...hi
hope this code will help you.
Reward if help.
REPORT zsharad_test1.
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.
*& Form BUILD_FIELDCATALOG
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
*& Form BUILD_LAYOUT
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
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_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
*& Form DATA_RETRIEVAL
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 -
To change the icon name displayed by default while an ALV is displayed.
Hi Experts ,
Need to change the icon name EXPORT displayed by default , while an ALV is displayed to Download to Excel.
How can this be achieved?
Regards.Hi,
You can copy the Status 'Standard' of the program 'SAPLKKBL' and create a Z. Change the icon name in the Z pf-status as wished. Now in the event slis_ev_pf_status_set of 'REUSE_ALV_GRID_DISPLAY' set the PF-Status to the Z that u created.
Regards,
Nikhil -
Editing a single cell at node level in Alv tree
Hi ,
I am a beginner in ALV tree.Can u please let me know if its possible to edit a single cell at the node level ?
Thanks in advance.
ArchnaCheck the Standard Program may it helpful BCALV_TREE_ITEMLAYOUT.
Kanagaraja L -
Icon in print preview of ALV tree
Hi friends,
I am not getting the icons in item level in the print preview of ALV tree output.
For example:
Execute BCALV_TREE_06 and see the print preview of the output. You can not see the icons in the print preview.
But i need it to be printed.
Guide me
venkateshHi Venkatesh,
you can see similar kind of folder icon in the view.
but you can't download or print them.
regards
vijay -
How to make editable cell in ALV TREE?
Hi all,
I have a problem to make the cell in item row (I mean not the cell in hierarchy columns and not in the node row) in ALV tree editable.
I know to make it in "normal" ALV, but my ALV is type class: cl_gui_alv_tree and the nodes are calculated in a sum.Can anyone help me to set the cell editable in ALV tree?
Thank you a lot!
Best regards,
Danijela Zivanovic
Message was edited by: Danijela ZivanovicHI,
To make a column editable, it will be sufficient to set the field <b>EDIT</b> in the field catalog. The ALV Grid perceives if there are some editable fields and adds buttons for editing purposes. If you do not need these new buttons
<u><i>if you want it in the Classes</i></u>
For this procedure; add the name of the field to the field FIELDNAME, and pass cl_gui_alv_grid=>mc_style_enabled to make a field editable and cl_gui_alv_grid=>mc_style_disabled to make a field non-editable,
<b>Example:</b>
FORM adjust_editables USING pt_list LIKE gt_list[] .
DATA ls_listrow LIKE LINE OF pt_list .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
LOOP AT pt_list INTO ls_listrow .
IF ls_listrow-carrid = 'XY' .
ls_stylerow-fieldname = 'SEATSMAX' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled . APPEND ls_stylerow TO lt_styletab .
ENDIF .
IF ls_listrow-connid = '02' .
ls_stylerow-fieldname = 'PLANETYPE' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled . APPEND ls_stylerow TO lt_styletab .
ENDIF .
INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles . MODIFY pt_list FROM ls_listrow .
ENDLOOP .
ENDFORM
Thanks
Sudheer
Maybe you are looking for
-
Greetings, I have the need to create a Java program using SWING or using a web interface with JSP/Servlets however one of the program modules requires the input of a C code that needs to be run. Is this possible? For example, In the module I have a T
-
Using mysql decode function in Java
Hi everybody, mysql documentation says: DECODE(crypt_str,pass_str) --> Decrypts the encrypted string crypt_str using pass_str as the password. crypt_str should be a string returned from ENCODE(). I used the above function in a Python script and had n
-
Form onsubmit ignored when using h:commandLink
Hi I was looking for a way to catch all form submission in javascript by automatically setting a method to each form.onsubmit. But I ran into trouble with h:commandLink. I tested using a simple example: <h:form onsubmit="alert(123);"> <h:commandButto
-
Problem while compiling Servlet
M using Tomcat. Environment variables : Variable :::::::::::::::: Values %TOMCAT_HOME% ::::::::::: C:\Tomcat\bin CLASSPATH :::::::::::::::: .;C:\jdk 1.4.2\lib;C:\jsdk2.1 \servlet.jar;C:\Tomcat\lib\servlet.jar; PATH ::::::::::::::::::::: ;C:\jdk 1.4.2
-
Database SP_SearchApp_CrawlStoreDB log size is increasing very large
HI in My sharepoint evironment i confiugred serarch service application and has sepreate search server every two three days, the database xyzSP_SearchApp_CrawlStoreDB_32fdb1522c5249088db8b09c1917dbec_log size is increasing up to 80 GB to 100 GB , ho