Application Development 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: 

Looping from 1 inputted date to an other

warcsi
Participant
0 Kudos
276

Hello,

I am working on an assignment and was wondering if what I want to do is plausible and if yes what is the best way of doing it.

I have a selection screen with select-options for the the input Parameter where you can enter either a date or a date range.

I would like to loop my code to go from the first inputted day to the next untill it reaches the last, and do a small select statement and a write statement for each day it has looped trough.

What I was thinking is id first check if there is both a low and high input on the select statement and if its only a low make one select statement and a write in case there are more I know I can increase the date of one field and compare it to an other but I am unsure if that would work.

Can I somehow loop a select-option perhaps?

Any ideas or a point in the right direction is greatly apreciated

Thanks for reading.

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
235

Do you want to include off days too? (Saturday, Sunday)

Is that just to practice ABAP, or real scenario? In that case, could you explain more?

Is that a duplicate question? Date Range Table loop from start day to last | SAP Community