cancel
Showing results for 
Search instead for 
Did you mean: 

Table is not filling with the RFC data

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

table ui have dataSource property .

once confirm you bind with the proper node means which provide data.

for debugging it use external break point in ecc side.

i hope you calling the rfc in view like this

wdThis.wdGet<Controller Name>CompController().execute<rfc name>();

Regards,

ramesh

former_member192434
Active Contributor
0 Kudos

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

}

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

do like this,

wdContext.nodeT_Salesheader().getT_SalesheaderElementAt(wdContext.nodeT_Salesheader()getLeadSelection()).getVbeln());

Regards,

ramesh

Former Member
0 Kudos

Hi,

Change as follows



if(wdContext.nodeT_Salesheader().getLeadSelection()) != -1) // Check for lead selection
wdContext.nodeT_Salesheader().getT_SalesheaderElementAt(wdContext.nodeT_Salesheader().getLeadSelection()).getVbeln());

Regards

Ayyapparaj

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

once compare your code with ayyapparaj's post ?

i hope table is bind with T_salesheader .

Regards,

ramesh

Former Member
0 Kudos

Ramesh,

If u can notice it both the code is same. But the difference is am displaying the context value in the view after reading it. This additionally am doing to check whether the its reading the context node properly or not...

Does anyone have an idea apart from this?

Regards

Sireesha.

narendra_bendi
Active Participant
0 Kudos

Hi Sireesha,

The above trailing code gives the values of the respective context node (leadselected row) - of (VBELN - SalesDocument, AUART - SalesDocument Type, VBTYP - SD Document Category and TRVOG - Transaction Group).

Regards,

Narendra

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

You can assing a attribute value to another attribute of a perticular element but not to an element.

Ex:

wdContext.nodeT_Salesheader().getT_SalesheaderElementAt(selected_index).getVBLEN()

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

it return value as object.

so you have to type cast it.

like the following statement,

wdContext.currentContextElement().setSs((String)wdContext.nodeTable().getElementAt(0).getAttributeValue("a"));

Regards,

ramesh

Edited by: Ramesh Babu V on Oct 29, 2008 11:21 AM

Former Member
0 Kudos

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.

Former Member
0 Kudos

wdContext.currentContextElement().set<Attribute Name>((String)wdContext.nodeTable().getElementAt(0).getAttributeValue("a"));

here (String) is the attribute type .

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi,

try changing the cardinality of the node to 1.1 or 1.n.

because when u use currentcontextElement,

atleast one one instance must exist..

Regards,

Satya.

Answers (4)

Answers (4)

0 Kudos

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

Former Member
0 Kudos

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

former_member197348
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

First execute and then invalidate the node

wdContext.currentZsalesheader_Data_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

Regards

Ayyapparaj