MDM Hierarchy Table Into Tree (Java WebDynpro)
Hello all,
I have a requirement of showing a MDM Hierarchy Table into Tree UI element.
These are the steps am following:
1) MDM Connectivity
2) Using RetrieveLimitedHierTreeCommand command to retrieve tree structure of the table
3) Using getChildren() method of each node to get the children
4) Made a tree ui element with a recursive node
Now since the Hierarchy table can reach any level of nodes how do i write code for dynamic tree node/leaf generation?
Please guide me through with detailed steps/code if possible?
Regards,
Yogesh Bhatia
Hi Yogesh,
After getting the HierNode you have to recursively populate the hierarchy tree using the below code:
private void createHierarchyTree( parent_element, com.sap.mdm.data.HierNode HierNode)
if(HierNode != null && HierNode .getChildren() != null)
for(int iChildCount=0 ; iChildCount < HierNode .getChildren().length ; iChildCount++)
IPublic<comp name>.Iparent_element objTreeElement = parent_element.node<Recursive node name>().create<name>Element();
objTreeElement.setattr1(HierNode.getChildren()[iChildCount].getDisplayValue());
objTreeElement.setattr1_Recid(HierNode.getChildren()[iChildCount].getId().id);
parent_element.node<Recursive node name>().addElement(objTreeElement);
// call the method recursively
createHierarchyTree(objTreeElement, HierNode.getChildren()[iChildCount]);
This will populate the tree, you need to create an action in the tree view and link it to TreeNode Type action property using which you can get the selected value.
Hope this helps!!
Cheers,
Arafat
Similar Messages
-
MDM Hierarchy Table Into Tree UI Control in ABAP WebDynpro & MDM ABAP APIs
Experts,
I am a newbie to ABAP / MDM ABAP APIs. I am looking into the possibility of using Tree as as a UI control in a webdynpro abap application to represent hierarchy tables, perform hierarchy / taxonomy search, create and update records involving hierarchy fields, using MDM ABAP APIs.
I would like to seek inputs to check whether and how, is it possible to use MDM ABAP APIs to:
1. To perform taxonomy search on material table
2. To Create material records in the main table involving taxonomy fields.
3. To search on main table records using taxonomy attribute values as search parameters.
4. To use Tree UI control with in WebDynPro ABAP, to peform above operations.
We intend to use function modules - service calls from within WebDynPro ABAP applications, hence would like to know the feasibility, actual build effort and complexity of function modules.
Inputs and advice on same will be highly appreciated and duly rewarded.
Regards,
Paras1. To perform taxonomy search on material table - if material table is of type Taxonomy then possible
2. To Create material records in the main table involving taxonomy fields - possible . you create records in main table and assign value of field to that of taxonomy table entry
3. To search on main table records using taxonomy attribute values as search parameters. - possiblr
4. To use Tree UI control with in WebDynPro ABAP, to peform above operations. - yes possible
dont mix between hierarchy table and taxonomy table
they are diff in MDM , but it is possible to build UI with WD tree element for each of these types.
all that you said are supported in ABAP APIs
thanks
-Adrivit -
Editing tree ui for MDM hierarchy tables in a WDJ aplication
Hi ,
We have a requirement where MDM hierarchy tables are displayed using a tree UI in WDJ application.
However, tree UI is used only for the display purpose. Is there anyway or any other UI available
using which we can achive edit option in the tree as well?
Not only this, we are supposed to provide functionality to support moves across the nodes of hierarchy.
Like PC move or SBU move from one hierarchy to another.
First of all, can we achive this in WDJ or MDM WebDynpro COnfigurator? If we can, then how? Any links or pointers for this?
Thank You,
Apoorva Davei think u can use the method addNodeType (IWDAbstractTreeNodeType nodeType, int index) to add/edit an element at a particular index in the tree.
but drag drop features i think are not supported in standard WD and u need to use a java script in the view to achieve this ?
thanks
-Adrivit -
Editing Tree UI for MDM Hierarchy tables ina WDJ application
Hi ,
We have a requirement where MDM hierarchy tables are displayed using a tree UI in WDJ application.
However, tree UI is used only for the display purpose. Is there anyway or any other UI available
using which we can achive edit option in the tree as well?
Not only this, we are supposed to provide functionality to support moves across the nodes of hierarchy.
Like PC move or SBU move from one hierarchy to another.
First of all, can we achive this in WDJ or MDM WebDynpro COnfigurator? If we can, then how? Any links or pointers for this?
Thank You,
Apoorva DaveYou could use a Tree UI element together with a detail view for editing the selected tree node. Or you could use a "TreeTable" which is a Web Dynpro Table with a TreeByNestingTableColumn.
-
How to include a Bapi or a TCD into my Java WebDynpro
Hello all,
Yesterday I finished my first Java WebDynpro Application ("Welcome"). That means, I am a beginner
But like I mentioned in the subject, I need Information about, how I can <b>include a Bapi or a TCD into my Java WebDynpro</b>.
This could be any information: verbal statements, Powerpoints, How-To-Guides, *.pdf's or something like that.
Thank you in advance and regards,
A. CetinHello Ayşegül
You can find some information about webdynpro below link. But I dont understand exactly what do you want to do? You can call any BAPI easily inside webdynpro java.
http://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715
http://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/20b6e990-0201-0010-5095-f3a465de5f30
Kind Regards,
Rasim -
SAP Netweaver MDM Hierarchy Table Type
Good Day
We need to implement an MDM solution using Hierarchy tables.
Where can i find a good tutorial on how to use MDM hierarchy table??Hi,
You can find in SAP help portal..just browse saying SAP MDM reference guides!!
http://help.sap.com/saphelp_nwmdm71/helpdata/en/loio30bf76947bb64c48a2e835fda42c5183_30bf76947bb64c48a2e835fda42c5183/95/aff04a0aae4a3592fcb3e75869a90b/frameset.htm
use SMP credentials
Regards,
Girish -
How to retrieve the data from MDM hierarchy table using MDM Java API
Hi,
I had a hierarchy table in MDM. This table had some column say x. I want to retrieve the values of this x column and need to show them in a drop down using MDM Java API.
Can anyone help me to solve this?
Regards
VallabhaneniHi,
Here is your code...
TableId Hier_TId = repository_schema.getTableId(<hierarchy table id>);
java.util.List list = new ArrayList();
ResultDefinition Supporting_result_dfn = null;
FieldProperties[] Hier_Field_props =rep_schema.getTableSchema(Hier_TId).getFields();
LookupFieldProperties lookup_field = null;
TableSchema lookupTableSchema = null;
FieldId[] lookupFieldIDs = null;
for (int i = 0, j = Hier_Field_props.length; i < j; i++) {
if (Hier_Field_props<i>.isLookup()) {
lookup_field = (LookupFieldProperties) Hier_Field_props<i>;
lookupTableSchema =repository_schema.getTableSchema(lookup_field.getLookupTableId());
lookupFieldIDs = lookupTableSchema.getFieldIds();
Supporting_result_dfn = new ResultDefinition(lookup_field.getLookupTableId());
Supporting_result_dfn.setSelectFields(lookupFieldIDs);
list.add(Supporting_result_dfn);
com.sap.mdm.search.Search hier_search =new com.sap.mdm.search.Search(Hier_TId);
ResultDefinition Hier_Resultdfn = new ResultDefinition(Hier_TId);
Hier_Resultdfn.setSelectFields(rep_schema.getTableSchema(Hier_TId).getDisplayFieldIds());
ResultDefinition[] supportingResultDefinitions =
(ResultDefinition[])list.toArray(new ResultDefinition [ list.size() ]);
RetrieveLimitedHierTreeCommand retrieve_Hier_tree_cmd =
new RetrieveLimitedHierTreeCommand(conn_acc);
retrieve_Hier_tree_cmd.setResultDefinition(Hier_Resultdfn);
retrieve_Hier_tree_cmd.setSession(Auth_User_session_cmd.getSession());
retrieve_Hier_tree_cmd.setSearch(hier_search);
retrieve_Hier_tree_cmd.setSupportingResultDefinitions(supportingResultDefinitions);
try {
retrieve_Hier_tree_cmd.execute();
} catch (CommandException e5) {
// TODO Auto-generated catch block
e5.printStackTrace();
HierNode Hier_Node = retrieve_Hier_tree_cmd.getTree();
print(Hier_Node,1);
//method print()
static private void print(HierNode node, int level) {
if (!node.isRoot()) {
for (int i = 0, j = level; i < j; i++) {
System.out.print("\t");
System.out.println(node.getDisplayValue());
HierNode[] children = node.getChildren();
if (children != null) {
level++;
for (int i = 0, j = children.length; i < j; i++) {
print(children<i>, level);
//end method print()
Best regards,
Arun prabhu S
Edited by: Arun Prabhu Sivakumar on Jul 7, 2008 12:19 PM -
How get BUS2089 into a Java WebDynpro
Hi,
I'm new to Java webdynpro programming. I have wrapped RFCs and used these but now I want to access attributes and methods on the SAP business object BUS2089.
Is it possible to import (auto wrap) a SAP business object into Netweaver dev studio then access the attributes and call the methods?? I can't find one...
Sorry if this is a 'dumb' question...
TIA
JHi,
You can access BAPIs and RFCs with webdynpro by creating a model based on RFC/BAPI. This will generate EJB's that you can use in your application to access the underlying business functionality on SAP. If you are doing this "outside" of webdynpro you can still access the business objects by using JCo (Java Connector).
regards,
Dion -
Develop MDM Heirarchy table using Webdynpro Tree
Hi
Can anyone let me know how i can build a MDM Heirarchy table using webdynpro tree.
ThanksCan you be more specific? Is your problem with MDM or Web Dynpro? And what do you mean by "build an MDM Hierarchy Table"?
Walter -
Can we import multiple language descriptions in Hierarchy tables of MDM
Hello Experts,
I am using MDM 7.1 SPS4 and working on the Vendor Repository standard content.
My source file of Regions table contains data in multiple languages for each region record. All the required destination language fields have been mapped properly in the standard map. Import action is set to 'Create' for new records and 'Update Mapped only fileds' for existing records. Matching criteria has Name<English> filed defined in it.
However, after importing these hierarchy records, in data manager only the Name description of English is populated while all other language descriptions for the same record is shown in Red (i.e not populated with the expected data).
Is this a limitation of MDM itself or am I missing some setting?
Thanks in advance,
Elizabeth.Hi Elizabeth,
steps for importing into hierarchy tables
To add new multilingual records:
1 If necessary, create the hierarchy from the current language layer Name field that contains the hierarchy information (e.g. using the Split Hierarchy command).
2Map the current language layer Name field and then Map/Add the entire set of hierarchy values.
3 Map the other language layer Name field(s). No value mapping is necessary.
4 Map the [Remote Key] field.
5 Record match using: (a) the Name field; (b) the [Remote Key] field (if the Name field was not value mapped); or (c) the combination of both.
To update the language layer of existing records:
Map the other language layer Name field(s). No value mapping is necessary.
Map the [Remote Key] field.
Record match using the [Remote Key] field and set the import action to Update (All Mapped Fields).
Just try and if you need any other info then please get back to me.
Thanks,
Sudhanshu -
VB Like tree in Webdynpro Java
We are using Webdynpro Tree UI Control for displaying functional location hierarchy. However the standard webdynpro Tree does not display clear lines associating children's with its parents - VB Tree has these lines which is very useful for the users. We tried to work around this issue by creating icons with vertical lines in it. But we were not able to get continues lines and its hard to display multiple lines using icons.
Have anyone encountered the same issue?. if yes, how did you resolve it?.
is SAP planning to incorporate this requirement in near future?.
Regards,
ArulHi Arul,
I would suggest you use TreeByNestingTable Column element.
You can find it as Master Column in the Table UI element.
This will solve your problem because table row will solve the lines problem that you are facing.
Go through the following tutorial to get familiar with the element.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/integration%20of%20a%20tree%20structure%20in%20a%20web%20dynpro%20table.pdf">Integration of Tree and Table</a>
Regards
Amit -
Event Handling with Java API.: Adding to a hierarchy table throws 2events
I´m having some problems with the event handling. I´ve registered a Class with extends AbstractDataListener as EventListener. When there are changes in the product hierarchy table, some extra work should be done. However if i add a new record into the hierarchy, two events are fired.
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;Getra?nke, SEW
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;32 Zoll, B&R
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;56 Zoll, Lenze
DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;20 Zoll, allgemein
In this case, i added the records "32 Zoll, B&R" and then "20 Zoll, allgemein". As you can see in both cases two events are fired and the first event seems to come with wrong data. The reported id for the newly created record is R17. For the logging, i did lookup the entry in the hierarchy table by id and use the displayvalue of the record. But the first event always shows the displayvalue from some already existing entry.
How can i avoid duplicate events or if this is not possible, how i can recognize that the display value of the first event is not valid.I have not tetsted it yet, because I'm waiting for my server to be updated, but SAP told me that the API version 5.5.42.67 should fix the problem.
Thanks for your post. -
Need help to create a new record in mdm using java webdynpro
hi all,
I have to develop an application to create a new record in mdm by using java WebDynpro . Please help me what is the process that i have to follow to do this and provide me if you have any step by step guidance for this.
thanks & regards,
Mahi.Hi,
The below link will help u to make the application in JAVA webdynpro
The article has code to for creating records.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/803e9e80-21f4-2a10-8cbf-bcf6a8060be3
Hope this may help u .
Rgds
Ankit -
How to create Table Popins inside a table using Java Webdynpro
Hi All,
I am working on a Java Webdynpro project and one of our requirements is to create Table popins inside the Table. I need to popin data beneath the row based on a value selected from the DropDown Box which is one of the column in the Table.
Also, I need to display vertical scrollbar instead of Table Footer to scroll thru the table rows. Any ideas.........
I would appreciate if you can let me know how can I do this. I am working on the 7.0 version of Java Webdynpro.
Thanks for your time and consideration!
Regards,
MadhaviHi,
Please refer the following link:
Re: Table popins
step by step procudure to create table popin on lead select.
thanks & regards,
Manoj
Edited by: Manoj Kumar on Apr 1, 2008 10:17 AM -
Use MDM java Api for saving an image to mdm image table
Hi experts
I want to save an image from web dynpro java to MDM image table using java Api's
Can anyone provide a code snippet .
I am using MDM 7.1 sp6.
Thanks and regards
SureshHello Suresh
Unfortunatly, this is no possible, i mean, to load images to mdm repository through JAVA API.
Sure you can do it directly to database ( but for that you need to do saome investigation)
Here you can found JAVA API classes for MDM:
http://help.sap.com/javadocs/MDM71/
Next two classes are working with BLOBs (pdf, images, video, etc.) in MDM repository:
com.sap.mdm.blobs
com.sap.mdm.blobs.commands
Regards
Kanstantsin chernichenka
Edited by: kanstantsin_ch on Sep 8, 2011 2:36 PM
Maybe you are looking for
-
Itunes wont recognize itunes music folder
after restarting my computer the other day to finish a mcafee upgrade, i clicked the itunes to open and listen to my music and an error message appeared reading "The folder "iTunes" cannot be found or created, and is required. The default location fo
-
When I download an attachment fro my client and try to view or downlad in apple mail the images on the layout are in black and white. When I pull the pdf up through say Gmail images are fine but once downloaded to Mac are saved as black and white
-
I am having trouble connecting to my school's wireless network. Initially I couldn't connect at all, but someone helped me by going into the Network Preferences and changing the password stored there (it was trying to use an earlier one that was used
-
DVD Player system error: - 69902
DVD Player encountered a system error: - 69902 I can play a DVD using front row but unable to play one using Apple DVD player. I also can no longer burn anything to a disc, when I insert a blank DVD or CD the finder window says the disc in unreadable
-
Error in creating reservation using 'BAPI_RESERVATION_CREATE'
Hi All, I am using bapi 'BAPI_RESERVATION_CREATE' for creating reservation.But bapi is returning following message. Cost center XXXX does not exist on 12.01.2009. What can be the reason for this error ?