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

date issue

Former Member
0 Likes
585

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.

SELECT-OPTIONS : ondate FOR sy-datum DEFAULT sy-datum.

How I will do that.

Please do let me know.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
559

Hi,

Check the following link for date related function modules:

http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm

For examples;

http://www.sap-img.com/abap-function.htm

Regards,

Bhaskar

5 REPLIES 5
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
559

Hi

select single ktx from t247

into g_mname

where spras = sy-langu

and mnr = g_date2+2(2).

it will give current month and year.

Regards,

Sree

Read only

Former Member
0 Likes
559

Hi

Just One date field is enough on the selection screen

because from the date

by offsetting the date

we can get the Current MONTH and YEAR

year = sy-datum+0(4).

month = sy-datum+4(2).

use the function module for getting the current week

HRIQ_DATE_GET_WEEK

and now you can use all these field values in the selection.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
560

Hi,

Check the following link for date related function modules:

http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm

For examples;

http://www.sap-img.com/abap-function.htm

Regards,

Bhaskar

Read only

Former Member
0 Likes
559

Hey Abhay,

in the initialisation.

You can get the current month and year by taking the offset of the sy-datum.

for getting the current week use the fn module 'DATE_GET_WEEK'.. take the offset 4(2) to get the week no.

Regards,

Vidya.

Read only

Former Member
0 Likes
559

Hi,

for the current week

use the function module

DATE_GET_WEEK

give the date

ex 01.01.2007

it will give

200701 here 01 is first week

ex

15.01.2007

it will give

200703 means third week

reward points if helpful.

regards,

venkatesh