cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with a Webdynpro scenario

Former Member
0 Kudos

Hi,

I have the following scenario.

I have a webdynpro application (form) which allows the user to change some data. When the page loads, the data already available is displayed in the corresponding UI elements in the form. This is done using a BAPI call. Then after the user modifies the values and clicks modify, the corresponding values should be updated using a different BAPI call.

Here, for displaying the values at first, I have mapped the view context to the controller context and in turn to the corresponding model. But to update using a different Model class, how can we map the updated values dynamically, say on submit? Can the view context attributes, mapped to multiple controller context attributes? Or is there any other way to acheive this.

I have another question. I have a dropdown UI element in the same application. It is populated with data coming from a BAPI call. But how can we set the selected value to the one which the user has already stored previously? Remember, the user is modifying the values.

thanks in advance!

KK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi KK,

You can achieve the same by copying the UI attributes to a new node in the controller using copy corresponding( i am assuming your node structure and name remains same). You can then pass this node to the 2nd BAPI.

and when you get the next display the 1st BAPI will get you updated data.

For the UI dropdown also, you can persist the data in a value node and then check if the dropdown model node for this element and set it default. OR there needs to be some sorting in the BackEnd.

Kind Regards

Asif

Former Member
0 Kudos

Hi Asif,

Thanks for the reply.

The drop down scenario is like this. When the form loads, the dropdown values(List of countries) are got from a BAPI. But the previously stored value for that feild comes from another BAPI. So how can we get the index for that value from the drop down values and set it as teh lead selection? I guess you got my question.

The values are mapped to context attributes.

thanks

KK

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi KK,

Assuming that:

1. You have a node NodeX, where attribute TargetAttr defined

2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute

Then:

Place in your code:

wdContext.currentNodeXElement().setTargetAttr("yourKey");

You can get the "yourKey" from your previous UI dropdown element in the View.