Function Module to convert date to week from Sunday to Saturday

Hi,
In BW the convertion date to week always give week from Monday(1) to Sunday(7)
I'm looking for a function module to convert date to week from Sunday(1) to Saturday(7)
Thanks
Sebastien

Hi,
I think this SAP standardized. Maybe you need to create custom FM.
You can copy SAP FM DATE_GET_WEEK. in the FORM FIRSTWEEK, I see below case,
CASE start_weekday.
    WHEN if_calendar_definition=>c_monday.
      start_weekday_number = 1.
    WHEN if_calendar_definition=>c_tuesday.
      start_weekday_number = 2.
    WHEN if_calendar_definition=>c_wednesday.
      start_weekday_number = 3.
    WHEN if_calendar_definition=>c_thursday.
      start_weekday_number = 4.
    WHEN if_calendar_definition=>c_friday.
      start_weekday_number = 5.
    WHEN if_calendar_definition=>c_saturday.
      start_weekday_number = 6.
    WHEN if_calendar_definition=>c_sunday.
      start_weekday_number = 7.
  ENDCASE.
Maybe you can play something here.

Similar Messages

  • Function module to convert date format from yyyymmdd to mmddyyyy format

    function module to convert date format from yyyymmdd to mmddyyyy format

    Hi Rajitha,
    Do like this
    Data: Var1 type sy-datum,
             var2(8) type c.
    var1 = sy-datum.
    Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
    write var2.
    Reward Points if this helps,
    Satish

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Is there any function module to convert date format?

    Is there any function module to convert date format from mm/dd/yyyy to dd.mm.yyyy or sy-datum?

    Hi,
    wirte statement converts any date fomat in system date fromat
        WRITE w_DateTO w_date_sys.
    Regards,
    Sriram

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • Function module to convert date format to yyyymmdd

    Hi All,
    Would like to seek for your advice. Is there any function module to convert the date format from mm/dd/yyyy to yyyy/mm/dd? Thanks in advance.
    Regards,
    Shawn
    Moderator Message: Basic date question. Thread locked.
    Edited by: Suhas Saha on Dec 30, 2011 12:44 PM

    Hi,
    Use the FM  CONVERT_DATE_TO_EXTERNAL.
    Edited by: emax nagu on Dec 30, 2011 7:53 AM

  • Function module for convert date as sap internal format ?

    Hi All,
    Is there any standard function module to convert the date filed as SAP internal date?
    My problem is while uploading data from excel sheet date filed can be any format
    for exp: dd/mm/yyyy or mm/dd/yyyy or yyyy/dd/mm or dd-mm-yyyy,mm-dd-yyyy
                 dd-mm-yyyy or dd.mm.yyyy or mm.dd.yyyy  etc...
    In our case there is no particular format in excel it can be differ for each user. I know we have few FM's in standard.
    But those are not working for my req. pls help me if you have any idea.
    Thanks in advance.
    Regards,
    Venkat Mote.

    Hi Venkatesh,
    Can you please check with the following function module. For my case, it is working fine.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
      EXPORTING
        datum = p_gs_date
        dtype = 'DATS'
      IMPORTING
        idate = p_gs_date
    Hope it helps to you.
    Regards
    Rajkumar Narasimman

  • Function module to convert date and time

    Hi ,
    Requirment is i want to create a file in the application server.So the file name should be in the following format.
    0XX-XXXX-YYYYMMDDHH.format.
    in this HH-hours.I need to take current date and time.so is there any function module to convert into this format.If it is not there how to create file name in this format.
    Thanks,
    MR

    REPORT  ZTEST_CONV.
    data:  time_stamp TYPE timestampl.
    GET TIME STAMP FIELD time_stamp.
    You can try with GET TIME STAMP
    But it will be in Different format.

  • Function module to convert date form yyyy/mm/dd to mm/dd/yyyy format

    can any one tell meFunction module to convert date form yyyy/mm/dd to mm/dd/yyyy format

    hi
    good
    try this
    report zrich_0001.
    tables s002.
    data ilikp type table of likp.
    ranges: r_datum for sy-datum.
    select-options: s_spbup for s002-spbup.
    start-of-selection.
    r_datum-sign = 'I'.
    r_datum-option = 'BT'.
    r_datum-low = s_spbup-low.
    r_datum-low+6(2) = '01'.
    if s_spbup-high is not initial.
    r_datum-high = s_spbup-high.
    r_datum-high+6(2) = '01'.
    else.
    r_datum-high = r_datum-low.
    endif.
    r_datum-high4(2) = r_datum-high4(2) + 1.
    r_datum-high = r_datum-high - 1.
    append r_datum.
    select * into table ilikp from likp
    where erdat in r_datum.
    thanks
    mrutyun^

  • Function Module to Convert date formate

    Hi All,
    I need to convert the date formate from ex :01-Jan-2009 into 01-01-2009.
    Is there any Function Module for this?
    Thanks
    Partha.
    Moderator message - Babu Kilari is correct - post locked
    Edited by: Rob Burbank on Apr 27, 2009 9:36 AM

    Hello Partha,
    I wanted to ask you a question. Why did you not search SDN Forums before posting.
    I think the time take for posting is higher than the time taken for searching.
    Am I right??
    Please let me know. I think the question you have posted is very basic
    Thanks,
    Babu Kilari

  • Function Module to get date wise weekly offday of employee

    Hi all,
    Is there any standard function module which imports PERNR and DATE and returns the weekly off dates on the basis of
    the work schedule (IT0007)?
    If there is no such Fn Mo, please let me know what tables to look for to do this.
    <<Text removed by moderator>>
    For your information I have already found function module HRPERSONAL_WORK_SCHEDULE.But it is not returning for entire period (say 01.10.2010-31.10.2010)._
    I have also found table relationship but it is not serving my purpose. Table T552A for monthly work schedule.
    Thanks
    Sourav

    Hi Anand,
    Thanks for your reply.
    This fn mo is returning the first three days(01.10.2010,02.10.2010,03.10.2010).
    Rest days of the month (Oct 2010) are not coming.
    According to display work schedule(transaction PT03) this func module is returning the first row bcoz first row contains
    01.10.2010,02.10.2010,03.10.2010.
    Here is my code snippet.
    DATA: it_ptpsp TYPE STANDARD TABLE OF ptpsp INITIAL SIZE 0,
          wa_ptpsp TYPE ptpsp.
    DATA : gd_warning LIKE sy-subrc.
    CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
    EXPORTING
      pernr             = '00100007'
      begda             = '20101001'
      endda             = '20101031'
    *          KUG               =
    *          REFRESH           = 'X'
    *          WORKING_HOURS     = 'X'
    *          SWITCH_ACTIV      =
    *          MODIFY_ENTRIES    = 'X'
    *          I0001_I0007_ERROR = '0'
    *          READ_CLUSTER      =
    IMPORTING
      warning_occured   =   gd_warning
    TABLES
    *          I0000             =
    *          I0001             =
    *          I0002             =
    *          I0007             =
    *          I0049             =
    *          I2001             =
    *          I2002             =
    *          I2003             =
      perws             = it_ptpsp   "Stores employees work schedule
    *          I0003             =
    EXCEPTIONS
      error_occured     = 1
      abort_occured     = 2
      OTHERS            = 3.

  • Function module to convert date format

    hi all,
            i need a function module which will take the input as 09.02.2006(mmddyyy) and the out put should be sep-06. etc.
    Thanks & Regards
    suresh

    Hi Suresh,
    Use the function module 'MONTH_NAMES_GET' to get the month name and then use CONCATENATE to get SEP-06.
    You can also check another post which is currently running 'Regarding Date Format'.
    Thanks
    Vinod

  • Is there any function module to convert date formats

    i want to conver from any format of date to mmddyyyy
    how to do this

    hi,
    use fm CONVERT_DATE_TO_INTERNAL
    or try:
    concatenate p_date4(2) p_date6(2) p_date(4) into o_date.
    Andreas
    Message was edited by: Andreas Mann

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

  • Is there any function module to convert the date format

    Dear ABAPers,
    Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
           I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
    Thanks & Regards,
    Ashok.

    hi,
    create custom function module or copy the below code in the report ..and use it
    the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
    FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(DATE) LIKE  SY-DATUM
    *"       EXPORTING
    *"             VALUE(FORMATTED_DATE)
    *"       EXCEPTIONS
    *"              INVALID_DATE
    TABLES: TTDTG.
    DATA: BEGIN OF T_DATE,
            YYYY(4) TYPE C,
            MM(2) TYPE C,
            DD(2) TYPE C,
          END OF T_DATE.
    DATA: DAY(3) TYPE N.
    DATA: VARNAME LIKE TTDTG-VARNAME.
    IF DATE IS INITIAL.
      CLEAR FORMATTED_DATE.
      EXIT.
    ENDIF.
    check document date format
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        DATE = DATE
      EXCEPTIONS
        PLAUSIBILITY_CHECK_FAILED = 1.
    IF SY-SUBRC NE 0.
      RAISE INVALID_DATE.
    ENDIF.
    MOVE DATE TO T_DATE.
    CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
    SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
    WRITE T_DATE-DD TO DAY.
    CONCATENATE DAY ',' INTO DAY.
    CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
      SEPARATED BY SPACE.
    ENDFUNCTION.
    the output is :--Convert a DATE field into a full format date eg. March 23, 2000
    Regards,
    Prabhudas

Maybe you are looking for

  • How to get the document which is associated with a process having specific Guid value?

    when a PDF file is opened, AcroRd32.exe is started automatically, and we get the GUID value of that adobe reader. In c#, can't we get the document associated with the GUID value,  I mean the total PDF file which is opened in adobe reader at runtime.

  • How can you open photos in adobe reader x

    How can you open photos in adobe reader x

  • Add new fields in open items

    Hey, In Accounts Receivable, we have the need for the following fields on the open items in SAP: Store External System Division Bill of Lading How to work on this? Regards

  • Help writing first Java Script

    HELP!! I am writing my first Java Script for a class but cannot figure out what I am doing wrong. I have created a from and need to write a script to verify that all form entries are filled before allowing the data to submit. Can some one please look

  • Photoshop CS6 start screen displays circles

    My Photoshop CS6 start screen displays circles around its rectangular shape. Can anyone tell me why? I am using version 13.0.4 x64 on Macintosh OSX 10.9.2 Here is what the screen looks like: