Skip to Content
author's profile photo Former Member
Former Member

Simple Value Selector

Hi,

I have a field that uses Simple Value Selector. When I check the SVS drop down, It has 2 names Tom and Mark.

If I do not want to put any of these 2 names in that Input field, but instead put Mike in the field, it throws me the following error.

<b>String "MIKE " does not match the enumeration</b>

Is it possible in an input field associated to SVS, if I do not see a value in the SVS that I want to use. Can I input a new Value in the Input field without getting the above error.

Any help would be appreciated.

Thank you.

NAC

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2005 at 06:11 PM

    Hi SAP Partner,

    I donot know whether this would be recommended but this works..

    When you define your enumeration, there is a check box "Generate a class representation of the enumeration", select this check box. This generates a java class file in the gen_ddic folder with the name as your simple type.

    For your requirement to work...Open this java file and make the change as given below....

    in the static method valueOf(String name), there is a line returning the object which will be like -

    <i>return (<Simpletypename>) enum.get(name);</i>

    change this to

    <b><i>return ((<Simpletypename>) enum.get(name)!=null?(<Simpletypename>) enum.get(name):new <Simpletypename>(name));</i></b>

    The problem is it may not be recommended as i have told earlier, also when you add a new value to the enumeration, this class file is generated again. So you will have to make this change again.

    Also there might be problems if this project is synced with NWDI and a central build is done with the CBS, the file might be generated again which will lead to inconsistencies.

    Thanks & Regards,

    Renjith

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 10:33 AM

    Well, SVS / EVS functionality assumes validation of entered values against enumeration of all valid entries (valueset).

    So if you are adding your own value from code, you have to modify original value set first (add new entry). If you let user to enter you values... Hmmm... probably you may try calculated attributes for this task and add user defined value to valueset in attribute "setter"

    VS

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.