How to convert date format into sap standard format?

Hi All,
In SAPUI5 screen i have one simple form in form i have date field which is format  (MM/DD/YYYY). but i am getting POST error while inserting the data in to sap table.
I want convert date format in sap format (YYYY/MM/DD).
One more issue, when i am fetching the data from sap table,but  the date display with time and time zone.
eg. Sat Aug 02 2014 05:30:00 GMT+0530 (India Standard Time)
I want to display only date.
Thanks,
Prashant.

Now i am using <DatePicker id="Emp_fsdate" displayFormat="yyyy-MM-dd"/>
I checked in console, but date is display like mm/dd/yy
In my controller.js file i have written code
OData.request
           requestUri: "http:sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata", 
           method: "GET",
           headers:
           "X-Requested-With": "XMLHttpRequest",
           "Content-Type": "application/atom+xml",
           "DataServiceVersion": "2.0",       
           "X-CSRF-Token":"Fetch"
       function (data, response){
        var header_xcsrf_token = response.headers['x-csrf-token'];
                   OData.request
                        requestUri:
                         "http://sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata", 
                        method: "POST",
                        headers:
                      "X-Requested-With": "XMLHttpRequest",                     
                        "Content-Type": "application/atom+xml",
                        "DataServiceVersion": "2.0",
                        "Accept": "application/atom+xml,application/atomsvc+xml,application/xml",
                        "X-CSRF-Token": header_xcsrf_token
                        data:
                               Empid:Emp_id,
                               Empname:Emp_name,
                               Start_Date:Emp_sdate,
//                              End_Date:Emp_edate,
                               Status:Emp_status,
                               City:Emp_city,
                               Location:Emp_location,
and in my CREATE_ENTITY method
method ES_SODATA_CREATE_ENTITY.
     DATA: ls_request_input_data TYPE zcl_zservice_final_mpc=>ts_et_sodata,
         ls_userinfo TYPE zsodata.
   DATA ls_temp TYPE sy-datum.
* Read Request Data
   io_data_provider->read_entry_data( IMPORTING es_data = ls_request_input_data ).
* Fill workarea to be inserted
   ls_userinfo-Empid   = ls_request_input_data-Empid.
   ls_userinfo-Empname   = ls_request_input_data-Empname.
   ls_userinfo-Start_Date   = ls_request_input_data-Start_Date.
   ls_userinfo-End_Date   = ls_request_input_data-End_Date.
   ls_userinfo-Status   = ls_request_input_data-Status.
   ls_userinfo-City   = ls_request_input_data-City.
   ls_userinfo-Location   = ls_request_input_data-Location.
* Insert Data in table ZUSERINFO
   INSERT zsodata FROM ls_userinfo.
   IF sy-subrc = 0.
     er_entity = ls_request_input_data. "Fill Exporting parameter ER_ENTITY
   ENDIF.
   endmethod.
But still i am getting an error
POST http://sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata 500 (Internal Server Error)
I am able to insert all field except date field. How to insert date field in sap table.

Similar Messages

  • FM to convert Date Entered to a standard format

    Hello All,
    Is there any FM to convert the date entered (in the format given in SU01) to a standard format
    (Eg: DD.MM.YYYY).  Is there any FM that does the reverse of it.
    Please help us out with your suggesstions.
    Thanks,
    Seetharaman V

    Hi seetharaman,
    please refer the following link for using the conversion exit for date in BSP application.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/72d7ac11-0501-0010-63a2-cc6960569926
    hpe this ll help.
    thnks.

  • How  to convert  et_attach-phio_content into normal character format.

    Hi All ,
          We need to convert the  et_attach-phio_content 
                             which is type of
                                       SDOK_SDTX(data type = RAW ,length = 1022)                            
                     into          type
                                      solisti1 (data type = SO_TEXT255 )(char).
    please help .
    Regards
    Channappa

    Hi All ,
          We need to convert the  et_attach-phio_content 
                             which is type of
                                       SDOK_SDTX(data type = RAW ,length = 1022)                            
                     into          type
                                      solisti1 (data type = SO_TEXT255 )(char).
    please help .
    Regards
    Channappa

  • How to convert text file into xml file format with and check that with DTD

    I have an text file with | seperator . I have to convert this to an xml file and check with DTD present with me..
    plz help me out

    can i get some code that how to compare the xml with dtd or just give the DTD name with an XML

  • How to convert date format dd.mm.yy into yyyymmdd?

    Hello experts,
    how to convert date format dd.mm.yy into yyyymmdd?
    Thanx
    Axel

    Hi
    go through these previous threads on similar question
    https://forums.sdn.sap.com/click.jspa?searchID=673529&messageID=1763194
    Date Conversion in Flat File
    converting the DATE(yyyymmdd) into MONTH(yyyymm) format
    Date Format Conversion from MM.DD.YYYY to YYYYMMDD
    gives clear idea
    Reagrds
    Kiran
    Message was edited by:
            ravi kiran naalla

  • How to convert Date format into day in ssrs reports?

    Hi
    How to convert date format into day?
    10/01/2010 as like Monday like that?

    =weekdayname(datepart("w",Fields!mydate.Value))
    -Vaibhav Chaudhari

  • How can I convert a file in SAP RDI format?

    HI All,
    I have to convert the data which is to be passed to the Smartform into RDI format.
    I am using Application form (Print Workbench)
    for sending data to smartform.
    Is there any Function Module for converting data into SAP RDI format?
    Should I write this FM in User-exit of application form?
    Thanks & Regards,
    Anshumita.

    HI
    GOOD
    I NEVER FACED SUCH KIND OF ISSUES, BUT HERE I AM GIVING SOME DETAILS ABOUT SAP RDI FORMAT,I HOPE THIS WILL HELP YOU TO SOLVE YOUR PROBLEM.
    Description
    Using the SAPscript Raw Data Interface (RDI), you can connect external text management systems to control individual requests, for example, optimizing postage expense. The interface contains all form data from the R/3 System, but no layout information such as font or page size. The external system alone is responsible for the layout and administration of the document data. The RDI is of special importance for mail processing. The external system sorts the document data from the interface and forwards the documents accordingly.
    The Raw Data Interface is a certified interface and allows easy connection to external systems. However, you pay the price for this extra function, as you lose tight integration with the R/3 System. For example, you cannot find out from within an R/3 application whether the external system successfully printed and sent the documents. In addition, extra expense is incurred each time you adapt a standard form, since the system has to adapt both an internal and external form. The external tool is not an integral part of the ABAP Development Workbench, so that field information (field type, output length and so on) from the ABAP Dictionary is not available.
    THANKS
    MRUTYUN

  • How to convert date to ccyymm format

    Hi,
    How to convert date to ccyymm format.
    Thanks

    dadivela wrote:
    Re: How to convert date from ccyymm format to mmddyyI didn't inderstand. Date doesn't have any format. If you have a string in CCYYMM format, you would have to extract the YYMM from the string.
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM
      4    FROM   DUAL
      5  /
    SYSDATE   DATE_F YYMM
    08-JUN-09 210906 0906You can use this string to convert it to date. Note that since DD part of your date was not their in the resultan string, the converted date will fall back to first of the month specified.
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
      4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3), 'YYMM') conv_Dat
    e
      5    FROM   DUAL
      6  /
    SYSDATE   DATE_F YYMM             CONV_DATE
    08-JUN-09 210906 0906             01-JUN-09
    SQL>Then convert the date into the required format using TO_CHAR Function
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
      4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3),
      5                   'YYMM') conv_Date,
      6           TO_CHAR(TO_DATE(SUBSTR(TO_CHAR (SYSDATE, 'ccyymm'),3),
      7                   'YYMM'), 'MMDDYY') New_Format
      8    FROM   DUAL
      9  /
    SYSDATE   DATE_F YYMM             CONV_DATE NEW_FO
    08-JUN-09 210906 0906             01-JUN-09 060109
    SQL>Hope this helps.
    Regarads,
    Jo

  • Convert XML string into an abap format date and time

    Hi,
    Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
    Here is a part of the xml that I want to convert.
    <ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
    <ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
    Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
    to be able to accept the various date formats (esp. the local timestamp).
    I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
    Would appreciate anyone's help!
    Thanks.
    Edited by: eunice ocson on Jul 13, 2009 1:49 AM
    Edited by: eunice ocson on Jul 13, 2009 1:50 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM

    Hi Eunice
    Use the FM 'SMUM_XML_PARSE'
    for more info
    [Convert XML string to ABAP|XML String to ABAP or GUI]
    hope it helps you.
    Thanks!!

  • How can I convert DVD- video into Apple's format so that it can be played and streamed from my Mac?

    How can I convert DVD- video into Apple's format so that I can play the content on my Mac and also stream it to my Apple TV? A few years ago, I transferred all of my home videos onto DVD but now would really like to put these onto my Mac and stream them through Apple TV to watch on the "big screen". Any advice would be most welcome!! Thanks

    MPEG Streamclip.
    Apple do not have their "own" format. You need to convert your DVDs to H.264 though.

  • How to convert date format to MM/DD/YYYY

    Hi,
       How to convert date format to MM/DD/YYYY.
    Thanks,
    Senthil

    hi,
    tri with this function module
    data :l_date(10) type c
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
       DATE_INTERNAL                  = SY-DATUM
    IMPORTING
       DATE_EXTERNAL                  = l_date.
    this function module converts date from 20050601 to external format  which is specified in user profile
    cheers,
    sasi

  • How to convert date from ccyymm format to mmddyy

    hi,
    How to convert date from ccyymm format to mmddyy

    Please don't multipost. This question has been answered in your first post.
    How to convert date to ccyymm format
    Regards,
    Jo

  • Does anyone know how to convert the output from the standard report to xml?

    Does anyone know how to convert the output from the standard SAP report to xml?

    since it a standard report which you cannot modify you can only do the following.
    submit report exporting list to memory
    then
    list from memory and then
    use the returned itab along with CALL TRNSFORMATION key word to convert to xml.
    but this only going to place the whole list content (including data and formating lines,etc) into a xml element and not the actual data alone in the list .

  • How to convert date dd.mm.yyyy TO Month ddth YYYY?

    hi friends,
    how to convert date into this format.
    ex:
    date : 04.11.2008
    has to convert as
    October 04th, 2008
    th has to be set SUPERSCRIPT.
    Plz any helps....
    Regards,
    Shankar.

    check this..FM
    CONVERT_DATE_TO_EXTERNAL
    or we can do this using split or concatenate functions like below
    *CALCULATING THE MONTH FOR THE BODY OF THE EMAIL MSG
      IF GD_EBODY_BB = '01' .
        GD_EBODY_BB = 'January' .
      ELSEIF GD_EBODY_BB = '02' .
        GD_EBODY_BB = 'February' .
      ELSEIF GD_EBODY_BB = '03' .
        GD_EBODY_BB = 'March' .
      ELSEIF GD_EBODY_BB = '04' .
        GD_EBODY_BB = 'April' .
      ELSEIF GD_EBODY_BB = '05' .
        GD_EBODY_BB = 'May' .
      ELSEIF GD_EBODY_BB = '06' .
        GD_EBODY_BB = 'June' .
      ELSEIF GD_EBODY_BB = '07' .
        GD_EBODY_BB = 'July' .
      ELSEIF GD_EBODY_BB = '08' .
        GD_EBODY_BB = 'August' .
      ELSEIF GD_EBODY_BB = '09' .
        GD_EBODY_BB = 'September' .
      ELSEIF GD_EBODY_BB = '10' .
        GD_EBODY_BB = 'October' .
      ELSEIF GD_EBODY_BB = '11' .
        GD_EBODY_BB = 'November' .
      ELSEIF GD_EBODY_BB = '12' .
        GD_EBODY_BB = 'December' .
      ENDIF .
    *ATTACHMENT SUBJECT LINE MODIFICATION
      IF GD_EBODY_CC = '01'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '02' .
        CONCATENATE GD_EBODY_CC 'nd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '03' .
        CONCATENATE GD_EBODY_CC 'rd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '31'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '21'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSE .
        CONCATENATE GD_EBODY_CC 'th' INTO GD_EBODY_CC .
      ENDIF .
    regards
    ansumesh
    Edited by: Ansumesh Kumar Samal on Nov 4, 2008 9:02 AM

  • I need how to load data from MS Excel(csv format) to NW Excel

    Hi,
    I am doing Migration project from SAP MS to NW Manually.
    I need how to load data from MS excel (csv format) to NW excel .
    For example 2008 budget data.
    Could you please help me in this.
    Thanks and Regards
    Krishna

    Hi,
    You need to create a transformation file and a conversion file if required. First upload the excel (csv) file into BPC using Manage Data and Upload File option.
    Create the transformation file (refer to the sap help  on how to define a transformation file). You need to specify the mapping correctly and include all your application dimensions and map them to appropriate columns of the flat file.
    Before running the import package, do validate the data in the flat file you uploaded into BPC with the transformation file you created.
    Thanks,
    Sreeni

Maybe you are looking for