on 03-26-2007 8:18 AM
I m having one more doubt. i hope i will get answer for my question also.
In webdynpro(JAVA) i have created a model. Let us essume dat table also employee_getlist only. in my first screen i dont hav any input fields. i just hav one table. i wants to fetch data directly ot the table frm backend without performing any operation. whne i hav been run da application i should get data on table frm backend. gimme sme sample code also. plz
Thanks SDN GURU's,
Hi Renushree,
You don't need to perform any operation to get the data into the table. If your RFC is returning that then, you can simply call the "Execute_RFC" method in the init() of your view to fill the data into the table.
In your view just insert the table and bind the data source and then right click on the Table UI element and then do the Create Binding.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Renu
If ur RFC is returning the data then u don't need to write code for it. You can just add a Table UI element to ur first screen,right click on it and click on properties to get the property window,map the datasource property to the model node.Right click on the table,click on Insert Column to get columns added to ur table then right click on column ,click on Insert Table Cell editor and select the TextView option to insert table cell editor.Now in the properties window of Table cell editor map the Text property with the model nodes model attribute.
Call the executeRFC method in the init method of your view.
wdThis.wdGetEmp_CompController().executeRFC();
Write the method in the controller like this
Your RFC Name_Input objRFC = null;
try
{
//Instantiation of model object
objRFC = new Your RFC Name_Input
wdContext.nodeYour RFC Name_Input(). bind(objRFC );
//Set the import parameters
wdContext.current Your RFC Name_InputElement().modelObject().setImportParameters("");
wdContext.currentYour RFC Name_InputElement().modelObject().execute();
}
Catch(Exception e)
{}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can call the execute method in the custom controller init method or View Init method.
Once you get the model into your customcontroller u can register the custom controller into viewcontroller and getting the nodes into view context.
And goto the View and apply template and create the Table by using the existing node.
Goto the init method of the View controller and add the following code.
FNModule_Input input = new FNModule_Input();
wdContext.nodeFNModule_Input().bind(input);
// If you have input sent it otherwise no need to send ..... pass the input
input.setZ_Kunnr("0000000001");
try {
wdContext.currentFNModule_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//Exception in catching the Error
catch (WDDynamicRFCExecuteException e){
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
}
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Renushree,
I suggest, You can call Ur Bapi Excute function in the init method.
Init method is a method which is called first. So if u place ur Bapi Execution code or Excution call in init method it will run automatically.
Regards,
Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi renu,
if you already created a model, using Adaptive RFC and in that BAPI if table already exist, then fetching the same is very simple
just take a table UI element in your view, and bind it to the table context (model node)
with out any action when the screen displays, then only you want to display the table..... right? just write the simple code in wdDoInit() method.
wdThis.wdGetXXXcontroller().executeXX();
Pradeep
do reward points if it helps or solve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.