cancel
Showing results for 
Search instead for 
Did you mean: 

Data Types and best practices

Former Member
0 Kudos

Hi Guys,

I'm looking for some information about best practices guide in web Dynpro

also about some recommendations about what are the best data types used in SAP web dynpro to manage the context in the best way

in fact what i would like to know is if can you give me some recommendations in this area provided by SAP or your personal experience

any help it's apreciated

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I would like to be more expecific to help with your answers

it happends because developing a web dynpro we had some issues with java.util.Date and java.util.Calendar management ,comparing two Calendar objects and formating Dates, i would like to know if we can do it in a "SAP way"

the code we develop and found issues is

Calendar expCal=Calendar.getInstance();

Calendar dispCal =Calendar.getInstance();

when we debug this looks like first <b>but only first</b> "get instance" doesn't work

and sometimes when we set this values some values are filled with random values

dispCal.set(Calendar.YEAR,display.getYear());

dispCal.set(Calendar.MONTH,display.getMonth());

dispCal.set(Calendar.DAY_OF_MONTH,display.getDate());

dispCal.set(Calendar.HOUR_OF_DAY,hour.intValue());

dispCal.set(Calendar.MINUTE,minute.intValue());

dispCal.set(Calendar.SECOND,0);

this values are taken from context

our context values are defined as Date i think are java.sql.Date

the way i read values from Context are

java.util.Date display=wdContext.currentContextElement().getDisplayDate();

java.util.Date efectiv=wdContext.currentContextElement().getDisplayDate();

java.util.Date expired=wdContext.currentContextElement().getExpirationDate();

Integer hour =new Integer(wdContext.currentDisplayHourElement().getHour().substring(0,2));

Integer minute=new Integer(wdContext.currentDisplayHourElement().getHour().substring(3,5));

again Thanks for your answers