cancel
Showing results for 
Search instead for 
Did you mean: 

getting errorn while using BAPI to display data

Former Member
0 Kudos

I am trying to use a BAPI to display PO orders..

I am getting the error at the time of binding structure to my context. The error is:

The method bind(IPublicTest.INodeforElement) in the type IPublicTest.INodeforNode is not applicable for the arguments (Bapi_Po_Getitems_Input)

//@@begin wdDoInit()

Bapi_Po_Getitems_Input Input = new Bapi_Po_Getitems_Input();

wdContext.nodeNodefor().<b>bind</b>(Input);

//@@end

Plz help its urgent.

Atul

Message was edited by: Atul Shrivastava

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Atul,

Write the following code in the custom controller's wdDoInit() method:

//@@begin wdDoInit()

Bapi_Po_Getitems_Input Input = new Bapi_Po_Getitems_Input();

wdContext.nodeBapi_Po_Getitems_Input().bind(Input);

//@@end

Hope this helps,

Regards,

Tejas.

Former Member
0 Kudos

Thanks for the reply,

I have already tried the following steps and they don't seem to work.

Instead I now use

Bapi_Po_Getitems_Input Input = new Bapi_Po_Getitems_Input();

wdContext.nodeNodefor().bind((Collection) Input);

Now I am hanged at

try

{

wdContext.currentNodeforElement().<b>modelObject().</b>Execute();

}catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException(e.toString(), false);

}

I am not getting the option for ModelObject rather of Model

Should I use it ? OR I am doing something wrong?

Plz help

Atul

Former Member
0 Kudos

Hi,

In the Custom Controller's wdDoInit() method, put the following code as it is.

Dont take only the single node as you have taken.

Take the whole input node as written below:

******************************************************

//@@begin wdDoInit()

Bapi_Po_Getitems_Input Input = new Bapi_Po_Getitems_Input();

wdContext.nodeBapi_Po_Getitems_Input().bind(Input);

//@@end

********************************************************

and in the executeBapi....() method in custom Controller,again dont take the single node.

Instead of that, take the whole bapi input node as suggested below:

*************************************************

public void executeBapi_Po_Getitems_Input( )

{

try {

wdContext.currentBapi_Po_Getitems_Input().modelObject

().Execute();

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException(e.toString(), false);

}

*******************************************************

Regards,

Tejas.

Former Member
0 Kudos

Hi!

Thanks Tejas for your replies.

I did it in the other way as mentioned in the weblog at the link

Thank you anyway for helping me out!

Atul