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

about date

former_member842213
Participant
0 Likes
963

hi all ,

i want to extract date ,month and year separetly,(for eg from fkdat)

i need to find the week as well....(is there any fn module to find out the week)..

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
932

check fm

GET_WEEK_INFO_BASED_ON_DATE

for date

data : year(4),

mon(2),

day(2).

year = sy-datum(4).

mon = sy-datum+4(2).

day = sy-datum+6(2).

regards

shiba dutta

7 REPLIES 7
Read only

Former Member
0 Likes
933

check fm

GET_WEEK_INFO_BASED_ON_DATE

for date

data : year(4),

mon(2),

day(2).

year = sy-datum(4).

mon = sy-datum+4(2).

day = sy-datum+6(2).

regards

shiba dutta

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
932

Hi,

fkdat will be in yyyymmdd format.

Suppose v_fkdat is holding the value.

v_fkdat+0(4) will give year.

v_fkdat+4(2) will give month.

v_fkdat+6(2) will give date.

Read only

Former Member
0 Likes
932

Hi,

1)

To get the date, month year.

DATA: V_DATE TYPE FKDAT.

V_DATE = SY-DATUM.

WRITE: / 'Date -', V_DATE+6(2).

WRITE: / 'Month -', V_DATE+4(2).

WRITE: / 'Year -', V_DATE+(4).

2) Use the FM DATE_GET_WEEK to get the week for the date.

Thanks,

Naren

Read only

Former Member
0 Likes
932

Use the follwoing function module to find the week:

<b>DATE_GET_WEEK</b>

PLZ REWARD POINTS IF HELPFUL

Read only

Former Member
0 Likes
932

Hi,

To fetch date, month and year differently. u can assign it to three different variables or just print them .

For printing them:

DATA: V_DATE TYPE FKDAT.

V_DATE = SY-DATUM.

WRITE: / 'Date -', V_DATE+6(2).

WRITE: / 'Month -', V_DATE+4(2).

WRITE: / 'Year -', V_DATE+(4).

for checking the week for that day, month and year. You need to use this function module.

DATE_GET_WEEK

Send the date to the function module and the solution will contain the year along with the week number.

Read only

Former Member
0 Likes
932

Hi,

Use the FM:

<b>DATE_GET_WEEK</b>

will return the week that a date is in.

Hope it helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
932

Hi,

fkdat will be in format yyyymmdd

fkdat+0(4) will give YEAR

fkdat+4(2) will give MONTH

fkdat+6(2) will give DATE

check FM

DATE_GET_WEEK to get week

Reward if helpful

Hemant