How to determine the month from the week number?

Hi all,
in a routine i have the week number in a year and i need to find the month but i don't know the correct FM to use for this.
Is there anyone that had to face a similar problem?
I'm considering that to determine the month it will be used the first day of the week since there are weeks belonging to 2 different months...
Thank you
Stefano

Hi
If you have a Fiscal Year Variant determined for the week you can use function module PERIOD_DAY_DETERMINE by passing week,fiscal year and fiscal year variant for the week which will return fist and last date.So based on last data you can determine the month.
Regards
Srilaxmi

Similar Messages

  • How to determine client locale from the mail?

    How to determine client locale(language/country) from the mail(header)?
    I investigate that some mails have not got any content-language header...
    Also, If mail is in multipart , I cannot get it throught the contentType....
    e.g some header contain header like this: content-Type: "text/html; charset=Big5"
    but some are : content-Type: multipart/mixed; boundary......";
    So, how can I know the client locale?
    Thanks

    You should be able to get the charset from the content type, as u said. the reason some types don't have a charset, such as multipart/* types, is because they don't contain any content on their own! they only contain nested body parts, each of which should have a charset specified. you're gonna have to get the charset by following the mail structure recursively.

  • Extract the Month from the day with Query designer ...

    Hi everybody,
    Is there exist a method in Query designer to extract the CalMonth (Date Month) from the CalDay ?
    Thanks!
    Rodolphe.

    take reference from this step by step doc:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a

  • How to determine if coming from the Error Page?

    Version 4.1.1.00.23
    Hello,
    I have a manually created tabbed form with a collection.
    I've added a validation and set the error message to display on the Error Page to preserve the information entered into the form.
    One of the Select Lists is a cascading list. That list does not populate when returning from the Error Page.  The parent list is populated and does show the value selected before the error was thrown. It's just the list that is based on the parent that isn't populated.
    If I refresh the page the Select Lists are reset and I can access the values normally.
    So, what I think I want to do (and I'm not sure here) is to refresh the page when returning from the Error Page.
    How can I determine if I'm coming back from the Error Page?
    Is there a better solution?
    Please let me know if this isn't clear or there are questions.
    Thanks,
    Joe

    Hello,
    I'm hoping someone can help me with this.
    Thanks,
    Joe

  • How to determine a BP from the user

    HI Experts,
    We have a scenario where there are contract employee's which are not maintained in the system as employee but maintained as BP, now during creation of any transaction i need to determine the contract BP based on the user, in the user master we are maintaining e-mail, the same is also maintained in the BP, which is also unique, is there any ways i can dtermine the BP in the transaction, please somebody help me, this is very crtical in my project.
    Regards
    Milan

    You can always use badi. To use badi, you would have to define in partner access sequence as source COM_PARTNER_Z (Business add-in 3).
    Then you would have to create your implementation of that badi (spro>crm>basic functons>partner processing>business add-in for partner). In thet badi implement method DETERMINATION_ADD_IN_3 in which you can put whatever logic you need.
    Regards.

  • How to - get first DAY of the month from the date ?

    Hi
    pls help

    hi,
    data : DAYNR LIKE HRVSCHED-DAYNR,
    DAYTXT LIKE HRVSCHED-DAYTXT.
    data langu like sy-langu value 'EN'.
    Parameters PDATE LIKE SY-DATUM.
    PDATE+6(02) = '01'.
    CALL FUNCTION 'RH_GET_DATE_DAYNAME'
    EXPORTING
    LANGU = LANGU
    DATE = PDATE
    CALID =
    IMPORTING
    DAYNR = DAYNR
    DAYTXT = DAYTXT
    DAYFREE =
    EXCEPTIONS
    NO_LANGU = 1
    NO_DATE = 2
    NO_DAYTXT_FOR_LANGU = 3
    INVALID_DATE = 4
    OTHERS = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE :/ PDATE, DAYNR, DAYTXT.
       (OR)
    Try..
    DATA:DAYNR  LIKE  HRVSCHED-DAYNR,
         DAYTXT LIKE  HRVSCHED-DAYTXT,
         DAYFREE LIKE  HRVSCHED-NODAY.
    DATA:LANGU LIKE  SY-LANGU ,
         DATE LIKE  SY-DATUM,
         CALID LIKE  P1027-CALID VALUE 'US'.
    date = sy-datum.
    date+6(2) = 01.           "----->to get the first day .
    *first day of the month
    write:/ 'First date of the month', date.
    *Day name
    CALL FUNCTION 'RH_GET_DATE_DAYNAME'
      EXPORTING
        langu                     = SY-LANGU
        date                      = DATE
        CALID                     = CALID
    IMPORTING
       DAYNR                     = DAYNR
       DAYTXT                    = DAYTXT
       DAYFREE                   = DAYFREE
    EXCEPTIONS
       NO_LANGU                  = 1
       NO_DATE                   = 2
       NO_DAYTXT_FOR_LANGU       = 3
       INVALID_DATE              = 4
       OTHERS                    = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE:/ DAYTXT.
    Don't forget to reward if useful....

  • Calculating Length of Service - Splitting out the months from the years

    Hi folks,
    I was wondering if anyone might have the answer to a little employee length of service conundrum. I'm trying to construct a calculation that will calculate an employee's length of service in whole Years worked only. I also need to produce a second calculation to calculate length of service in whole months worked only but with the whole years worth of months deducted from it.
    For example if a persons hire date is 05-Feb-2001 the two calculations would return:
    Length of service Years 7
    Length of service Months 6
    The following calc will generate length of service as a decimalised number:
    MONTHS_BETWEEN(SYSDATE,Hire Date) /12
    So for my example person I get 7.64 years.
    I need to somehow round this down to the nearest 1 to get whole years service. I cannot use the ROUND function because it rounds to the nearest, so when a number is n.5 or higher it'll round up and will only round down when the number is n.49 or lower. grrr.
    My next mission is to work out months service based on whats after the decimal place. If I could round the Length of service Years down I think I could achieve this. I would just do:
    ROUNDDOWN(((MONTHS_BETWEEN(SYSDATE,Hire Date) /12) - (+ROUNDDOWN+(MONTHS_BETWEEN(SYSDATE,Hire Date) /12))*12)
    ROUNDOWN being my non-existent function!
    Any advice on this is greatly appreciated.
    Lloyd

    Hi,
    TRUNC is the function I always use to round down. It is more flexible than FLOOR as you can use it to round down to a number of decimal places.
    You should also understand that Oracle's definition of MONTHS_BETWEEN does not meet everyones expectations. For example MONTHS_BETWEEN('28-JAN-2001', '28-FEB-2001') is exactly 1 so is MONTHS_BETWEEN('31-JAN-2001', '28-FEB-2001') unless it is a leap year when it is slightly less. That's because Oracle treats the last day of the month as different when it calculates the months between 2 dates.
    Rod West

  • How to get the Month from no of week

    Dear Friendz
    I have one variable which contains the value as 200547 where 2005 is the year and 47 is the no of week.
    now i want to get the month from the no of week.
    so how to solve the problem???
    thank in advance.
    Regards
    nilesh shete

    Hi,
    report ztest.
    data: myweek type SCAL-WEEK,
          mydate type SCAL-DATE,
          mymonth(2).
    myweek = '200547'.
    call function 'WEEK_GET_FIRST_DAY'
         EXPORTING
              WEEK   = myweek
         IMPORTING
              DATE   = mydate
         EXCEPTIONS
              others = 9.
    mymonth = mydate+4(2).
    write mymonth.
    Svetlin

  • How to get last week of the month from a month

    Hello,
    I want to get last week of the month from a month. For example: If Input = April then Output = Week17. Is there any function module? Or what should be the logic inorder to meet such requirement?
    Thanks in advance for your answers.
    Nitin.

    Hi,
    Just cpoy and past this program, and see the result and apply for you requirements.
    Data: ZSCDATUM TYPE SCDATUM,
          ZKWEEK TYPE KWEEK,
          ZDAY TYPE SY-DATUM,
          ZLDAY TYPE SY-DATUM,
          ZWK(3) TYPE N,
          ZM(2) TYPE N.
          ZDAY = SY-DATUM.
          ZM = ZDAY+4(2).
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
            EXPORTING
              day_in                  = ZDAY
            IMPORTING
             LAST_DAY_OF_MONTH       =  ZLDAY
    *       EXCEPTIONS
    *         DAY_IN_NOT_VALID        = 1
    *         OTHERS                  = 2
          IF sy-subrc <> 0.
    *         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          ZSCDATUM = ZLDAY.
          CALL FUNCTION 'DATE_GET_WEEK'
            EXPORTING
              date               = ZSCDATUM
           IMPORTING
             WEEK               = ZKWEEK
    *       EXCEPTIONS
    *         DATE_INVALID       = 1
    *         OTHERS             = 2
          IF sy-subrc <> 0.
    *         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          ZWK = ZKWEEK+4(2).
          WRITE: ZKWEEK.
          WRITE: ZWK.
    Thanks
    Reddy

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

  • My Adobe X! trial expired I paid for a month to month subscription on MArch 13, 2015 but I could not activate it. The prompt is asking me for a serial number (which I wouldnt have since I downloaded the trial from the website. How do I activate it with my

    My Adobe XI trial expired I paid for a month to month subscription on MArch 13, 2015 but I could not activate it. The prompt is asking me for a serial number (which I wouldnt have since I downloaded the trial from the website. How do I activate it with my Adobe ID? "activate with Adobe ID" is not an option on my screen. It only asks me for the serial number.

    uninstall your acrobat XI.
    if win os clean, Download Adobe Reader and Acrobat Cleaner Tool - Adobe Labs
    then dl the desktop cc app and use it to install your subscription acrobat XI, Creative Cloud Help | Creative Cloud for desktop

  • How to get name of the month from current date.

    Hi,
       How to get the name of the month from current date.
    Thanks,
    Senthil

    Sethil,
    Use your date(let us say Date1) instead of sy-datum.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
    TABLES
    MONTH_NAMES = itab_month
    EXCEPTIONS
    MONTH_NAMES_NOT_FOUND = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE itab_month
    WITH KEY MNR = date1+4(2).
    itab_month-LTX will contain the value you are looking for
    Good luck
    Raghava

  • I have acrobat professional and photoshop elements. New Mac arrives next week how do I move these from the old machine  as I cannot find the product codes

    I have acrobat professional and photoshop elements. New Mac arrives next week how do I move these from the old machine  as I cannot find the product codes

    You cannot move or copy software between computers. You must reinstall. You will need the serial number. Check your account details on Adobe's site if you registered.

  • I wish to set a repeat for an event but I do not get a customise option on my iphone 4s so cannot set the third monday of the month - only day, weekly 2 weekly monthly or annually - how do I resolve the problem ?

    I wish to set a repeat for an event but I do not get a customise option on my iphone 4s so cannot set the third monday of the month - only day, weekly 2 weekly monthly or annually - how do I resolve the problem ?

    Week Cal uses the calender database already on your phone. It's just a different front end.

  • I want to upgrade my student plan to the premium one at the 19.95/month from the 15.95/month plan, I don't know how?

    I want to upgrade my student plan to the premium one at the 19.95/month from the 15.95/month plan, I don't know how?

    Are both plans Student plans?  The non-student plan for CC is $50/month for all applications or $20/month for one application.

Maybe you are looking for