How to alter the alv tree node text?
hi
i want to alter the alv tree node text, many people say it cann't be changed, but
i look into the sample code 'BCALV_TREE_04', the average funtion(select a column and then select average function in the tool bar) can alter the tree node text dynamically.
i try to look into the source code, the it's the sap standard code, all the funtions that user input, it goes to the statement " CALL METHOD cl_gui_cfw=>dispatch.", and i don't understand what this statement do, can someone helps me?
hi
good
The ALV tree report produces uses OBJECT METHOD functionality in-order to produce a
tree structured ALV output.
The creation of an ALVtree report first requires the creation of a simple program to build the ALV
details such as the fieldcatalog and to call a screen which will be used to display the ALVTree.
The screen should be created with a 'custom control' where you wish the ALVtree report to appear.
For the following example it will have the name 'SCREEN_CONTAINER'.
http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
reward point if helpful.
thanks
mrutyun^
Similar Messages
-
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 set the default tree node in JTree?
I want to set a default tree node in JTree when start the program,
what is the method or the function to call?
Thanks~If you by "default" mean "selected", then you can use one of the setSelectionXXX methods in the JTree API.
If you by "default" mean something else, never mind this post :-) -
Highlight the selected Tree Node
Hello Everyone,
Can someone plz tell me how to highlight the selected tree node ?
After selection, user should be able to see which node was last selected.
ThanksHello,
for me it is not really clear what you have done. Sorry!
Because I have problems to paste code, I will describe how you can test that function.
Take the BSP application HTMLB_SAMPLES and copy it to ZHTMLB_SAMPLES. Take page "treeviewSample.htm" and add the following node behind node22:
<htmlb:treeNode id = "node23"
text = "Node 2.2, normal text"
selection="PRIMARYSELECTION">
Perhaps this will show you how it works and help you.
As far as I can see the attribute "selection" can't be set via table.
Best regads
Renald
Edited by: Renald Wittwer on Jan 21, 2010 1:36 PM -
Hello!
I'm trying to create a kind of a navigation tree for my application.
It should represent some elements of an XML structure and some other nodes for other options.
The binding with the context is not a problem, I can create the tree up to all the levels I want to.
The problem now is, that I don't know, how to get the "current tree element", when there is any action.
For example:
public void onActionSelect(...) {
String test = wdContext.currentTreeNodeElement().getText();
wdThis.wdGetContext().currentContextElement().setSelectedElement(test);
With this method I can get the text of the "first level nodes". If I want to get the "second level node", I can do
String test = wdContext.currentTreeNodeElement().currentChildElement.getText();
..and for the next levels so on.
Isn't there any general method to get the information of the selected element without knowing before, whether it is a nodeElement or a nodeElement.currentChildElement or a nodeElement.currentChildElement.currentChildElement, ...?
Greetings,
RamóHi,
if you following that pdf ,
i think your not implemented the below code in DomodifyView method
if (firstTime) {
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TheNode");
/* The following line is necessary to create parameter mapping from parameter "path" to parameter "selectedElement".
Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
that raised the onAction event. Parameter "selectedElement" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
that handles the onAction. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
be accessed within the event handler
treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
/* The following line is necessary to create parameter mapping from parameter "path" to parameter "element".
Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
that raised the onLoadChildren event. Parameter "element" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
that handles the onLoadChildren. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
be accessed within the event handler
treeNode.mappingOfOnLoadChildren().addSourceMapping("path", "element");
please cross check once.
Thanks,
Ramesh -
How to download the ALV Hierchial Tree Data to an Excel sheet.
Hi All,
Can any body please let me ,if there is any possibility to know How to download the ALV Hierchial Tree Data to an Excel sheet.
If yes, please let me know how could this can b acheived.
Regards,
Rohini.Hi Rohini
There is no such functionality provided by SAP to download ALV Tree Hierarichal Tree into excel sheet .
If you had this kind of senario then i can propose one solution create two radio buttons one is to display in ALV Tree Format and the other is classical report which you can download it for futher process
Regards
Hitesh Batra -
Af:tree - how do I highlight the selected tree node?
af:tree
I checked the generated CSS file. I found that when a tree node is selected, the related CSS attribute is:
.xj:link{
font-family:Arial,Helvetica,Geneva,sans-serif;
font-size:10pt;
font-weight:normal;
color:#663300
I created a customized CSS attribute, but then all of the links have the customized CSS attributes.
How do I just highlight the selected tree node link?
Thanks,
--Toddtry doing the onclick javascript method
you have to place it on the node element and id must be made dynamic
for this use 'this.id'
by which the current id of the node is passed
and by capturing the id name in a var
use the same for invoking its selected property and make it true
like this
var currentid = this.id;
this.form.currentid.selected = true; -
How can I edit the selected tree node immediately?
I have completed a popup menu ,which appeares when I have a mouse rightclicked event
over the selected tree node.when I selected the popup menu item,i can edit the tree node ,but
I feel that the tree celleditor appear slowly ,what should i do? the following is my code:
menuItemRenameNode.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
renameNode_ActionPerformed(ae);
void renameNode_ActionPerformed(ActionEvent ae){
setEditable(true);
this.getCellEditor().addCellEditorListener(new CellEditorListener(){
public void editingCanceled(ChangeEvent e){
CellEditor cellEditor =(CellEditor)e.getSource();
System.out.println("editing canceled:"+cellEditor.getCellEditorValue().toString());
protected boolean canEditImmediately(EventObject e){
return true;
public void editingStopped(ChangeEvent e){
CellEditor cellEditor =(CellEditor)e.getSource();
System.out.println("editing stopped:"+cellEditor.getCellEditorValue().toString());Please check the suggestions in the thread: https://forums.adobe.com/thread/692020?tstart=0
Regards,
| T. Ravi Kumar -
Hi All,
I have this requirement.
On ALV Tree node, when user places cursor then i should display some text as quick info.
while create node i have used ICON <- left arrow, i cannot use other ICOn as functional person need this icon only.
During Add_Node, if I pass icon through node layout then its showing nothing, Instead if I pass icon through item layout, then its showing SAP standard ICON text left arrow , but i need custom text write text there.
I tried using Context_menu_req as well, even that didnt worked. Any ideas/views will be highly appreciated.
Thanks n RegardsHi Mr A.
You can try the following:
DATA: l_node_text TYPE lvc_value.
DATA: ls_item_layo TYPE lvc_s_layi,
lt_item_layo TYPE lvc_t_layi.
l_node_text = 'UR Text'
ls_item_layo-style = gs_detail-color_code.
ls_item_layo-t_image = gs_detail-icon.
APPEND ls_item_layo TO lt_item_layo.
After the above mentioned statement, you may call 'Add Node' method of ALV Tree.
Regards
Waz -
How to get the following-sibling nodes until a specific node
XSL people,
I need to get all the following-sibling nodes for every <h> node until the next <h> node.
Example:
<body>
<h>Header1</h>
<a>Line 11</a>
<b>Line 12</b>
<c>Line 13</c>
<a>Line 14</a>
<h>Header2</h>
<a>Line 21</a>
<c>Line 22</c>
<a>Line 23</a>
<b>Line 24</b>
</body>
So I need to get this strings:
from the first <h> node: Line 11Line 12Line 13Line 14
from the second <h> node: Line 21Line 22Line 23
When using following-sibling
<xsl:value-of select="following-sibling::a"/>
<xsl:value-of select="following-sibling::b"/>
<xsl:value-of select="following-sibling::c"/>
I am not getting the second <a> node (of course!), so for the first <h> node I am only getting
Line 11Line 12Line 13
and not
Line 11Line 12Line 13Line 14
and I don't know how to get it.
Thank you.
Anatoliy SmirnovThanks Sudipto for trying to help. I did try that, and as I mentioned in the previous posting, it doesn't work for the tree nodes (multiple RowSetIterator). the following is my code, where the treeVO is the vo instance for the firstLevel tree nodes and it has view link to its children. I am not sure how to sort all children for each level. Even for the first level where I did the explicit sorting in memory, it still not sorting at all.
treeVO.setSortBy("code");
treeVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS|ViewObject..QUERY_MODE_SCAN_DATABASE_TABLES);
treeVO.executeQuery(); -
How to get Value of tree node without Reload Page
hi,
i worked with apex 4.2 and i created Tree and tabular form to retrieve the date according the value of tree select node the code of tree something like this
select case when connect_by_isleaf = 1 then 0
when level = 1 then 1
else -1
end as status,
level,
"ENAME" as title,
null as icon,
"EMPNO" as value,
null as tooltip,
'f?p=36648:34:5234984107903::::P40_SELECTED_NODE:'||empno as link
from "DEPT"."EMP"
start with "MGR" is null
connect by prior "EMPNO" = "MGR"
order siblings by "ENAME
and i put Selected Node Page Item: P40_SELECTED_NODE . the tree worked good and retrieve the data into tabular form according to tree node value
my Question :
1- i want to retrieve the data without submit the page where each time i select value from tree make page reload to update the tabular form with new value ,there is any way to pass the value of tree node to P40_SELECTED_NODE item and refresh tabular form without page reload .
2- i want when selected from tree run page process according to value of tree node i tray to create Dynamic action with *(jquery selector : div.tree li>a)* but the Value of node incorrect.
Regards
Ahmed;look at this link
Re: How to get Value of tree node without Reload Page ..! -
CTE for Count the Binary Tree nodes
i have the table structure like this :
Create table #table(advId int identity(1,1),name nvarchar(100),Mode nvarchar(5),ReferId int )
insert into #table(name,Mode,ReferId)values('King','L',0)
insert into #table(name,Mode,ReferId)values('Fisher','L',1)
insert into #table(name,Mode,ReferId)values('Manasa','R',1)
insert into #table(name,Mode,ReferId)values('Deekshit','L',2)
insert into #table(name,Mode,ReferId)values('Sujai','R',2)
insert into #table(name,Mode,ReferId)values('Fedric','L',3)
insert into #table(name,Mode,ReferId)values('Bruce','R',3)
insert into #table(name,Mode,ReferId)values('paul','L',4)
insert into #table(name,Mode,ReferId)values('walker','R',4)
insert into #table(name,Mode,ReferId)values('Diesel','L',5)
insert into #table(name,Mode,ReferId)values('Jas','R',5)
insert into #table(name,Mode,ReferId)values('Edward','L',6)
insert into #table(name,Mode,ReferId)values('Lara','R',6)
select *from #table
How do i write the CTE for count the Binary tree nodes on level basis. Here is the example,
now,what i want to do is if i'm going to calculate the Count of the downline nodes.which means i want to calculate for '1' so the resultset which i'm expecting
count level mode
1 1 L
1 1 R
2 2 L
2 2 R
4 3 L
2 3 R
How do i acheive this,i have tried this
with cte (advId,ReferId,mode,Level)
as
select advId,ReferId,mode,0 as Level from #table where advid=1
union all
select a.advId,a.ReferId,a.mode ,Level+1 from #table as a inner join cte as b on b.advId=a.referId
select *From cte order by Level
i hope its clear. Thank youSee Itzik Ben-Gan examples for the subject
REATE TABLE Employees
empid int NOT NULL,
mgrid int NULL,
empname varchar(25) NOT NULL,
salary money NOT NULL,
CONSTRAINT PK_Employees PRIMARY KEY(empid),
CONSTRAINT FK_Employees_mgrid_empid
FOREIGN KEY(mgrid)
REFERENCES Employees(empid)
CREATE INDEX idx_nci_mgrid ON Employees(mgrid)
SET NOCOUNT ON
INSERT INTO Employees VALUES(1 , NULL, 'Nancy' , $10000.00)
INSERT INTO Employees VALUES(2 , 1 , 'Andrew' , $5000.00)
INSERT INTO Employees VALUES(3 , 1 , 'Janet' , $5000.00)
INSERT INTO Employees VALUES(4 , 1 , 'Margaret', $5000.00)
INSERT INTO Employees VALUES(5 , 2 , 'Steven' , $2500.00)
INSERT INTO Employees VALUES(6 , 2 , 'Michael' , $2500.00)
INSERT INTO Employees VALUES(7 , 3 , 'Robert' , $2500.00)
INSERT INTO Employees VALUES(8 , 3 , 'Laura' , $2500.00)
INSERT INTO Employees VALUES(9 , 3 , 'Ann' , $2500.00)
INSERT INTO Employees VALUES(10, 4 , 'Ina' , $2500.00)
INSERT INTO Employees VALUES(11, 7 , 'David' , $2000.00)
INSERT INTO Employees VALUES(12, 7 , 'Ron' , $2000.00)
INSERT INTO Employees VALUES(13, 7 , 'Dan' , $2000.00)
INSERT INTO Employees VALUES(14, 11 , 'James' , $1500.00)
The first request is probably the most common one:
returning an employee (for example, Robert whose empid=7)
and his/her subordinates in all levels.
The following CTE provides a solution to this request:
WITH EmpCTE(empid, empname, mgrid, lvl)
AS
-- Anchor Member (AM)
SELECT empid, empname, mgrid, 0
FROM Employees
WHERE empid = 7
UNION ALL
-- Recursive Member (RM)
SELECT E.empid, E.empname, E.mgrid, M.lvl+1
FROM Employees AS E
JOIN EmpCTE AS M
ON E.mgrid = M.empid
SELECT * FROM EmpCTE
Using this level counter you can limit the number of iterations
in the recursion. For example, the following CTE is used to return
all employees who are two levels below Janet:
WITH EmpCTEJanet(empid, empname, mgrid, lvl)
AS
SELECT empid, empname, mgrid, 0
FROM Employees
WHERE empid = 3
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.lvl+1
FROM Employees as E
JOIN EmpCTEJanet as M
ON E.mgrid = M.empid
WHERE lvl < 2
SELECT empid, empname
FROM EmpCTEJanet
WHERE lvl = 2
As mentioned earlier, CTEs can refer to
local variables that are defined within the same batch.
For example, to make the query more generic, you can use
variables instead of constants for employee ID and level:
DECLARE @empid AS INT, @lvl AS INT
SET @empid = 3 -- Janet
SET @lvl = 2 -- two levels
WITH EmpCTE(empid, empname, mgrid, lvl)
AS
SELECT empid, empname, mgrid, 0
FROM Employees
WHERE empid = @empid
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.lvl+1
FROM Employees as E
JOIN EmpCTE as M
ON E.mgrid = M.empid
WHERE lvl < @lvl
SELECT empid, empname
FROM EmpCTE
WHERE lvl = @lvl
Results generated thus far might be returned (but are not guaranteed to be),
and error 530 is generated. You might think of using the MAXRECURSION option
to implement the request to return employees who are two levels below
Janet using the MAXRECURSION hint instead of the filter in the recursive member
WITH EmpCTE(empid, empname, mgrid, lvl)
AS
SELECT empid, empname, mgrid, 0
FROM Employees
WHERE empid = 1
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.lvl+1
FROM Employees as E
JOIN EmpCTE as M
ON E.mgrid = M.empid
SELECT * FROM EmpCTE
OPTION (MAXRECURSION 2)
WITH EmpCTE(empid, empname, mgrid, lvl, sortcol)
AS
SELECT empid, empname, mgrid, 0,
CAST(empid AS VARBINARY(900))
FROM Employees
WHERE empid = 1
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.lvl+1,
CAST(sortcol + CAST(E.empid AS BINARY(4)) AS VARBINARY(900))
FROM Employees AS E
JOIN EmpCTE AS M
ON E.mgrid = M.empid
SELECT
REPLICATE(' | ', lvl)
+ '(' + (CAST(empid AS VARCHAR(10))) + ') '
+ empname AS empname
FROM EmpCTE
ORDER BY sortcol
(1) Nancy
| (2) Andrew
| | (5) Steven
| | (6) Michael
| (3) Janet
| | (7) Robert
| | | (11) David
| | | | (14) James
| | | (12) Ron
| | | (13) Dan
| | (8) Laura
| | (9) Ann
| (4) Margaret
| | (10) Ina
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to construct the component tree in my custom component?Help!
Hi, i am writing a custom component like this:
public class HtmlCategory extends HtmlPanelGrid
public void processRestoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
setColumns(1);
HtmlCommandLink link=new HtmlCommandLink();
link.setValue("Let's Bingo");
MyUtil.setActionListener(context,link,"#{temp.mytest}");
UIParameter param=new UIParameter();
param.setName("name");
param.setValue("Robin!");
link.getChildren().add(param);
param.setParent(link);
getChildren().add(link);
link.setParent(this);
super.processRestoreState(context,state);
} you see, i want to construct the compont tree at Restore View phase this way,because the structure of the component tree will always be the same, so i don't the user to write extra code.
But the children of the component are not rendered,the renderer of the HtmlCategory component just extends the HtmlGridRenderer(myfaces) directly,and always calls the "super" methods in the encode methods of the renderer.
I got a message from the console:
Wrong columns attribute for PanelGrid id0:id4: -2147483648
but i have set the columns attribute in the code above, so what's happening? or please give some advice about how to render the component tree by myself in Restore View with the tree constructing code in the custom component class code,just lke the code above.
Best Regards:)
RobinWell, i don't know if i have got my question clear.
usually, according to the tags you use in the jsf page, a component tree will be created at the Restore View phase,for example:
<f:form>
<h:panelGrid ...........>
<h:dataTable ................>
</h:dataTable>
</h:panelGrid>
</f:form>but because i am writing a component for my web app, all the child components and their attributes are not likely to change. so i want to reduce the tags into one custom tag, and construct the component tree internally by myself.But it is not the case of backing bean.So i wrote the the code in the method:
public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)as it is shown in my orginal message.But it seems that it is not right way to construct my component tree.So where should i put the code that construct the component tree?Overriding the method :
public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)is not the right way?
Best Regards:)
Robin -
How to do the ALV report output in groups and caluculate the tOTALS(URGENT
Hi
In my ALV report output .I have to group the output based on the DAYS field
0-10 days in one group
10-30 days in one group
above 30 days one group
There is also a field by name "AMOUNT" in my output.
I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
Thanks in AdvancePlease don't repost your questions...
Check out my answer in your other post.
How to make the ALV report in groups and caluculate the TOTALS
Regards,
Naimesh Patel -
How to send the ALV GRID output to spool by using the print button in std t
How to send the ALV GRID output to spool by using the print button in standard tool bar.
We have created a button in the va02 transaction. If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept. But i am unable to send the output to spool using the print button in the standard tool bar.
I am able to display the Print parameter dialog box but i am not able to send it to spool.
Kindly help.
Thanks In Advance.
G.V.RamanaHi Shaik,
There is not properties button in my print screen.
MODULE user_command_0900 INPUT.
WHEN 'EXCEL'.
PERFORM excel_download.
WHEN 'PRI'.
PERFORM print_output.
form Print_output.
CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
EXPORTING
columns = 80
device = 'ANY '
lines = 65
maxpenality = 1999
TABLES
layouts = lt_layouts1
EXCEPTIONS
unknown_device = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_layouts1.
IF lt_layouts1-penality < 1000 AND
lt_layouts1-penality < l_min_penality.
l_layout = lt_layouts1-layout.
l_min_penality = lt_layouts1-penality.
ENDIF.
ENDLOOP.
IF NOT l_layout IS INITIAL.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
line_size = 80 "#EC *
new_list_id = l_new_list_id
no_dialog = l_no_dialog
layout = l_layout
IMPORTING
out_archive_parameters = rs_arc_params
out_parameters = rs_pri_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0. " INS SLIN
ENDIF. " INS SLIN
IF rs_pri_params-linsz LT 80 OR
rs_pri_params-linsz LT gt_stack-s_lprint-width.
gt_stack-print_line_break = 'X'.
ELSE.
CLEAR gt_stack-print_line_break.
ENDIF.
IF l_valid NE 'X'.
rs_pri_params = ls_pri_params_sav.
rs_arc_params = ls_arc_params_sav.
ENDIF.
ENDIF.
ENDIF.
endform. " Print_output
CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
EXPORTING
is_layout = gs_layout_cost_tot_grand
CHANGING
it_fieldcatalog = gt_fcat_cost_tot_grand[]
it_outtab = gt_cost_tot_grand[].
Please check my code
Maybe you are looking for
-
Data mart cube to cube copy records are not matching in target cube
hI EXPERTS, Need help on the below questions for DATA Mart-Cube to cube copy(8M*) Its BW 3.5 system We have two financial cube. Cube A1 - Sourced through R/3 system (delta update) and Cube B1- Sourced through A1 cube.(Full update). These two cubes ar
-
My iTunes is just not working! Please help!
About a week ago, my iTunes just stopped working. When I tried to open it, I got that stupid Windoze message that iTunes had encountered a problem and had to close. And now I can't get it to work. I completely uninstalled both iTunes and QT and did a
-
HT202157 Apple TV & Computer stopped talking all of a sudden? Help
My Apple TV 2 cannot connect to my computer all of a sudden. They both have the latest software updated, I can access all except it won't link to the library on my computer. I have done the signal strength test all fine. Any ideas?
-
Is it possible to create a "daemon" using ABAP?
Hellos SAPients! How can I create a kind of "permanently running program" in ABAP? Is it possible? Any idea will be greatly appreciated. Thanks!
-
Playlist that does not contain artist of another playlist
Hello, How could you create a playlist that does not contain artist/album present in another playlist? I do not even know if it is possible : in that case, do you have any alternatives? Thank you very much for your answers. Regards,