cancel
Showing results for 
Search instead for 
Did you mean: 

Selected value from a Native drop-down.

Former Member
0 Kudos

Hi all,

I have a problem with a drop-down list from the "Web Dynpro Native" tab with Web Dynpro for Java.

The problem:

I can't get the selected value from the drop-down list in my Web Dynpro project, only the first value appears.

The approach:

For a drop-down list from the Standard tablad you can use the tutorial:

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/98af7acd-0401-0010-f697-bfa06971b65e

Because this isn't working for the Native drop-down I bound my values directly to my Context node.

See my last post in this toppic:

This is working fine and I can see my Context values in my drop-down.

But now when I select a value from that drop-down and press the submit button, just the first value from the

context node appears in my drop-down.

Another question related to this toppic:

How can I set a default value in a native drop-down? Set the default value in your webdynpro project like with a

standard dropdown does not work.

Does anyone has an idea?

Message was edited by:

B. van Prooijen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Please confirm my understanding .

If you are using a Value help to bind values to drop down box then you will get the index of your selection to the webdynpro project for each select event you trigger.

Please find the code snippet for reference

Get the index of the element selected -

================================

pCnt =Integer.parseInt(wdContext.nodeMaterialData().currentMaterialDataElement().getPlantCode());

Use Index to retrive the value from the bapi structure which used for pulling data from R/3 ( same data used to set as Value Help to the drop down list )

========================================================

Z_Bapi_Mat_List_Input matlist = new Z_Bapi_Mat_List_Input();

wdContext.nodeZ_Bapi_Mat_List_Input().bind(matlist);

Zbapi_Plant_Import plantimport = new Zbapi_Plant_Import();

wdContext.nodeI_Bapi_Plant_Import().bind(plantimport);

plantimport.setPlant(wdContext.nodeOutputPlant().nodeT_Bapi_Werks().getElementAt(pCnt).getAttributeAsText("Plant"));

Please try this if you are facing issue as same and let me know if you need any further information.

Regards,

Nanda

Former Member
0 Kudos

Hi Nanda,

It's not a value help drop down list but just a drop-down list.

So I expect to retrieve the choosen value in my webdynpro project after a submit.

But this isn't happening, I just retrieve the first value of the node, so the choosen value is completely ignored by the web dynpro.

Former Member
0 Kudos

Hi ,

Are you calling a BAPI when you do a submit to SAP ?

Can you please explain your problem ? What do you mean by "So I expect to retrieve the choosen value in my webdynpro project after a submit."

Nanda

Former Member
0 Kudos

Hi Nanda,

I have a value node in my web dynpro project (1..n).

I've bound this multiple value node to my drop-down as explained in my startpost.

Now when I choose a value from this drop-down and I press the "Submit" button in the IF, I don't retrieve this value in my project.

I've set the propertie "onSubmit" from the interactive form so that's what I mean with I expect to retrieve the choosen value.

I'm not calling a BAPI afterwards but I still need this choosen value.