on 10-21-2008 1:12 PM
Hi,
I am new to WDJ. I have a created a wdj application by importing adaptive RFC model. deployment is sucessful but at runtime the table is not getting filled up with the RFC data. RFC is executing find from the backend. JCO is maintained correctly in the webdynpro, mapping and binding is done.
Could someone guide where could be the problem?
I am giving the code below for doinit and service controller method.
public void wdDoInit()
{
//@@begin wdDoInit()
//$$begin Service Controller(-222509821)
wdContext.nodeZsalesheader_Data_Input().bind(new Zsalesheader_Data_Input());
// wdComponentAPI.getMessageManager().reportSuccess("Node value " + wdContext.currentContextElement().getAttributeAsText("auart"));
//$$end
//@@end
}
public void executeZsalesheader_Data_Input( )
{
//@@begin executeZsalesheader_Data_Input()
//$$begin Service Controller(-1232218854)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.nodeOutput().invalidate();
wdContext.currentZsalesheader_Data_InputElement().modelObject().execute();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
//$$end
//@@end
}
Can anybody guide if am missing something?
Regards
Sireesha.
Hi ,
try with the below,
public void executeZsalesheader_Data_Input( )
{
//@@begin executeZsalesheader_Data_Input()
//$$begin Service Controller(-1232218854)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.currentZsalesheader_Data_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
//$$end
//@@end
}
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ramesh and Ayyapparaj,
First i have tried by executing the method and then invalidating it when its not working with that so i have changed it to invalidate first and execute next.
I have tried it already as u said but no result...
any idea apart from this?
Is anyone there who can help us?
Regards
Sireesha.
Hi Sireesha,
i have used this same code to excute the BAPI and its working fine at my end.
when you import BAPI this method automaticaly created on controller you need to excute this BAPI as follow on either WDinit() method or on action of any button.
wdThis.wdGetAllInOneController().executeBapi_Flight_Getlist_Input();
-
public void executeBapi_Flight_Getlist_Input( )
{
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
//$$end
//@@end
}
Hi,
Thank you for all who replied to my thread.
Its now working fine. I have missed out calling the service controller method in the Doinit method of the component controller.Bcoz of this my table is not populating.
I Have one more doubt on the same application.
let me check that .....
Regards
Sireesha.
Anup and all,
Can anyone please identify whats the mistake in the below code?
OnLeadSelect Event
wdContext.nodeZsalesheader_Data_Input().getElementAt(wdContext.getLeadSelection()).getAttributeValue("Vbeln"));
I am getting a runtime exception that "unknown attribute Vbeln".
Here is my Context Node.
---Zsalesheader_Data_Input
-
Output
-
T_Salesheader
-
Vbeln
-
Auart
-
Vbtyp
-
Trvog
As per the above Context structure is my code correct? If not how do i read the value vbeln from the above context?
Can anyone pls advice?
Regards
Sireesha.
AyyappaRaj and Ramesh,
I have already tried the same code with the output and T_salesheader without If condition.
I am getting the exception for both the nodes : Output , Zsalesheader_data_input with or without If condition.
Where as with the node T_salesheader not getting the exception rather data is also not coming. Its displays nothing. I have tried this with and wihout If condition.
below is the modified code
if(wdContext.nodeT_Salesheader().getLeadSelection() != -1)
{
wdComponentAPI.getMessageManager().reportSuccess("The selected vbeln is " + wdContext.nodeT_Salesheader().getElementAt(wdContext.getLeadSelection()).getAttributeValue("Auart"));
}
How do i read this value can anyone help us pls ?
Regards
Sireesha.
Hi Ayyapparaj/Ramesh,
with the following code am getting the value for selected VBELN in the table. Now i want to assign this selected value of VBELN to another variable .
The Return Type of the getAttributeValue is Object - IWDNodeElement.
wdContext.nodeT_Salesheader().getElementAt(selected_index).getAttributeValue("Vbeln"));
Could anyone of tell me how should i assign this value to another varibale of type IWDNodeElement?
Regards
Sireesha.
Ramesh
wdContext.currentContextElement().setSs((String)wdContext.nodeTable().getElementAt(0).getAttributeValue("a"));
In the above code whats after currentContextElement() ?
Can you please send it clearly...
Actually i need to set this retrieved value into another context attribute.
Can u pls tell me how to type caste an element?
Regards
Sireesha.
Hi Ramesh,
As per the given code getting the null pointer exception. But if reading it seperately able to read the selecte value but the problem is while assigning this selected value to another attribute element by casting am getting the null pointer exception.
Reading the selected value of VBELN.
With the below code am able to read and display it without any exceptions.
wdContext.nodeT_Salesheader().getElementAt(selected_index).getAttributeValue("Vbeln"));
But when assiging this value to the atribute exception is thrown
Exception With the below code...
wdContext.currentZvbelnElement().setVbeln((String)wdContext.nodeT_Salesheader().getElementAt(selected_index).getAttributeValue("Vbeln"));
Regards
Sireesha.
you are invalidating the node before executing it.kindly invalidate after its execution.
also within diagram view,while doing mapping from model to component controller, map the required attributes from within the output node of nodeZsalesheader_Data_Input().if this is not done,no data gets fetched smtimes.
if problem is not solved,try reimporting the model again.
I hope these all solutions may work for you.
if problem persist do reply
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
the possible reason for the data not coming in the table may be that you are not passaing the required parameter to the bapi i.e. the mandatory inputs ,if that is not the case then please check your cardinallity.the cardinallity required is 0..n or 1..n .also check that you have binded the datasource property to the correct context or not.
thanks
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sireesha,
Are you passing all the required parameters to the BAPI? Try to check that by printing them.
Keep it in original order.
wdContext.currentZsalesheader_Data_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
Try to print BAPI Return message after BAPI execution, you may find helpful information.
Finally check whether all bindings and mappings are defined properly.
Regards
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First execute and then invalidate the node
wdContext.currentZsalesheader_Data_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.