cancel
Showing results for 
Search instead for 
Did you mean: 

regarding value help in web dynpro

Former Member
0 Kudos

hai ,

Iam using value help in my web dynpro appliaction where clicking on the value help icon i get the master details from the rfc as a drop down.In the drop down i have two keys

eg

-


key | desc

-


001 | salesorg

On selecting the required field from the drop down i need the salesorg to get entered in the input field instead if 001.also i need the required field to be passed to be saved in database.

please help me in this issue

regards

Sharanya.R

Accepted Solutions (0)

Answers (2)

Answers (2)

ankur_garg5
Active Contributor
0 Kudos

Hi Sharanya,

We faced a similar issue in our project some time back, and unfortunately there is no solution for this. You cannot make the value in desc column to get filled in the input field on selection.

One thing you can do is that exchange whats there in the desc field with whats there in the key field. But I know this is not feasible, since those numbers would be the primary key in your case.

The other thing which you can do is that concatenate the number 001 and description salesorg and display it in the key field. Leave the desc field as it is. It would look something like this:

key | desc

001-salesorg | salesorg

While submitting, you can break the text 001-salesorg to retrieve 001 only.

-


Now look at the code how this can be achieved:

To display the Value Help:

IWDAttributeInfo info = wdContext.getNodeInfo().getAttribute("<context_name>");

ISimpleTypeModifiable name = info.getModifiableSimpleType();

IModifiableSimpleValueSet ValueSet = name.getSVServices().getModifiableSimpleValueSet();

ValueSet.put(<key>" - "<desc>,<desc>);

To retrieve the key:

String inputfield = wdContext.currentContextElement().get<context_name>();

int dash_index = inputfield.indexOf("-");

String key = inputfield.substring(0,dash_index-1);

Hope it solves your problem. This is how we solved ours

Bye

Ankur

Former Member
0 Kudos

hai ankur,

Thanks for the help.Also if thats not possible as u said i need to display the description of the selected option as a label or textview next to the input field containing value help.please send me the coding of how to display in runtime _label or textview_

Former Member
0 Kudos

Hi Sharanya,

This you can do by changing the Input Field UI element to Dropdown By Key. The dropdown will autonatically have the description. If you want to pass the description instead of Key to the database you need to create method that will fetch description of selected key. This you can do this by the code:

public java.lang.String getDescription( java.lang.String strID )

{

for (int iCtr = 0; iCtr < valueSet.size(); iCtr++) {

String tempID = valueSet.getKey(iCtr).toString();

if (tempID.equals(strID)) {

description = valueSet.getText(iCtr);

}

}

return description;

}

Above valueset will have the Key,Description values of that EVS and strID is the selected Key by the user.

Hope this helps!!!!!!!!!

Regards,

Gurmat

Former Member
0 Kudos

hai ,

iam able to get the value but i need to know how to set that value to a textview or label next to the inputfield containing value help based on user selection made in value help .

eg


key desc @ -


>inputfield containing value -


************---->textview


based on key selected description should be displayed in the textview

regards

Sharanya.R

former_member197348
Active Contributor
0 Kudos

Hi Sharanya,

If it is EVS, you can use this [tutorial |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0e57440-ec1c-2a10-36b1-fe92341f98c4]

It worked for me.

regards,

Siva