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: 

Date Range Table loop from start day to last

warcsi
Participant
0 Kudos

I have a range table I got from a Select-Option that is filled with dates

I would like to get all days individually so I can make a selection with them individually ( I am aware I can use Select IN) maybe loop them somehow if its possible or turn the dates into an internal table with dates.

Is there a way this is possible

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

AFAIK there is no avalaible database table of days from which a select coulm be performed.,

  • So process a I/BT/low/high select-options recorde with a DO / LOOP incrementing date from low to high by increment of 1 (only process low value record in case of I/EQ)
  • You should also prevernt multiple records with NO-EXTENSION option
  • You could also restrcit the select-options to single values (I/EQ/low ) and single range (I/BT/low/high) with FM SELECT_OPTIONS_RESTRICT
5 REPLIES 5

raymond_giuseppi
Active Contributor

AFAIK there is no avalaible database table of days from which a select coulm be performed.,

  • So process a I/BT/low/high select-options recorde with a DO / LOOP incrementing date from low to high by increment of 1 (only process low value record in case of I/EQ)
  • You should also prevernt multiple records with NO-EXTENSION option
  • You could also restrcit the select-options to single values (I/EQ/low ) and single range (I/BT/low/high) with FM SELECT_OPTIONS_RESTRICT

0 Kudos

Thank you this is really helpfull

warcsi

I suggest you peruse my blog here: https://blogs.sap.com/2014/02/07/dates-and-select-options/

The point is that you'll often see in standard SAP programs something that looks like a standard date select option, but is actually made up of two parameters. In this way, you always have the low and high date and you don't need NO-EXTENSION and you don't need SELECT_OPTIONS_RESTRICT.

It really is the simplest way to achieve your goal.

It's what SAP do.

Sandra_Rossi
Active Contributor
0 Kudos

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?

Sandra_Rossi
Active Contributor
0 Kudos

NB: I see the same question many times in the forum: