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 issue

Former Member
0 Kudos

I have to give date option as input parameter. and over there I have also need to give options like CURRENT,WEEK,MONTH,YEAR also related to date.

For example: I have given date like this. What else do I need to add for above mentioned requirement.

PARAMETER : ondate TYPE sy-datum DEFAULT sy-datum.

How I will do that.

Please do let me know.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Abhay,

Here is the solution to your query. Hope this helps you analyse any kind of date issues.

SELECT-OPTIONS: s_date FOR sy-datum. "Select option during selection screen.

DATA: x_date LIKE s_date.

INITIALIZATION.

x_date-low = sy-datum - 730. "Two years from the day the Report is run for low data.

x_date-high = sy-datum + 365. "One year beyond the day the Report is run for high data

APPEND x_date TO s_date.

Reward points.

Thanks,

Tej..

3 REPLIES 3

Former Member
0 Kudos

Hi Abhay,

Here is the solution to your query. Hope this helps you analyse any kind of date issues.

SELECT-OPTIONS: s_date FOR sy-datum. "Select option during selection screen.

DATA: x_date LIKE s_date.

INITIALIZATION.

x_date-low = sy-datum - 730. "Two years from the day the Report is run for low data.

x_date-high = sy-datum + 365. "One year beyond the day the Report is run for high data

APPEND x_date TO s_date.

Reward points.

Thanks,

Tej..

Former Member
0 Kudos

Hi,

You have the current date in "ondate"

Current week:

use the FM :

DISP_WEEK_GET

pass :

I_DATUM = ondate

get

E_WEEK - current week and currnet year in the format "WW.YYYY"

current year is pretty simple:

the first 4 chars of the date

current month the next 2 characters of the date

Kindly be generous with points if you find it useful.

Regards,

Gaurav

santhosh_patil
Contributor
0 Kudos

Hi,

try with

PARAMETER : ondate TYPE sy-datum DEFAULT sy-datum,

month type T247-MNR,

week type T248-WEKNR.

---Patil