on 01-09-2008 11:20 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.