Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to split date

1190_5939_439
Active Participant
0 Likes
1,148

Hi Experts

Now I met the below date issue.

For exmple: I input date query condition(20210201 to 20210228).

I hope I get 6 column values . [20210228.20210227.20210226.20210225.20210224.(20210201 to 20210203)].

How do I do it ?

4 REPLIES 4
Read only

joltdx
Active Contributor
1,074

Hi! I don't understand what is is you want and what logic you need for it...

What do you mean with "6 column values"? What does columns have to do with this? Do you want dates, strings, ranges, or what?

And which logic should be used to determine the dates (or values) to return? The last 5 dates from the input in descending order, and then the first tree dates, ascending, as a string? or as a range?

Read only

1190_5939_439
Active Participant
0 Likes
1,074

In ALV display I hope I get last 5 dates value and the other values(6 column values).

I want dates for it . Ascending as output is ok .

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,074

Oh you mean (20210201 to 20210223). (not 20210201 to 20210203) i.e. 6 buckets, first 5 buckets = 5 last days + last bucket for the rest of days.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,074

With all dates being of type D, including SELECT-OPTIONS s_dates:

date1 = s_dates-high.
date2 = s_dates-high - 1.
date3 = s_dates-high - 2.
date4 = s_dates-high - 3.
date5 = s_dates-high - 4.
date6 = s_dates-high - 5.
title6 = |{ s_dates-low }-{ date6 }|.