cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the enum of a simple data type (dictionary)

Former Member
0 Kudos

Hello,

so I created a simple data type "LogLevels", entered some enumeration values and I generated a class representation:

public class LogLevels

{

private String name = "";

private LogLevels(String name) {this.name = name;}

private static final HashMap enum = new HashMap();

...

static { // fill enum ... }

...

}

Sure I can simply link the simple data type to a list box, which is nice, but how do I access the list (enum) from a model class? I was expecting a generated method something like this:

public HashMap theCollection() {

return enum;

}

I guess there must be some other way to access the list from a model class - anyone mind telling me how?

Thanks in advance,

Troy Holly

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hello guys,

i am new to webdynpro, can anybody tell how to initialize "Enum" com.sap.mw.jco.util class.

i used

Enum ACTION {select,delete,udpdate};

and it showing error. " expected "{" , "," , "," expected "??

please help me,

Former Member
0 Kudos

Troy,

This is a limitation of current WD generator: it does not expose neither values (as <b>final public static <EnumType></b> constants) nor collection of values.

Sure, it would be great if generated class looks like WDVisibility or any other standard WD enumeration type.

However, currently the only workaround is access enum value like <EnumType>.valueOf(<enum-key-you-typed-in-editor>); Obviously, it is better to encapsulate this functionality in separate class.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com/