On Lead Selection for table.
Hi,
Can u provide me with some sample snippets of how to implement On Lead Selection.
The requirement brief : I have to populate another table wrt the selection made on the first table.
Regards
Piyush Deora
Hi,
Once you get create the table UI element, there is a property defined called "visible". create a context with element type wdy_boolean and bind the context to this property.
Set the property to abap_false initially, so that the table is invisible and on lead select, set the property to abap_true, so that the secondary table is visisble
IF itab_sflight is INITIAL.
get single attribute
WD_CONTEXT->SET_ATTRIBUTE(
EXPORTING
NAME = 'FLAG'
VALUE = ABAP_FALSE ).
ELSE.
WD_Context->set_Attribute(
exporting
Name = `FLAG`
Value = ABAP_TRUE ).
Similar Messages
-
Disable Lead selection for table row cloumn
HI Team,
I have table with multiple rows and multiple columns.
Based on the lead selection of the row we are displaying the some form.
But in table row there are some columns like enter date, when the user is trying to enter the date, it displaying the form because of lead selection and it is not allowing the user to enter the date.
So, I want disable the lead selection for some columns.
How can I do this?
Regards,
BAlaHi
I think that you can get the UI Table in the wdDoModifyView method, and then the UI Column and play with his values, is something like this:
IWDTable table =(IWDTable)view.getElement( ");
And then play with the "column" methods.
Josué Cruz -
Unable to lead select the table
Hi All ,
i i have some requirement something like this i have three table side by side in a view when i select the row of the first table the data in the second table should be dislayed and similarly for the third table as well .
Now my problem is when i am lead selecting the first table i a able to fetch the data and display but i am unable to lead select that rows in the table to display the lead selection i used Lead selection by Index then is is displaying properly BUT when i click on the second row or the third row or so...... It is not getting lead selected. I am Surprised i tried to check but did not found a single clue please help me with this.......
Good Day....................
Thanks and Regards,
Sana.hi ,
did u check the LeadSelect property of ur context node to which ur table is binded ?
http://help.sap.com/saphelp_nw04s/helpdata/EN/79/555e3f71e41e26e10000000a114084/content.htm
regards,
amit -
How to remove lead selection in table dynamically
I have a table in webdynpro which allows multiple selections of row. I have a button which is supposed to be clicked after selecting single or multiple rows. After clicking on the button I want to remove the lead selection of the selected rows (which is shown in golden color for each selected row) .
I tried REMOVE_SELECTED ELEMENTS and it works fine but only if i select the row by pressing CTRL. If i had selected a single row by just a mouse click (without ctrl) then it wont work.
THANKSHallo Amber,
If_wd_context_node has static attribute no_selection. use that to clear the lead_selection_index.
node->set-lead_selection_index( if_wd_context_node=>no_selection ). -
Multiple row selection for table element
Hi,
I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
I have defined a node with cardinality and selection set to 1..n.
The contex node contains 4 fields : emp_name, pernr, manager and position.
The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
I have defined an action on the 'onleadselection' event.
The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).'
When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
Thanks in advance for any assistance.Hi raj,
you can try the following code in the 'onleadselect' event of the table,
create one attribute ' Flag' of type WDY_BOOLEAN under the node which has been binded to the table.
DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
DATA lo_elements TYPE wdr_context_element_set.
DATA lo_ele_select_new TYPE REF TO if_wd_context_element.
DATA lv_deselect TYPE wdy_boolean.
DATA lv_flag TYPE wdy_boolean.
DATA lv_select TYPE wdy_boolean.
DATA lv_index TYPE i VALUE 0.
lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
get the current selected element
lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
CHECK lo_ele_select_new IS NOT INITIAL.
check whether it has been selected or not
CALL METHOD lo_ele_select_new->is_selected
RECEIVING
flag = lv_select.
lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
check whether element has been previously selected or not,if not, set the flag to select it
IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
if selected currently and previously then set the flag as false,in order to delect it
ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
ENDIF.
CALL METHOD lo_nd_node_tab1->get_elements
RECEIVING
set = lo_elements.
according to the falg, select and delect the elements
LOOP AT lo_elements INTO lo_el_node_tab1.
lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
IF lv_flag = 'X'.
lo_el_node_tab1->set_selected( abap_true ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ). * this statement deselects the lead selection index*
ELSE.
lo_el_node_tab1->set_selected( abap_false ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ).
ENDIF.
ENDLOOP.
I hope this resolves your problem.
Thanks,
krishna -
HI Team, When I try to select the multiple selection for field Material in table Mara, the To value is not displayed
e.g in table mara if i select the material option from A* to Z*, all the materials are displayed from A until x but no of the materials are displayed starting with Z. I have found this as standard functionality in SAP and happens for all fields with multple selection in tables. can you guys advise if there is an OSS note for this?
Thanks,
SunnyHai Sunny,
Please check Do you have material staring with Z
and check is there any
Maximum No. of Hits restriction.
Till you get SAP notes
Create a query in SQVI for only ine table and
MARA and tick mark the selection b fields and fields to be displayed in the report.
Now in the report selection screen you will get TO option as well it will list all the Z materials.
Regards,
Mani -
Multiple row select for table not working..
Hi Experts,
I have a table in ABAP Web Dynpro where I have enabled the multiple row select functionality. I can select all and deselect all. I can also select a block of adjacent rows of table by choosing first and last by pressing Shift key.
But I am not able to select multiple individual records for that table.
I tried the same thing in different system and it works fine there.
Please let me know if we are missing some standard plugin or we need to enable this in some settings.
System where the issue is:
SAP_APPL: release 600, level 18
SAP_BASIS: Release 700, level 22
System where it is working fine:
SAP_APPL: release 604, level 8
SAP_BASIS: release 701, level 8
Regards,
Anand KolteHi
Press CTRL key and Select records, you can select multiple records, continuously or randomly your desired selection.
Cheers,
Kris. -
Table: show the line of lead selection
Hello,
I have a table with 691 lines, showing 20 lines per page. Is it possible to change the lead selection for example to line 60 and also jump to line 60. So that the table automatically shows the 3rd page with the line 60 - 80.
I can change the lead selection with:
node_trefferliste->set_lead_selection_index( index = 60 ).
Lead selection is set correctly to 60 but the table still shows the lines 1- 20.
best regards
StefanHi Stefan,
What ever you have done is correct. One thing you need to change is whenever you change the lead selection for you table you need to scroll ALV also. For that get the lead selected entry and set it as frst_visible_row for you ALV table. Please do this coding in the respective view controller method WDDOMODIFYVIEW(). so that you will get exact result what you are expecting.
I hope i make you clear.
Warm Regards,
Vijay -
TreeByNestingTableColumn - how to set lead selection?
Hallo Guys!
I am using TreeByNestingTableColumn in my project. I am searching for a way to select a certain context element inside of the tree shown in such a table. I actually know that setLeadSelection doesnt work properly in such a case.
Ive already read this very helpful blog /people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii searching for a solution, but its seemed not to be there.
Valery had shown how to read the selected context element recursively, but there is nothing about to how to set the needed lead selection for a certain one.
In my scenario, I am loading the whole table (10-15 elements) with only two levels of hierarchy. After the user clicks on a button I have to reload this table but keep the selection of the previously selected element.
The try using getTreeSelection didnt succeed either.
Any ideas?
Many Thanks
Dimitri
Edited by: Dmytro Lubenskyy on Apr 1, 2008 3:44 PMHi,
You can use the following methods to set the selection.
IWDNodeElement nodeElement = wdContext.nodeOrders().getElementAt(2);
wdContext.nodeOrders().setTreeSelection(nodeElement);
Regards
Ayyapparaj -
hi
I have created a dropdown menu(by Key).I have populated the values by binding the "texts" property to an attribute "num" that i have defined to be of simple type string.
How can I set the lead selection for this dropdown.
Plz Helphi......
well dynamically you can do it
public void wdDoInit()
//@@begin wdDoInit()
IPrivateViewDropkey1.IDropKeyElement ele = wdContext.createDropKeyElement();
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("DropKey.Key");
IModifiableSimpleValueSet val = myType.getSVServices().getModifiableSimpleValueSet();
val.put("1" ,"product1");
val.put("2" ,"product2");
//@@end
Now in the wdModifyView
public static void wdDoModifyView(IPrivateViewDropkey1 wdThis, IPrivateViewDropkey1.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
if(firstTime)
// creating tranparent container
IWDTransparentContainer tc = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TransparentContainer");
// creating dropdownkey
IWDDropDownByKey key = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"Dropkey");
key.bindSelectedKey("DropKey.Key");
key.setWidth("60");
key.setVisible(WDVisibility.VISIBLE);
//setting the selection to the first value
key.setSelectedKey("1");
tc.addChild(key);
IWDTransparentContainer root = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
root.addChild(tc);
//create an action called Click in the view
IWDAction action = wdThis.wdCreateAction(IPrivateViewDropkey1.WDActionEventHandler.CLICK, "");
key.setOnSelect(action);
//@@end
regards,
pinki -
Lead Selection to be disabled for some of the records in Table
Hi ,
I have 5 records in table .User shouldn't be allowed to select four rows thosse four rows should be in disable mode just for display purpose.Only one Row must be allowed to select(lead select).
How can I Achieve above Functionality.
Thanks & Regards
KiranHi Kiran,
Probably you might have tried the following.
Bind OnLeadSelect event to some action.
And in that action method write the code to fetch selected lead and check if it is 0(first row) else set leadselection to 0
int selectedRow = wdContext.node<node name>().getLeadSelection();
if(selectedRow!=0)
wdContext.node<node name>().setLeadSelection(0);
With this code the user can not select any of the rows other than first.
If this is not what u require please let me know
Regards,
Santhosh -
How to write lead selection method for a tree by nesting table column
Hi,
I have implemented a table with TreeByNestingTableColumn(To show the tree structure in the table).I am not able to get the selected row element in lead selection method.(I am able to get parent element.) .
could anyone please tell me about this code?
BR,
AshishHi,
Follow the below steps to the solution for your problem
1. Create Action "LeadSelection" in View with parameter (name : 'seletedItem'
and type : I<your node>Element
2. Bind this action to Table property "onLeadSelec"
3. In wdModify()
IWDTable table = (IWDTable) view.getElement("Your table id");
table.mappingOfOnLeadSelect().addSourceMapping("nodeElement", "selectedEle");
4. In onActionLeadSelection()
wdComponentAPI.getMessageManager().reportSuccess("Selected Item : "+selectedEle.get<Your Node Attribute>());
Let me know if you need more clarification
Thanks -
Lead Selection does not work after setting filter for ALV.
Hi, Can you please suggest on below scenario :
I have a Node with a sub node in it .
I am using the supply function on Sub Node to retrieve the date based on Parent Node.
There are two ALV's to display parent and item data. The issue is when a filter(user defined filter) is done on Parent table, the supply function does not work. The value is that of the selected row before setting the filter. Even after removing the filter, the item data is stuck and does not change on Lead Selection.
One thing I noticed is if the child table is a table UI, there is no issue. The only problem is when the second table is ALV
Thanks In AdvanceHi Prashanthi,
Your issue can be resolved as below
Create an event handler method 'set_alv_data' for the event 'ON_LEAD_SELECT' of parent alv
Write the below code inside the event handler method
METHOD set_alv_data.
DATA lo_node TYPE REF TO if_wd_context_node.
DATA lv_path TYPE string.
DATA lv_index TYPE string.
lv_index = r_param->index.
CONDENSE lv_index.
CONCATENATE wd_this->wdctx_my_parent_node
lv_index
wd_this->wdctx_my_child_node
INTO lv_path SEPARATED BY '.'.
lo_node = wd_context->path_get_node(
path = lv_path
DATA lo_interface TYPE REF TO iwci_salv_wd_table.
lo_interface = wd_this->wd_cpifc_alv_child( ). "get the ref of alv comp of child
lo_interface->set_data(
EXPORTING
* only_if_new_descr =
r_node_data = lo_node
ENDMETHOD.
The above code sets the data node of child alv based on lead selection of parent alv data.
Note: Replace 'parent_node', 'child_node' with your nodes & 'alv_child' with your alv component name of child alv.
If you want to control the data of child alv on filter function, you can use the event ON_STD_FUNCTION_AFTE and once you define the filter you get the r_param->id = 'SALV_WD_FILTER_DEFINE' & now you can clear data of child alv.
Hope this helps you.
Regards,
Rama -
How to delete the record in the table without using lead selection?
hi,
I have added the separate column "delete" to the table uielement and so for each record or row of the table the appropriate "delete" link to action will be there................the code below works when the particular row is selected through lead selection only.......
help me how to delete without using lead selection.....
DATA:
NODE_MODULE TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_MODULE TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_MODULE TYPE IF_V_MODULE=>ELEMENT_MODULE .
data itab TYPE TABLE OF zac_modules.
navigate from <CONTEXT> to <MODULE> via lead selection
NODE_MODULE = WD_CONTEXT->GET_CHILD_NODE( NAME = `MODULE` ).
get element via lead selection
ELEM_MODULE = NODE_MODULE->GET_ELEMENT( ).
get all declared attributes
ELEM_MODULE->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_MODULE ).
NODE_MODULE->GET_STATIC_ATTRIBUTES_TABLE(
IMPORTING
TABLE = itab )
DELETE itab WHERE zmodule_id = STRU_MODULE-zmodule_id.
CALL METHOD NODE_MODULE->BIND_TABLE
EXPORTING
NEW_ITEMS = itab
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
ENDMETHOD.Hi ,
The onclick event provides you with a standard paramater "CONTEXT_ELEMENT" which has the element from which the event is triggered.
so you can declare this in the handler(if it is not there) and use it as follows.
CONTEXT_ELEMENT TYPE REF TO IF_WD_CONTEXT_ELEMENT an importing paramater.
DATA:
NODE_MODULE TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_MODULE TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_MODULE TYPE IF_V_MODULE=>ELEMENT_MODULE .
data itab TYPE TABLE OF zac_modules.
CONTEXT_ELEMENT->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_MODULE ). "Using the context_element paramater to get the static attributes.
NODE_MODULE->GET_STATIC_ATTRIBUTES_TABLE(
IMPORTING
TABLE = itab ) "getting all the data.
DELETE itab WHERE zmodule_id = STRU_MODULE-zmodule_id. "deleting the particular row from the table and binding it.
CALL METHOD NODE_MODULE->BIND_TABLE
EXPORTING
NEW_ITEMS = itab
* SET_INITIAL_ELEMENTS = ABAP_TRUE
* INDEX =
thanks,
Aditya. -
Hi All,
I have three views.The first is the search view and the other two are the tables view.
In the second view..I have to display the data from the BAPI in to the table..and on the lead selection of any row and after pressing the Get Detail button I should get the Details from the BAPI for the particular row in the Third view or Table.
Kindly provide me the logic to make it working.
Thanks in advance.
Regards
DipendraHello Dipendra,
View1 -> View2 -> View3
Navigation through this views can be achieved by navigation plugs as you may already be aware of.
Sample code available in the location
<a href="http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d">http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d</a>
See samples '1 | 2 | 10 | 15 | 40 '
So after navigation logic is implemented, next step is to pass lead selection data from view2 to view3. This can be done by storing leadselection index in the Contoller context and access the same from view3. So just get the index and get the nodeElement and display the details.
Regards,
Sudeep.
Maybe you are looking for
-
App Store remembering old user info.
I inherited a MB at work from another user that had downloaded apps through the App Store. The App Store keeps reporting that there's an update available for Twitter. If I try to update it, it asks for the old user's account info. Mind you that th
-
Adobe Photoshop Elements 10 DVD Menu
I read somewhere that I could make a DVD menu, in Adobe Elements for Adobe Premire Elements 10, but I am having troubling figuring out how to do so. Dose anyone know if there is a written or video tutorial for making a dvd template in Adobe Photoshop
-
I can't get this to work! (hard to describe in topic) (please read)
My other class, DivideGenes, is supposed to divide the genes created in Genes in half (to create a sperm cell). I do this by 1. copying the array 2. finding random indexes in the array 3. coppying the values of the random indexes to a different array
-
Can any one tell me the logic for finding the common cendors I have 5 plants Now I should display the total no. of vendors in each plant & the common vendors in all the plants & shouls display this in the graph
-
Hi, All, I have tried to send IDoc from R/3 to XI and received message (in SM58) NO_EXEC_PERMISSION: "User" "Business_System". I have found note 940313 with solution: "You created a list of users in the directory who are authorized to use the "Busine