Skip to Content

Personas 3.0 : Compare Dates in a table control

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 03, 2017 at 10:39 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2017 at 03:46 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded