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

abap code for week number count

Former Member
0 Likes
2,613

HI

i need to count and display the week number like 32 week , 33 week in the year(total 52 weeks).

can any body tell me the logic or do we have any function module available for this counting?.

appreciated your help.

praveen.

6 REPLIES 6
Read only

Former Member
0 Likes
1,296

Hi Praveen,

Please check this FM <b>DISP_WEEK_GET</b>.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,296

REPORT ZSRIM_TEMP7.

data : v_weeks type i,

v_days type i.

v_days = 16.

v_weeks = ceil( v_days / 7 ) + 1.

write : v_weeks.

now V_WEEKS will have current week no.

Regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,296

try this.




report zrich_0001.

data: week type  scal-week.

call function 'DATE_GET_WEEK'
     exporting
          date = sy-datum
     importing
          week = week.

write:/ sy-datum, 'is in week', week+4(2).

Regards,

Rich Heilman

Read only

0 Likes
1,296

or use GET_WEEK_INFO_BASED_ON_DATE which will also tell you the Monday of that week and the coming sunday date as well.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,296

Hello Praveen

Function group SCAL an FB00 contain several quite useful calendar functions.

Regards

Uwe

Read only

Former Member
0 Likes
1,296

Hi,

You can use the FM <b>GET_WEEK_INFO_BASED_ON_DATE</b> , which Srinivas Mentioned, pass the date you get the week number, monday (date)of the week, and sunday(date) of the week.

Regards

vijay