on 07-14-2005 8:59 AM
Hi,
I need the step by step guide to create a master-details web dynpro application, i.e. An application where if I give a parameter value in the input box, the corresponding details should appear in table below.
Such runnning application "Master-Detail-Viewer" is given in SDN but i need to create it from scratch.
Any pointers will be highly appreciated.
Thanks.
Puneet
hi puneet,
are you trying to get data into your table from an rfc or are you statically entering data
try this piece of code.
'tabel1' is the node which you've bounded to the datasource property of table.'empno','empname','empage' are the attributes under this node. so the table has only three column. now
String empnovar = wdContext.currentContextElement().getTextvalue();//get the //value from the inputfield
for(int i = 0 ; i<wdContext.nodeTable1().size() ; i++)//iterate through the elements of the table node
{
if(empnovar != wdContext.nodeTable1().getTable1ElementAt(i).getEmpno())
{
wdContext.nodeTable1().removeElement(wdContext.nodeTable1().getTable1ElementAt(i));
}
else{
String temp_eno = wdcontext.nodeTable1().getTable1ElementAt(i).getEmpno();
String temp_ename = wdcontext.nodeTable1().getTable1ElementAt(i).getEmpname();
String temp_eage = wdcontext.nodeTable1().getTable1ElementAt(i).getEmpage();
//get the values of other attributes also if you have more
}
}
iprivate<viewname>.iTable1Element telem = wdcontext.nodeTable1.createTable1element();
telem.setEmpno(temp_eno);
telem.setEmpname(temp_ename);
telem.setEmpage(temp_eage);
//set your other attributes here
wdcontext.nodeTable1.addElement(telem);
hope this works
Message was edited by: Rahul Thunoli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
insert the table uielement into your view. then go to the context tab in the view . right click the context and create a value node. name it say 'table'. then right click the node 'table' and create a value attribute say 'tableattribute'.
right click the table UIElement and click create binding. select the node 'table' and the attribute 'tableatribute'. you can add many attibutes depending on the number of columns that ou need.
now to insert data into the table include the following piece of code in the doInit()
{
1. iprivate<viewname>.itablenode tn = wdcoontext.nodetable();
2.iprivate<viewname>.itableelement te = tn.createElement();
3.te.setTableattribute("rahul");//the value you wanna //enter
4.tn.addElement(te);
if you want to add one more value into the column create one more element as above in step 2 and add it to the node as in step 4.
now to add text field. insert inputfield uielement into the view. and create its corressponding attribute in the context and bind this attribute in the text property of the inputfield.
hope this helps you.
Any doubts please update your query.
regards,
rahul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rahul,
Thanks for the help.
The situation is that table has emp no , emp name, and age as three columns. The input box is of type emp no.
When I enter some data (say emp no = 10) in input box and press enter, only data correspoding to emp no 10 should appear in the table.
Can you help me with this sitation.
TIA.
Hi,
Puneet
Take a simple scenario
1) First crete UI elements, Input field,enter button and a table let the tabel have three columns as per your requirement.
2)Create context for all these map it.
3)Crete an action for the Enter/Submit button
4)Now in order to display data for a paricular Employee Number possible ways
A)Hard code the data it in the action method.
B)Connect to data base Oracle,Ms Access etc (Get the data).
c)Call the BAPI with input as emp no out put has what actually you need you have to right coustom BAPI.
Hope this helped you!
RK
hi,
There is a standard option available in table .Using this you can filter the values.
When you enter 10 in empno filter field elements with empno = 10 will only be displayed.You can also use wild characters for search
Check this link.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/devel... with tables in web dynpro.pdf
Regards
Bharathwaj
Hi Punnet,
1. Create the Web Dynpro Application Project.
2. Create a model which will help use to get data from R/3 system.
3. Give your Model name and logical systems.
4. You need to configure these JCOs from the content administrator: http://<host>:50000/webdynpro/welcome
5. Create one custom controller and map model context to the controller context from the data modeler.
6. Now, make one method in custom controller and write code to execute this Model.
7. call this method from the view.
8. Also map controler context to view context, and bind its input data to the ui elements on the layout of the view.
This is the brief steps to make your application.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What kind of details do u want. If u open the project file that will itself give an idea of wat to do.
You have to create a i/p field map it to a value attribute ..lets say "value"
create a node and add value attribute "value" inside the node.Bind it with the table
onClick of a button add a action . inside that write the following
IPrivate<viewname>.I<nodename>Node node = wdCOntext.node<nodename>;
IPrivate<viewname>.I<nodename>Element element = node.create<nodename>Element();
element.setValue(wdContext.currentContextElement().getValue());
node.addElement(element);
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.