on 02-27-2008 11:48 AM
hai all ,
iam using adaptive rfc model.I need to give one input to database and get a list a values as output.
Since i dont have idea of how to give input to database pz help me doing that.
Thanks n Regards
Sharanya.R
hai shyam,
my mapping holds good.
Thanks n Regards
Sharanya.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharanya,
in Custom Controller,
1. Zmmin_Display_Busconfig_Input input = null; // as a global variable.
2. in wdDoInit
try {
input = new Zmmin_Display_Busconfig_Input();
} catch(Exception e) {
}
3. create a method executing() in that
set input parameters like
input.set....
after that bind ur input..
this.wdContext.Zmmin_Display_Busconfig_Input().bind(input);
execute..
this.wdThis.wdGetContext().currentthis.wdThis.wdGetContext().currentZmmin_Display_Busconfig_InputElement().modelObject().execute();
..........
In CustomController i think u cant display any out put messages.
--
Shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharanya,
After you finish importing the RFC into ur webdynpro project, add the model under the UsedModels section in ur component.
make the binding with the controller and the corresponding views.
declare a method in ur component controller and the write the following code:
<ModelNodeName> objData = null;
try
{
objData = new <ModelNodeName>();
wdContext.node<ModelNodeName>.bind(objData);
wdContext.current<ModelNodeName>.modelObject.set<import parameter name>(<value>);
wdContext.current<ModelNodeName>.modelObject.execute();
}
catch(Exception e)
{
//code for printing the error message
}
call this method in ur default view wdDoInit()
Hope this helps you.
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai poojitha,
thanks a lot.can you help me in that context binding.
I have imported the model.i have dragged and dropped the rfc and now my custom controller contains
the following structure.
ZMM_DISPLAY_BUS_INPUT
| |_Output
| |_ET_BUS(node--internal table)
| |_bus_config(this is the output)(attribute)
|
|_Et_voltage(this is the input to be passed)
ALSO TELL ME HOW AND WHERE TO GET THE OUTPUT.
Thanks n Regards
Sharanya.R
Edited by: Sharanya R on Feb 28, 2008 6:51 AM
Edited by: Sharanya R on Feb 28, 2008 7:07 AM
Hey,,
There are two procedure u can follow to do this.
once ur model is imported into WD side.
goto ur component there is an entity called usedModels.
Right click on that and add ur model to comp.
then goto ur custom/compont controller context tab.
1)Rightclick on the Root context create model node give some name of what ever ur FNM name.
2) right click on the model nodeeditmodelbindingselect the FNM_inputthen nodes will displayselect ur input nodes or variables. and output purpose select only the nodes under output node ur o/p node select.nextfinish.
3)
goto ur comp/custom init method add the code previous mail what he has given code.
4) do the context mapping for ur o/p screen. design the screen based on o/p node to table.
5) deploy and execute.
Another process automatic process
go thru this link.
If u are not clear, Let me know.
Thanks,
Lohi.
hai lohitha,
your link was of great help to me.Thanks a lot.I have a input attribute in my view.I have created a attribute in my custome ctrller and i have mapped the attribute with views attribute.now iam setting the value of the context attribute in init and i have set the attribute in custom ctrller to the input value to be passed.just tell if iam doing the right thing.the problem is no output is obtained.there is no prob with rfc as its working fine in back end.
public void executing( )
{
//@@begin executing()
wdComponentAPI.getMessageManager().reportSuccess("hi");
Zmmin_Display_Busconfig_Input objData = null;
try
{
objData = new Zmmin_Display_Busconfig_Input();
wdContext.nodeZmmin_Display_Busconfig_Input().bind(objData);
wdComponentAPI.getMessageManager().reportSuccess("1");
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().setIv_Voltage(wdContext.currentContextElement().getInput_node());
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().execute();
wdComponentAPI.getMessageManager().reportSuccess("2");
for(int i=0;i<wdThis.wdGetContext().nodeEt_Busconfig().size();i++)
{
wdComponentAPI.getMessageManager().reportSuccess("3");
wdComponentAPI.getMessageManager().reportSuccess(""+wdThis.wdGetContext().nodeEt_Busconfig().getEt_BusconfigElementAt(i).getBus_Config());
}
}
// catch(Exception e)
// {
//// code for printing the error message
// }
catch(WDDynamicRFCExecuteException ex)
{
wdComponentAPI.getMessageManager().reportWarning(""+ex);
}
plz help me..
thanks
Sharanya.R
Hey
try this code ur customconroller WDdoinit method. it should work
wdContext.nodeZmmin_Display_Busconfig_Input().bind(new Zmmin_Display_Busconfig_Input());
// pass ur input from here.
wdContext.currentZmmin_Display_Busconfig_Inputelement().setEt_voltage("hard code the value");
// call the execute method
try
{
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().execute();
wdcontext.nodeoutput().invalidate();
}
Exception e
{
e.pst();
}
Take first view and add do context mapping or ur o/p node and display with Table UI.
It should display ur o/p.
Let me know any issues.
Thanks,
Lohi.
Hai Lohitha,
my custom ctrller coding is as follows.
public void executing( )
{
wdComponentAPI.getMessageManager().reportSuccess("hi");
wdComponentAPI.getMessageManager().reportSuccess(""+wdContext.currentContextElement().getInput_node());
Zmmin_Display_Busconfig_Input objData = null;
try
{
objData = new Zmmin_Display_Busconfig_Input();
wdContext.nodeZmmin_Display_Busconfig_Input().bind(objData);
wdComponentAPI.getMessageManager().reportSuccess("1");
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().setIv_Voltage(wdContext.currentContextElement().getInput_node());
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().execute();
wdContext.nodeOutputt().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("2");
for(int i=0;i<wdThis.wdGetContext().nodeEt_Busconfig().size();i++)
{
wdComponentAPI.getMessageManager().reportSuccess("3");
wdComponentAPI.getMessageManager().reportSuccess(""+wdThis.wdGetContext().nodeEt_Busconfig().getEt_BusconfigElementAt(i).getBus_Config());
}
}
// catch(Exception e)
// {
//// code for printing the error message
// }
catch(WDDynamicRFCExecuteException ex)
{
wdComponentAPI.getMessageManager().reportWarning(""+ex);
}
}
Iam calling this method in the init method of view,
1,2 is getting printed but 3 is not getting printed.
I have given my context structure also.
Iam not getting the output.
Thanks n Regards
Sharanya.R
hai lohitha i tried ur code in my custom ctrller this way and tried printing the output node size it gives 0.
wdContext.nodeZmmin_Display_Busconfig_Input().bind(new Zmmin_Display_Busconfig_Input());
// pass ur input from here.
wdContext.currentZmmin_Display_Busconfig_InputElement().setIv_Voltage("220KV");
// call the execute method
try
{
wdContext.currentZmmin_Display_Busconfig_InputElement().modelObject().execute();
wdContext.nodeOutputt().invalidate();
wdComponentAPI.getMessageManager().reportSuccess(""+wdContext.nodeEt_Busconfig().size());
}
catch(Exception e)
{
e.printStackTrace();
}
wat can be the problem ?
Thanks n Regards
Sharanya.R
Hi Sharanya,
ZMM_DISPLAY_BUS_INPUT
| |_Output
| |_ET_BUS(node--internal table)
| |_bus_config(this is the output)(attribute)
|
|_Et_voltage(this is the input to be passed)
For the RCF are u passing both the parameters????
if u r just passing one and if both are mandatory then it wont execute properly
to get the output
wdContext.currentET_BUSElement().get<Attrinute Name>();
Regards
Poojith MV
hai all,
I need to know how the binding should take place while giving input to database.
Thanks n Regards
Sharanya.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
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.