Skip to Content
avatar image
Former Member

UDF to know calendar week in a year

Hi PI/PO Experts,

I have a requirement to populate current calendar week of a year.

Could you please provide me an UDF to achieve my requirement.

I have checked in sap sdn forums and did not find it.

Thanks in advance.

Thank you,

Chakradhar N

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 10, 2017 at 11:32 AM

    Hi Chakradhar!

    Calendar calendar = new GregorianCalendar();
    Date trialTime = new Date(); // Your date here 
    calendar.setTime(trialTime);    
    int weekNumber = calendar.get(Calendar.WEEK_OF_YEAR));

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 10, 2017 at 12:01 PM

    Hi,

    Have you checked this blog

    https://blogs.sap.com/2009/02/13/yes-it-is-possible-with-datetrans-function/?, or you need a factory calendar like in SAP ERP?

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 10, 2017 at 04:13 PM

    Hi Inaki,

    Thanks a lot for providing the blog link, i did not find this blog before.

    It will full fill my requirement.

    Thanks again.

    Thank you,

    Chakradhar N

    Add comment
    10|10000 characters needed characters exceeded