cancel
Showing results for 
Search instead for 
Did you mean: 

DI enum and String definition

Former Member
0 Kudos

Hi all,

I have a question on "How to" and best practice...

There are several enum like SAPbobsCOM.BoResolutionUnits.rsu_Days and the Table Result is "D", or "H" - hours..

that means  the Object it self SAPbobsCOM.ServiceContracts oCT

need to have a Value like  oCT.ResolutionUnit = SAPbobsCOM.BoResolutionUnits.rsu_Days;

But where is the conversion to Days? is there a dictionary available or a table ?

And if I like to use this in a user form... I have to convert this from Combobox valid values to excepted enum...

So the question is, where are the valid values stored? And are there any standard functions available for conversion? Or just C# normal ways...

putting the Valid Values into a list or dictionary and retrieve this with a getenummerator?

Thanks for any input.

Best regards

Oliver


Accepted Solutions (0)

Answers (1)

Answers (1)

maik_delly
Active Contributor
0 Kudos

Hi Oliver,

you will find the enum values in SDK Help or in Visual Studio  "Go To Definition ( F12 )", BUT this is not giving you the real mapping ( 0 = 'D' , 1 = 'H' ).

You can have a look in "Database Documentation" ( through SDK Help or REFDB.chm ) and get the valid values ( constraints ) for the specific field  - imho they are in the order of the enumeration.

This is not ideal....

regards,

Maik

Former Member
0 Kudos

Hi Mark,

thanks, yes I know where to find the information of enums... and as well where to find the valid values. and the mapping is clear to me...

it's done by

[Guid("49669F5E-5C23-423D-B99A-9F5374355D54")]

    public enum BoResolutionUnits

    {

        rsu_Days = 0,

        rsu_Hours = 1,

    }

what I like to know is, where to find the mapping in a Table or resource file... Where is the D = Days located and how I'm able to use standard b1 conversion? Is there a place where these  Values are located... somewhere in a Table? or Resource File... how is the way B1 ist working with it... like Reflection? Atributes? are they using Dictionaries? List??? In result of it I want to decrease the program lines ... instead of using Switch or if statements... may be there is a way of working with a getenumaration method or function like an attribute ... as well to provide system language without having my own language dictionary ...

if you see in the Help Files..

Member Value Description

rsu_Days 0 Days

rsu_Hours 1 Hours

and have a look at lines at the top... there is no description attribute set... and where is the D or H?

Do you know how to handle this? or where to find? I can't believe that there is no such method or functions or dictionaries or table... what implies that all this is hardcoded by B1... on all languages???

Thanks

Oliver

maik_delly
Active Contributor
0 Kudos

I understand your point, but afaik there is no such method / list available. The only way I see is like described above ( to get D or H manually 😞

I am aware, that this is not what you are looking for. I beleive the values are indeed hardcoded ( OBServerDLL.dll  )

regards,

Maik

Former Member
0 Kudos

Hi Mark,

yes I know this ... i can't believe it.... see some tables... like SXRET (SBO_Common) and there is a part describing a table... but I do not find the Table in DB.... this is something that I'm looking for...

but anyway I couldn't believe that it is hardcoded... there are language files... etc... but i don't know where the Metatables are located... and how to get them...

Best Regards.

Oliver