cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 3.0 : Compare Dates in a table control

0 Kudos

Hi Experts

I have a requirement for transaction Display HR Master Data (PA20) to get the relevant entry from info type Action (0000) table for a particular date input.

Hence need to compare the date with the dates in the action table control in infotype 0000.

But the dates are in string format and cannot be compared.

Please suggest a way around for the same.

Thanks in Advance.

Regards

Pallabi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The dates should be presented in a standard format in the screens, so if you are looking for exact matches a string compare should still work. If you need to to use < or > then you'll need to use JavaScript string operations to break apart the date string and build JS Date objects, and do the comparison on those.

You'll need to beware of the user settings that control the presentation of dates, and the order of the components - "mm.dd.yyyy" vs "dd.mm.yyyy" vs "yyyy.mm.dd". There's no easy way around that...

Steve.

Answers (1)

Answers (1)

grant
Explorer
0 Kudos

Steve,

How do you handle dates in the Personas Javascript per the user settings?

My current report script has this code: session.findById("wnd[0]/usr/ctxtBDTER-LOW").text = month + "/" + day + "/" + year;

How do I handle a user setting that may have their date set up as MM-DD-YYYY? Right now the report doesn't work correctly due to their user settings being different than the coded script.

Thanks.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

session.info.dateFormat will give you the current user's date format, according to values of domain XUDATFM . You can code your date handling based on that.

grant
Explorer
0 Kudos

Thank you, this is great. Much easier than using a BAPI.