CONVERTING DATE FORMAT

HI FRNDS,
       i have a problem with converting my DATE format from my flat file to the BW system the date in the flat files may be in these formats
                        '12-jan-1992'
                          '12/01/1992'
                           '12-jan-92'
                           '12/01/92'
these are some examples
but whatever format i get i should load that DATES in my BW system as such
but this is not possible without some Routines i suppose.
Suggest me the proper steps to do that conversion pls.
Iam not an ABABER so i dont know how to write the ABAB routines pls tell me detailly so that i can understand.
thnks.

HI,
Use this FM CONVERSION_EXIT_SDATE_INPUT.It will accept the date in the format 13JUL2005 and will give the date in the format 20051307.Use this FM and format the output as per your requirement.
code..
DATA : temp TYPE sy-datum,
       odate(8).
PARAMETERS : idate(11) TYPE c DEFAULT '31-JUL-06'.
START-OF-SELECTION.
  TRANSLATE :  idate TO UPPER CASE,
               idate USING '- '.
  CONDENSE idate NO-GAPS.
  CONCATENATE idate0(5) sy-datum0(4) INTO idate.
  BREAK-POINT.
  CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
    EXPORTING
      input  = idate
    IMPORTING
      output = temp.
  CONCATENATE temp0(4) temp6(2) temp+4(2) INTO odate.
  WRITE : /10  idate,
          /10  odate .
Hope  this help..assign pionts..
regards,
raj

Similar Messages

  • How to convert date format(mm/dd/yy) into dd-mm-yy

    I want to convert date format(mm/dd/yy) into dd-mm-yy
    like 12/23/06 into 23-sep-06

    hey, you can use SimpleDateFormat to format your date. this is sample code, maybe could help you.
    class dateFormat
         public static void main(String[] args)
              Date now = new Date();
              System.out.println("Before format : "+now);
              SimpleDateFormat sdf = new SimpleDateFormat( "dd-MM-yy" );//Change your date format in here.
              String display = sdf.format(now);
              System.out.println("After format : "+display);
    }If you already understand about my sample code, i think it's easy to make your own date format. Just modified few line of my code.

  • 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 to ISO8601 in Oracle BPEL

    Hi,
    I need to convert date format from YYYY/MM/DD 00:00:00 to YYYY-MM-DDThh:mm:ss format in oracle BPEL. Can any of you help me out. Thanks in advance.

    Hi Anuj,
    I have use the below mentioned code to convert the date format.
    <db:P_X_DATE_FROM>
    <xsl:value-of select='concat(substring(../VALUE,1.0,4.0),"-",substring(../VALUE,6.0,2.0),"-",substring(../VALUE,9.0,2.0),"T",substring(../VALUE,12.0,8.0))'/>
    </db:P_X_DATE_FROM>
    Thanks & Regards,
    Jyotirmoy.

  • 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

  • Need help in converting date format

    Hi,
    Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
    Thanks,
    Raj.

    I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
    Edited by: user11165753 on 7-dec-2009 23:50

  • 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

  • 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

  • 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 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.

  • Convert date format yyyy-mm-dd to yyyymmdd

    Hi All,
    Could you please tell me how to do the mapping format to  Convert date format yyyy-mm-dd to yyyymmdd
    or
    Please provide any UDF for this conversion.
    Thank you .
    Regards,
    Bharat Kumar

    HI ,
    You can easily do that by using the standard datetransformation fuction . in the  property of that function put your coming source and desired target format . However once you specify the source format then the source field should always be in thaat format
    Regards,
    Saurabh

  • Convert date format YYYYMMDD to DD.MM.YYYY

    hi
    i was wondering is there a FM which convert date format YYYYMMDD to DD.MM.YYYY
    instead of u know cutting the YYYY and MM and DD and concatement them again

    Hi ,
    See this piece of code
    Data : w_date type dats value '20080903',
              w_date1(10),
    Constants : C(1) value '.'.
    w_date1 = w_date.
    concatenate w_date+6(2) w_date+4(2) w_date+0(4) into w_date1 separated by C.
    Write : / w_date1.
    With Regards.
    Alwasy Learner

  • Question about get web service result in actionscript and convert data format

    Hi, All
    I have question about how to get dataset from web services
    and put it in tree structure. I have 2 questions about this:
    1, How can I get data correctly in actionscript?
    I have no problem to get data by
    <mx:ArrayCollection id="acFolder"
    source="{mx.utils.ArrayUtil.toArray(MyGServices.getFolder.lastResult)}"
    />
    And display in datagrid.
    But when I try to use
    public function
    handleFolderContents(event:mx.rpc.events.ResultEvent):void{
    arData=mx.utils.ArrayUtil.toArray(event.result);
    acData=new ArrayCollection(arData);
    input.text=acData.getItemAt(0).id;
    Seems I can’t get data, it always say:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    2, how to convert data format
    I get data from web service and want to convert it to tree
    structure, as mention below:
    I get:
    <Array>
    <id>111</id>
    <Name>Production1</Name>
    </Array>
    <Array>
    <id>222</id>
    <Name>Production2</Name>
    </Array>
    Convert to:
    <mx:XMLList id="treeData">
    <node>
    <node label="Production1" data="111">
    <node label="Production2" data="222"/>
    </node>
    </node>
    </mx:XMLList>
    Please help me.
    Thanks.

    First, don't specify the package path in the argument
    declaration. Instead import the event object:
    import mx.rpc.events.ResultEvent;
    The docs state this emphatically.
    Second, try "lastResult", in place of "result":
    arData=mx.utils.ArrayUtil.toArray(event.lastResult); // I am
    not positive about this. I maybe recall reading that result was ok
    for the event object, but maybe not.
    Finally, why do you want to convert the xml? You certainly
    could, but it would be a manual process, recursively reading the
    existing xml nodes and building the new structure, but again, why?
    Just use a labelFunction if necessary to display the nodes as
    you wish.
    Tracy

  • Converting date format from in mapping

    hi xi friends.
    in my scenario i just want to convert date format from 12022007 which is file to 12.02.2007 which is in target bapi.
    waiting for u.
    bye.
    regards.
    seeta ram.

    Hi,
    if I understood you correctly you want to transform from ddMMyyyy (your format in the external file) to yyyyMMdd (format of ABAP datatype DATS):
    Then all you need to do is to use the standard function TransformDate (as already described above).
    Enter in the field "Format of source Date": ddMMyyyy
    Enter in the field "Target Format": yyyyMMdd
    That's it.
    Regards,
    Helmut

  • Converting date format from 14/07/08 to 14-jul-08

    hi all ,
    i want to convert date format from 14/07/08 to 14-jul-08 . is there any function module for this ?.
    kindly reply.
    regards,
    siya

    Hi Siva,
    Check the code below.
    For getting date format in  the form like 10.Dec.2008*
          WHEN '01'.
            CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
              EXPORTING
                input  = date2
              IMPORTING
                output = date_format.
            IF sy-subrc EQ 0.
              date_format1 = date_format.
            ENDIF.
    For getting date in the format like 10.December.2008*
          WHEN '02'.
            CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
              EXPORTING
                input  = date2
              IMPORTING
                output = date_format.
            IF sy-subrc EQ 0.
    Get Month Long text
              SELECT SINGLE ltx
                     FROM t247                 INTO ws_month
                     WHERE ktx EQ date_format+3(3)
                     AND spras EQ 'E'.
              IF sy-subrc EQ 0.
                CONCATENATE date_format0(2) ws_month date_format7(4) INTO date_format1 SEPARATED BY space.
              ENDIF.
            ENDIF.
    Hope this helps,
    Manish

  • How to convert Date format from yyyy mm dd   to   dd mmm yyyy in ADF

    Hi,
    I have Date Format in Data Base as yyyy mm dd, but in the UI I want to display the format as dd mmm yyyy, which code I have to write to get the required format in JDev 11.1.2.3

    Hi,
    Use converter : &amp;lt;af:convertDateTime&amp;gt;
    See also : convertDateTime Demo
    -Arun

Maybe you are looking for