cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping with dropdown component

Former Member
0 Kudos

Hi,

I have a view with a dropdownbyIndex component. The entries available in the dropdown list are comming from a bapi result.

In order to do this, the property "texts" of the compopnent is pointing to a model attribute of my context which is mapped to my custom controler .

This works fine and when executing I see all possible values coming from my bapi.

Now the problem is that I need to get the selected value of the list to be an input parameter for another bapi I import in my model.

How to do this ?

My view context have a node "MyList" and under this a property "MyProp" but it is already bound in my custom controler to the bapi_input that get the list to display.

If I try to set manually the bapi_input (wdContext.myNode.currentElement.setMyProp("toto")), a null pointer exception occurs at runtime.

Thanks,

Sylvain

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Consider you want to send the selcted value to another modelNode with following structure.

Model2

Input

AttrInput

wdContext.nodeModel2().bind(new Model2());

wdcontext.currentInputElement().setAttrInput( wdContext.OldOutputNodeElement().getValue());

now use execute method on Model2 node.

Regards, Anilkumar

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

suppose your dropdownindex is bound toan attribute 'droptext'which is under node 'dropnode'.

now you can set the bapi input manually as

wdContext.myNode.currentmyNodeElement.setMyProp(wdcontext.nodedropnode.currentdropelement.getdroptext());

now exceute your bapi.

hope it works.

Former Member
0 Kudos

Hi,

Thanks for your answers.

I solved my problem using :

	Bapisditm items = new Bapisditm(); 
	items.setMaterial(wdContext.nodeArticle().currentArticleElement().getMatnr());
	inputPO.addOrder_Items_In(items);

The problem was coming from the fact that the bapi was requiring input tables.

Sylvain

Former Member
0 Kudos

Hi Sylvain,

Nice to hear that you have solved the problem.

So, please close this thread.

Regards,

Bhavik

Former Member
0 Kudos

Hi Sylvain,

I am geussing that you have not instantiated your bapi_input node before setting the value.

Can you give me your BAPI structure for both.

And how you are passing value from the list to the another BAPI?

Regards,

Bhavik