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

selection options with dates

Former Member
0 Likes
866

Hallo Experts,

I have a requirement to put the last date of the last month as a second option in the selection option or let us say as a parameter e.g:

Today is 05.10.2018 so this parameter should be 30.09.2018.

and so on...

please your advice to do this

Jenie

3 REPLIES 3
Read only

fikretsomay
Participant
0 Likes
758

Hello,

You can achieve this by using events (INITIALIZATION etc.)

To calculate the last day of a month use this FM: LAST_DAY_OF_MONTHS

Fikret.

Read only

matt
Active Contributor
758

Don't use select options for dates. You'll notice that SAP standard reports rarely use them - instead they use two parameters; one for start one for end, though often in the same row. See my blog here: https://blogs.sap.com/2014/02/07/dates-and-select-options/

There are many many questions with good answers concerning making date calculations. You really should search before asking questions.

Read only

Jean_Sagi
Participant
0 Likes
758

A manual approach would be something like:

  1. Use the date parameter you have and write 01 to the day. So if you have 05.10.2018 you convert it to 01.10.2018.
  2. Subtract 1 from the new date. Having 01.10.2018 subtracting 1 form it yields to 30.09.2018. That is what you need.

It should work for any date.

BTW: Have in mind mr. Billingham comment. His blog are very insightful.

J.