Function module to change the date format

hi guys
is there any function module to change the date format
from 08/28/2007(mm/dd/yyyy)
to August 28, 2007.
regards
vamsi

hi vamsi.,
Use  CONVERSION_EXIT_SDATE_OUTPUT to get the month name,
but it will give short form of the month name.
if you want <b>long description of the month</b>,
use this peice of code.
PARAMETERS: V_DATUM(07) TYPE C. "(example input:12-2007)
  DATA:     V_MON(2)  TYPE C,
            V_YEAR(4)      TYPE  C,
            V_MONTHNAME(10) TYPE C,
            V_FULLDATE(30) type c.
WRITE  V_DATUM+0(2) TO V_MON.
SELECT SINGLE LTX FROM T247 INTO V_MONTHNAME
WHERE        SPRAS = SY-LANGU
     AND       MNR  = V_MON.
CONCATENATE  V_MONTHNAME  v_datum+3(4)
                  INTO V_FULLDATE  SEPARATED BY SPACE.  "(example output : December 2007)
                  write: v_fulldate.
<i><b>Reawrd points if useful</b></i>
Chandra

Similar Messages

  • 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

  • Function Module to change the master data attachments?

    Dear Experts,
    In SAP we can enclose the attachments for the Master data. Do we have any standard function module to change the Master data attachments.
    Let me know if any?
    Thanks and regards,
    Reddy

    Hi Reddy,
    Please make use of function module :
    BINARY_RELATION_CREATE_COMMIT
    For detailed information on how to use the FM please see the thread below:
    USE OF THIS fUNCTION MODULE
    Regards,
    Dilek A.

  • Function module  which changes the Storage Unit (SU) Block Data like LS32

    Hi,
    Is there any Function module  which changes the Storage Unit (SU) Block Data as done in  LS32.
    Thank you,
    Prashanth A.

    Hello Pablo.
    Yes we did run LT04 and it does encounter that same error message after clicking the Stock Removal button.  But eventually error msg will be removed by entering the value at the Storage Unit Type field because it directly fills in LTAP-LETYP.
    We have resolved that the function module will not really fill the desired Storage unit type therefore TO background creation is not feasible in our scenario (non-SU managed transfer to SU-managed storage type).  And I found this thread too:  http://scn.sap.com/thread/1947358
    So issue is still open but we have considered of changing the process since this is still just a new scenario for us.
    Thanks a lot for your inputs!

  • How to change the date format  YYYYMMDD to MM/DD/YYYY

    Hi ,
    How to change the date format  YYYYMMDD to MM/DD/YYYY .
    Ex :  20071008  to 10/08/2007
    Is there any function module for this ??
    Regards
    Rahul

    Hi Sharma,
    check the code:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
    date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
    date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
    date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
    date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
    SELECT mnr
    ktx
    ltx
    INTO TABLE T_month
    FROM t247
    WHERE spras = 'EN'.
    IF sy-subrc NE '0'.
    MESSAGE I "Message - Not able to get month values from the table T247
    ENDIF.
    ENDFORM.
    DATA : temp_date(16) TYPE c,
    temp1_date(60) TYPE c,
    year(4) TYPE c,
    daymonth(11) TYPE c,
    daymonth1(11) TYPE c,
    month(9) TYPE c,
    day(2) TYPE c,
    mon LIKE t247-ktx,
    len TYPE i .
    MOVE date TO temp1_date .
    CONDENSE temp1_date NO-GAPS.
    MOVE temp1_date TO temp_date .
    IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    _len = STRLEN( _daymonth1 ).
    l_len = 13 - len.
    SHIFT daymonth1 RIGHT BY len PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    SORT t_month BY monthltx.
    READ TABLE t_month WITH KEY monthltx = month.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    len = STRLEN( month ).
    CONDENSE daymonth NO-GAPS.
    SHIFT daymonth LEFT BY len PLACES.
    day = daymonth.
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT i_date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    SHIFT daymonth1 LEFT BY 2 PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    TRANSLATE month TO UPPER CASE.
    SORT t_month BY monthstx.
    MOVE month to mon.
    READ TABLE t_month WITH KEY monthstx = mon.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    CONDENSE daymonth NO-GAPS.
    day = daymonth+0(2).
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
    CONDENSE temp_date NO-GAPS.
    IF STRLEN( temp_date ) EQ 10.
    o_date0(4) = temp_date6(4).
    o_date4(2) = temp_date3(2).
    o_date6(2) = temp_date0(2).
    ELSE.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM. " f0100_conv_date
    Reward if helpful.
    Regards,
    Harini.S

  • Function Module for Changing delivery date

    Hi Friends ,
        I am held up with a scenario of changing the delivery date while creating purchase order. Could you please suggest any function module to change the delivery date in purchase order if it is less than 5 days.
    With Regards ,
    Sudhir S
    Moderator message: please do some own research before asking.
    Edited by: Thomas Zloch on Feb 21, 2011 11:45 AM

    Hi praveen for u r requirement there is no need of any FM
    Try this code
    parameters:
      p_date like sy-datum,
      p_no type i.
    data:
      w_date like sy-datum.
    w_date = p_date - p_no.
    write: / w_date .
    it is enogh for u r requirement
    plzz reward if it is usefull...
    for any further quiries my mail id is [email protected]
    plzz dont forget to reward

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • Function Module to change the user status of a business transaction

    Hi,
      I want to change the user status of a business transaction. Plz let me know if there is a function module to change the user status.I found some FMs.
    - CRM_STATUS_MAINTAIN_OW
    - BBP_PROCDOC_STATUS_CHANGE_DIRE
    - CRM_ORDER_CHANGE_STATUS
      But these FM says that it has to be used for changing system status.
    Thanx,
    Sivagami.R

    hi Siva,
    here is some sample code :
    data :
      ip_guid            type  crmt_object_guid,
      ls_status            type  crmt_status_com,
      lt_status            type  crmt_status_comt,
      ls_input_field       type  crmt_input_field,
      ls_input_field_names type  crmt_input_field_names,
      lt_input_fields      type  crmt_input_field_tab,
      lt_obj_guids         type  crmt_object_guid_tab,
    ip_guid = <your guid>.
    ls_status-ref_guid = IP_GUID.
    ls_status-ref_kind = 'A'.
    ls_status-status = lv_newstat.
    ls_status-user_stat_proc = 'ZCRMCOM1'.
    ls_status-activate   = 'X'.
    INSERT ls_status INTO TABLE  lt_status.
    ls_input_field-ref_guid = IP_GUID.
    ls_input_field-ref_kind = 'A'.
    ls_input_field-objectname = 'STATUS'.
    ls_input_field_names-fieldname = 'ACTIVATE'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'STATUS'.
    INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field INTO TABLE lt_input_fields.
    insert IP_GUID into table lt_obj_guids.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
        it_status       = lt_status
    CHANGING
        ct_input_fields = lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_SAVE'
    EXPORTING
        it_objects_to_save = lt_obj_guids
    EXCEPTIONS
        OTHERS              = 2.
    COMMIT WORK.
    please award points if helps
    cheers

  • BAPI Function module to change the schedule agreement

    Hello Experts,
                             Can anyone tell me Bapi function module to change the scheduling agreement,
    my requirement is i will get the new AEDAT(Delivery date in schedule line)
    and WMENG(Quantity)  Every time customer sends me a flat file which has got
    revised schedule delivery date and Quantity. It needs to be updated in my system
    using a BAPI Functional Module.

    Hi Vivek,
    You must use the correct or most appropriate forum, so this thread will be moved from to .
    The forum is dedicated to: Data Transfer Techniques, Batch Data Communication, Legacy System Migration Workbench, Application Link Enabling, IDOCs, BAPIs.
    Please see the [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
    Also read this thread Welcome and Rules of Engagement.
    Greetings,
    Marcelo Ramos

  • Changing the Date format in iCal

    Is there any way to change the date format from American (MM/DD/YY) to European (DD/MM/YY) in iCal?
    Thanks in advance.

    As far as I'm aware, it should respect what you specify in the Formats tab of the International pane in System Preferences.

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • How do I change the date format?

    Sorry, but I'm new to Oracle!
    I'm using "sqlplusw" to build my SQL statements. When I return columns that are date fields, I get the DD-MON-YY format. I want dates to be returned in "YYYY-MM-DD HH24:MI:SS". My DBA won't change the date format on the server, so how do I change SQLPLUS to return dates in the format I want? Do I need set this in some kind of startup file, or a reg key?
    Using client version 9.2.0.5 against a 9.2.0.1 server
    Jeff

    There are a couple of ways you could do it.
    Way 1:
    Search for a file by name 'glogin.sql' on your client work station and add the following statement
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure you save the file. This change will apply to all users who will log into the database using SQL*PLUS from your machine.
    Way 2:
    Create a shortcut and place it some where (for example on the 'DESKTOP').
    Right click on the short cut and choose properties.
    Change the text corresponding to the 'Start in' box to reflect the current location of the shortcut.
    Create a file by name 'login.sql' and place it in the same folder as the shortcut.
    Edit the file and add the following line.
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure that you save the file.
    When you double click the shortcut to start SQL*Plus and login, the script 'login.sql' is executed.

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

  • Need to change the date format in Bex

    HI All
    In SAP BI I have created a BEx Query. We can see BEx reports in MS Excel. Date format in the report is DD/MM/YYYY and i want it to be displayed like YYYYMMDD. but only for one date column in the report the rest stay the same. Please help.

    Hi Basson,
    Goto t-code SU01
    Enter you user ID details click on change --> select the Default TAB here you can find the option to change the date formats.
    Or
    In BW  goto Menu option System > User Profile>Own Data  > It will display the user profile parameters> in default tab page change date format there.
    Its better to go for a routine .
    Regards
    Prashanth K

  • Function module to determine the date for the nth weekday of the mth month

    Hey folks,
    Is there a function module which determines the date for the mth weekday of the nth month in the pth year.
    For instance, if I input 2nd thursday of the 4th month in 2008, it should return me, 04/10/2008  (MM/DD/YYYY).
    Thanks and Best Regards,
    Puja.

    Hi Ravi,
    Hadn't been able to work on this lately...You solution was quite close, but did not work for a few scenarios....I tweaked the logic a bit to take care of them as well...
    So here goes the code:
    ================================================
      DATA first_day_of_month TYPE datum.
      DATA day TYPE p.
      CONCATENATE year month '01' INTO first_day_of_month.
      CALL FUNCTION 'DAY_IN_WEEK'
        EXPORTING
          datum = first_day_of_month
        IMPORTING
          wotnr = day.
      DATA day_number TYPE numc2.
      IF day = weekday.
        IF recur = 1.
          DATA ls_date(10) TYPE c.
          CONCATENATE month '/01/' year INTO ls_date.
          CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
            EXPORTING
              date_external                  = ls_date
           IMPORTING
             date_internal                  = date.
        ELSE.
          day_number =  ( ( recur - 1 ) * 7 )  + 1.
        ENDIF.
      ELSEIF day < weekday.
        day_number = ( ( recur - 1 ) * 7 ) + ( weekday - day ) + 1.
      ELSE.
        day_number = ( ( recur - 1 ) * 7 ) + ( 7 - day ) + weekday + 1.
      ENDIF.
      IF date IS INITIAL.
        CONCATENATE year month day_number INTO date.
      ENDIF.
    ====================================
    There still could be some loopholes in this....am not sure....but it sure did seem to work for a couple of random checks that I performed.
    Brownie points to you for giving me a direction.
    Thanks,
    Puja.

Maybe you are looking for

  • 10.3.9 udate to 10.4.3 crash...HELP

    Yesterday I updated a colleagues 1.25ghz powerbook. It had 512 or ram and I replaced a 256 chip with a 512 that was purchased from the apple store. The computer booted and was fine. After that I put in the tiger (10.4.3) install disk, also purchased

  • IMovie quit's unexpectedly since upgrade to 10.10

    Since upgrading to OSX 10.10 from Mavericks, on a late 2012 Mac Mini (2.3 GHz i7, 4GB Ram) iMovie will now quit unexpectedly on every load after a few seconds. It appears to be attempting to convert my iMovie Library but this process never completes

  • Click to send numbers by email

    Hi All little question. In a pdf, i created a form for people to fill in, i can then create a link, that if they click it will add the pdf to an email with my email address and send it to me. Alas if everyone doesn't have adobe pro, they can't edit t

  • Problem using BAPI_CTRACCONTRACTACCOUNT_CR1

    Hi! We need to create Contract Accounts using BAPI_CTRACCONTRACTACCOUNT_CR1. We set all the required parameters but always recieve two erros on the RETURN table: - Enter a value in field Account Determ. ID - Enter a value in field Payment Terms We se

  • HT5654 Where is the help bar?

    I have a new iPhone 5s coming tomorrow, i am trying to update my itunes so that i can use it to activate my phone. How can i do this?