Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Finding greatest value of date in a table

Hi experts,

I have many dates in an internal table.How to find min and max dates of these.

Is there any FM or i have to write logic.

Please help.

Krishan

Tags:
replied

Hi Krishan,

Adding to pavan ans....

SORT itab BY date.

DESCRIBE TABLE itab LINES l_lines. "Get total number of lines in itab.

READ TABLE itab INTO wa INDEX 1 TRANSPORTING date. "Read first entry

Here wa-date have Min date value.

READ TABLE itab INTO wa INDEX l_lines TRANSPORTING date. "Read last entry

Here wa-date Have Max date value.

Thanks,

Vinod.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question