Date format conversion in BEX query level

Hi ,
      We had a date field in the numeric format like 735.020 in the cube level, but when we execute the query the values for thsi date field is changed in to date format like 31.05.2013.
we are not having any conversion routines and the date fields are used directly in the query .

Hi,
Try the below class file or may be create a method in your controller. It will resolve your problem.
package com.XXX.DateFormatForSAP;
import java.util.Date;
import java.text.SimpleDateFormat;
public class FormatSAPDate {
public static String changeDateFormat(Date sapDate) {
String formattedDate = null;
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
formattedDate = dateFormat.format(sapDate);
return formattedDate;
Try this code and let me know.
Regards
Mukesh

Similar Messages

  • Need the solution in the Bex Query level for a Business Requirement.

    Hi BI Experts,
    I have a requirement at Bex Query level and the scenario is like this:
    Business Logic.
    Right now am showing the Stocks falling in to time slot like 6-9 months and 10-12 months from the date of PKD in two columns B1 and B2 respectively.
    And also calculating the stock selling price of B1 with 30 % discount and B2 with 50% discount.
    In the above said discounts client may change the discount % in any future Quarters
    Now the requirement is, if client needs to see the history of sales according to the declared Discount selling prices of stocks falling into B1 and B2 slots, he must get the values accordingly.
    ( Am using the Formulas for calculating the Discount % for the Stocks fall in to B1 and B2 slots)
    Business Example:
    For Q4 2007 The discount for B1 Stocks is 35% and B2 Stocks is 60%.
    For Q2 2008 The discount for B1 Stocks is 35% and B2 Stocks is 55%.
    For Q3 2008 The discount for B1 Stocks is 30% and B2 Stocks is 50%.
    For Q4 2008 The discount for B1 Stocks is 40% and B2 Stocks is 50%.
    Now running report ( running in Q4 2008  at some date) if client needs to check the B1 and B2 stocks in Q4 2007 or Q3 2008 the values need to come with the calculation of repective % of disounts declared in that quarters along with the selling prices in that quarter.
    This all should be done at query level nothing to do at Infoproviders level.
    Is there any option like storing query data as a master data  and retrive it according to the selection to get the exact values of the respective % Discounts and time lines.
    If It is not clear come up with questions for still more clarifications.
    Points are assured.
    Thanks in Advance,
    RK.

    Who is defining the % discounts for periods/quaters?
    Is this maintained in a custom table or externally in legacy/R3 system?
    There are various ways to achieve the result. Variable exits can be used or virtual KF/char can be used but all depends on actual requirements.
    Cheers

  • RE: Oracle DATE data format conversion..

    <C.M> Motta's question about dates and oracle>
    Dealing with dates and Oracle is somewhat of a nuisance. Oracle is very
    particular about how date strings are formatted, and if you get it wrong,
    you get the (unhelpful) message that C.M. Motta showed us. However, if
    you pass a DateTimeData to Oracle, Forte' does the right formatting for you.
    If you do need to format the date prior to interacting with Oracle, use the
    following format:
    dd-mmm-yy <time component>
    You can change the default format, but it is not easy.
    If you customise Express generated code that interacts with an Oracle
    database, again, make sure that you pass a DateTimeData, and not the
    .TextValue.
    Good luck!
    Richard Kirk

    Date: Wed, 06 Nov 1996 08:18:37 -0500
    To: "C. M. Motta" <[email protected]>
    From: Jim Milbery <[email protected]>
    Subject: Re: Oracle DATE data format conversion..
    Cc: [email protected]
    Cheers:
    Most likely what is happening is that you are using the default date
    format of Oracle, and you are sending a four-character year. As follows:
    SQL> insert into jimbo values ('01-dec-1997')
    2 /
    insert into jimbo values ('01-dec-1997')
    ERROR at line 1:
    ORA-01830: date format picture ends before converting entire inputstring
    >
    Oracle defaults to a format of 'dd-MON-yy'
    You can either truncate the year, or manipulate the date to match the standard
    database as follows:
    insert into jimbo values (to_Date('01-jan-1997', 'DD-MON-YYYY'))
    \jimbo
    At 09:21 AM 11/6/96 -0200, you wrote:
    Forte Users,
    First, Id like to thank all those who answered my question on
    droplist & SQL. I got just what I was looking for: its up and runnunig
    now.
    I have another question: Im trying to insert a DATE into an Oracle
    database. The source date is:
    data : DateTimeData = new;
    data.SetCurrent();
    So, when I try to insert data.Value or data.textvalue into DB, I
    get the following exception:
    ORA-01830: date format picture ends before converting entire
    input string.
    Are there any suggestions?
    Thanks for your help,
    C.M. Motta
    ====================================================================
    Jim Milbery
    Milbery Consulting Group
    132 N. West St., Allentown, PA 18102
    O: 610 - 432 - 5350 F: 610 - 432 - 5380
    E-Mail : [email protected]
    ====================================================================

  • Regarding Date Format Conversion

    Hi,
    In my project i am picking the date from the date picker which is a javascript program . Then i am displaying it on a jsp page .It is coming in mm/dd/yyyy format .I have to change it to dd/mm/yyyy format .
    I have the code for date formatting conversion .
    What my doubt is whether  the code should be written inside the jsp page or in the javascript .
    Thanks .

    Hi
    <%@page language="java" import="java.sql.*,java.util.*,java.text.*" %>
    <%SimpleDateFormat sdf= new SimpleDateFormat(dd/mm/yyyy );%>
    <% java.util.Date temp_date = sdf.parse(PassYourDateHere); %>
    use this with your jsp
    Regards
    Abhijith YS

  • Date format conversation in OBIEE

    Hello guys
    I am a quick question about how to stop OBIEE from using to_date conversation? The date format in the db is dd/month/yy, and when I run any report in OBIEE answer using Date columns, it will always convert the format to "dd/mm/YYYY". The sql generated will always have a to_date() in where clause..
    Is there a way to not have OBIEE does that and just show the date with format as it is and drop the to_date conversion in SQL?
    Thanks

    I think you are getting confused here. Oracle's default date format is dd-mon-yyyy. So when you run a query like this:
    DATE_COLUMN = '01-Nov-2009'
    Oracle applies an IMPLICIT data type conversion to your date string and converts it to a date data type. Whether you allow Oracle to do the implicit conversion or do it explicitly like this DATE_COLUMN = To_date('01-Nov-2009', 'dd-mon-yyyy') should always result in the same query performance. When to TO_DATE functions affect query performance? When you apply the function over the DATE_COLUMN like this:
    TO_DATE(DATE_COLUMN, 'dd-mon-yyyy') = '01-Nov-2009'
    Why? Because indexes on DATE_COLUMN WILL NOT be used unless you have defined a function level index with a index column using the function: TO_DATE(DATE_COLUMN, 'dd-mon-yyyy'). My guess is that your DATE_COLUMN is not a date but a varchar2, therefore when you pass in To_date('01-Nov-2009', 'dd-mon-yyyy') Oracle does an IMPLICIT conversion of your DATE_COLUMN to DATE data type to match the data type of your where condition hence it is taking long to execute as no indexes are used. Can you confirm what is the exact data type of the DATE_COLUMN you are using to filter on? Do you have an index defined in that column? Can you confirm exactly how is the index is defined? Have you ran statistics on the table AND the indexes as well?

  • No data in WEBI report - but plenty of data in the underlying Bex query...

    HI all - I have a problem with my webi queries - which are sometimes breaking...
    We run in the XI 3.1 ans SAP int, kit - SP 2 on both.
    Sometimes af perfectly well functioning webi report suddenly returns no values - stating that the query didn't find anything. However - if I run the bex query with the same selections I get plenty of data. So there is data. Therefore it might be a Int. kit problem - however, when I bulid a new webi report - similar to the first one, with same dimensions etc. but without all the formatting - It runs fine too!!!!
    So it seems like somehow the original webireport has lost the connection to the measueres which it holds - has anyone any idea to what the cause might be and how to fix it?
    By the way - I havre refreshed the Universe and there is nothing to update.
    BR
    Jess

    Hi Ingo - the MDX statement from the MDX trace - does not yield any data - However, if I make a similar selection in the BEX, there i data avaiable - so it might be a problem with the how the MDX statement is generated.
    I've trouble shooted further and my learnings are so far:
    The problem is caused by a combination of 5 dimensions
    If you remove either one of the 5 dimensions - the query returnsdata
    If you add a specific meausure (a restricted bex key figure) - data is also returned - also in the other measures.
    The MDX statement looks like this:
    SELECT  { [Measures].[D6ZWIC1Q7MOA2YCJM1LAPRQNG], [Measures].[D6ZWIC1Q7MPTG70294GIUMJ70], [Measures].[D6ZWIC1Q7NGQDWFMH0MZ7LEP8], [Measures].[D6ZWIC1Q7NI9R53543I7CG78S], [Measures].[D6ZWIC1Q7NWVQXAK7CQUMKQEK], [Measures].[D6ZWIC1Q7NYF45Y2UFM2RFIY4] }  ON COLUMNS , NON EMPTY CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( [0CALMONTH2].[LEVEL01].MEMBERS, [0REPTT].[LEVEL01].MEMBERS ), [0EMPLSGROUP].[LEVEL01].MEMBERS ), [0PAYSCALEAR].[LEVEL01].MEMBERS ), [0ORGUNIT].[LEVEL01].MEMBERS ), [ZBOORGUNT                     ORGEH                         01].[LEVEL00].MEMBERS ) ON ROWS FROM [ZMPHPTGL1/ZDQHPTMN1] SAP VARIABLES [0P_CALMO] INCLUDING [0CALMONTH2].[12] [0P_CALYE] INCLUDING [0CALYEAR].[2009]
    Where all the measures in fact are restricted keyfigures from the Bex query. The dimensions are business content characteristics, as are the variables used.
    The above MDX statement returns nothing - but if you remover either one of the dimensions in the cross joins - the expected data is returned.
    Any ideas to why that happens?
    BR
    Jess

  • DATE FORMAT Conversion FOR SQL Reports

    Hi,
    Am building a report and am stuck here where this piece of code that throws the following error
    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
    My query goes some thing like this
    DECLARE @StartDate varchar(15),
    @EndDate Varchar(15)
    SELECT @StartDate = '01/08/2014',
    @EndDate = '31/08/2014'
    SELECT DISTINCT
    [Operation] = CASE WHEN p.DATE_OF_START BETWEEN @StartDate AND @EndDate THEN 'Add'
    ELSE 'Update' END
    FROM SNZ_HR_Reporting_POSMGNT as s
    LEFT OUTER JOIN PERSON as p on s.EMP_NO = p.EMP_NO
    WHERE s.CHANGE_DATE BETWEEN @StartDate AND @EndDate
    The date format in the column DATE_OF_START  is like yyyy-mm-dd 00.00.00.000 .
    My question is how to convert this format to dd/mm/yyyy format and execute the queries
    Many Thanks,
    Bhanu

    SQL Date Format:
    http://www.sql-server-helper.com/tips/date-formats.aspx
    Please Mark This As Answer if it helps to solve the issue

  • Currency Conversion in BeX Query

    Hello Experts
    I want to have corrency convetion option in Bex Query and have few questions regardig that.
    i am using key figure 0DEB_CRE_LC which has currency as    0LOC_CURRCY.
    1. how do i allow user to enter currecny, using some input variable for currency char.?
    2. do i need to associate some date for this conversion?
    3. what exchange rate will be used?
    Thanks in advance
    Regards
    Sudeep

    Hello Sudeep,
    1. how do i allow user to enter currecny, using some input variable for currency char.?
    Answer: Create a variable on 0Currency and select the conversion type which you have maintained in RSCUR tcode. Make this variable as input ready. This will give the user the flexibility to enter the Currency.
    2. do i need to associate some date for this conversion?
    Answer: Yes you need to associate the Currency conversion type to your conversion. Same can be maintained in RSCUR tcode.
    3. what exchange rate will be used?
    Answer: In RSA1, goto source system tab and right click on the Source system. Select "Transfer exchange rates". This will transfer the exchange rates which are maintained in your ECC side. The exchange rates are maintained in table TCURR. you can check the table in SE16.
    Regards,
    Satyam

  • Date Format Issue IN BEX REPORT

    Hi Experts,
    we are working on BW 3.5.
    we have a ODS where data is uploaded through flat file and there are 5 to 7 date field all made of Z infoobjects.
    So now the user is putting the data for these Date fields as 20110901 = 1st sep2011. but in report its coming as 09/01/2011
    when i checked all the Z fields that are created for this date fields have reference character as Date
    only one field is character so it is coming correct as given by the user
    but rest all are appearing in different format . In ODS also the date is coming as 09/01/2011
    now the user want all the data to be in the same format as given by HIM.
    I cant even change the properties of these Z info object removing the reference info object 0Date and make them character string.
    so now please suggest how to upload the date given by the user as it is without changing the format and also how to change the format for the back data as its flat file so No data can be deleted.
    thankkkkkkkks

    hello
    Bex analyzer is an excel add-in. Date formats are based on your regional settings.
    If you want to have a different date format in the sap gui then you have to change your user profile in sap system.
    Flat file upload needs the date format in a database format (YYYYMMDD).
    You can transform the date in the transformation step with rules or with a routine( abap coding).
    Thank you
    Yiannis

  • Date format mask in Enter-Query mode

    Hi,
    I'm developing a Form which is able to query the masterblock from a detail-item.
    The queryable detail-item is a date field and has a datatype: DATETIME. When a new record is entered the values in the date field are stored in the database like "18-10-2002 15:04:02"
    When the form is in enter_query mode the user must be able to enter 18-10-2002 (DD-MM-YYYY format mask, so without time mask). When execute the query with this date format the query is not able to find data.
    I used a Key-Execute-Query on the detailblock like this:
    SELECT 1.COLUMN
    , 2.COLUMN
    INTO :1.COLUMN
    , :2.COLUMN
    FROM TABLE.1
    , TABLE.2
    WHERE 1.COLUMN = 2.COLUMN
    AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    Can anyone please help me?
    Regards,
    Ronny.

    Hi Ronny,
    I'm not sure to have got exactly your issue (especially why you have to use that select in master-detail query), but I suggest you to substitute
    ...AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    with
    ...TRUNC(1.COLUMN) = TO_DATE(:avg.datum,'dd-mm-yyyy');
    To be fair, I would use it in the where clause, even if you set it dinamically.
    Let us know,
    Marco

  • Problem with date format conversion

    Hi All,
    I was trying to load from a flat-file to an ods through psa. the file has a date format which is mm/dd/yyyy. i want to convert that to yyyymmdd. i created a custom object ZDAT for this field of type char with length 10. i wrote a code in transfer routine for the conversion as follows:
    DATA : ZT1 LIKE SYST-DATUM,
    STR1 TYPE STRING,
    STR2 TYPE STRING,
    STR3 TYPE STRING.
    SPLIT TRAN_STRUCTURE-/BIC/ZDAT AT '/'
    INTO STR1 STR2 STR3.
    CONCATENATE STR3 STR1 STR2 INTO ZT1.
    RESULT = ZT1.
    it reported error in PSA records while loading aS " Infoobject /BIC/ZDAT does not contain alpa-conforming value 20050321.
    P.s: for this record i was abt to load 03/21/2005 to zdat.
    thanks,
    anitha.

    hi anitha!
       ok!
      in the transferrules you use the ZDAT as an field for date in transferstructure. but in info source use the 0calday.
    so now
        you need to write your routine in the transfer rules for 0calday which can be derived from zdat which can be derived from the zdat.
    so your Transfer structure will be same as
       zmid, zmatgrp, zdat, zcid, zloc, zqty
    But your Info source must be like
       zmid, zmatgrp, 0calday, zcid, zloc, zqty
    and in transfer rule i suggest you to use the following code for the 0calday.
        DATA : ZT1 LIKE SYST-DATUM,
         STR1 TYPE char(2),
         STR2 TYPE char(2),
         STR3 TYPE char(4).
         SPLIT TRAN_STRUCTURE-/BIC/ZDAT AT '/'
         INTO STR1 STR2 STR3.
         CONCATENATE STR3 STR1 STR2 INTO ZT1.
         RESULT = ZT1.
    hope it makes things clear....
    with regards
    ashwin
    Message was edited by: Ashwin Kumar Gadi

  • Date Format in Visual Studio Query Result Window

    Most vendor tools let you change the date format to show datetime in its query results window.
    But .NET does not have this.
    The ability to change this should be in located in Tools|Options but its not there.
    Can it be added in the next release?
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-RR HH:MI:SS' does not work. btw.
    .NET and/or ODT over-rides it.

    Why would you expect Microsoft to write stuff for an Oracle plugin?! Why on earth would you want to see anything other than the actual raw data that YOU requested in the results of a query? Surely formating/displaying a datetime is a presentation layer thing not a database layer thing! If you're really that bothered re-write your SQL till you get what you want.

  • Reg : date format conversion from dd.mm.yyyy to mmddyyyy

    hi ALL,
    is there any function module which can convert date format
    from <b>dd.mm.yyyy to mmddyyyy</b>.
    Thanks in advance

    Hi,
    Please check the following
    CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
    SCA1 Date: Conversion
    CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
    CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    TB01_ADDON
    CONVERSION_EXIT_DATEX_INPUT
    CONVERSION_EXIT_DATEX_OUTPUT
    Hope this would surely help you out.
    Thanks and regards,
    Varun.

  • Date format conversion from MySQL

    Hi my dear friends. I have some problem with the date format.
    I am using MySQL version 3, LabSQL and Labview7.1
    In the MySQL, the date format reads as 2006-12-18 14-51-25
    while, when querying in Labview, it reads 18-Dec-06 14-51-25.
    So when using this date (18-Dec-06 14-51-25) to query further. I got problems as MySQL does not recognise this format.
    How can I convert 18-Dec-06 to 2006-12-18?
    It might sound easier to change but for the year how do I change it to proper 2006, not 1906?
    Your solution will be helpful. Thanks in advance.
    Clement

    astroboy wrote:
    Hi Ravens. I think that not all computers have the same settings. Is there a way how can make sure that it still works despite of different settings in esch PC?
    By auto-changing registry?
     Clement
    There probably is a way to do that, but I don't know how.  I don't think it is a good idea to change the PC settings in that way because it would interfere with all other programs on the PC.  Suppose the user wants the format of date and time to remain the way it is for other programs or looking at file/directory properties.
    Rather than basing your functions on the system format settings, use the format string functions within labview that will make the date/time to appear the way you want it to.  Look at the format date/time string function on the timing palette.  Also, format into string on the string palette.

  • Date Format Conversion Problem

    Hi I am having trouble converting excel files to PDF.
    I am in Australia and so we use the date format dd/mm/yyyy.
    However when I convert to PDF it changes the date to the American format mm/dd/yyy.
    For example if the date in Excel is 07/08/2013 (7th of August 2013) after conversion to PDF it displays as the 08/07/2013 (8th of July 2013).
    Can someone please tell me how to get Adobe CreatePDF to convert to the correct date format?

    DrClap wrote:
    From the API documentation for SimpleDateFormat:
    "Text can be quoted using single quotes (') to avoid interpretation."
    So your format should be:"yyyy-MM-dd'T'kk:mm:ss.SSz"(Note that I added the "z" at the end to handle the timezone part of your input.)From the description of the OPs problem - that of obtaining the "date" information from an XML file - it seems easier to remove the unwanted characters than to add single quotes where needed.

Maybe you are looking for

  • HT5622 What steps  do you have to take to change your apple id for  your iCloud  account

    I have change my apple Id account from a aol email account to a gmail account . I am unable to change my apple I'd for iCloud to my new apple id  When the apple id window opens asking you for your password I enter the password for the old apple I'd u

  • Making more than 2 hr. DVDs?

    This may be a dumb question, but is there a way to make DVDs longer than 2 hours with iDVD 5? With the onset of dual-layered burners and media, it would be nice to be able to expand projects beyond 2hours. I love working with iDVD (better than Toast,

  • How to create links without using widgets

    I am using a vertical menu via the widget, but want to create a submenu without using the widget. btw, the rollover feature is fun

  • Are datatypes plattform independent?

    Hi all, maybe this one is a silly question (if so sorry for that..), but as we are migrating a MaxDB 7.6 database from a Win32 to a Win64 server machine we came up with concerns if the datatypes - esp. INTEGER - were plattform independent; meaning: i

  • I am new to java and need help to

    how can i read a class-file