Fm that handle data conversion with respective format

HI ,
there is FM that retrive the date like the format that was the input
like
     01.01.2006
     01012006
i found the CONVERT_DATE_TO_INTERNAL Fm and other ...
but it return the date in the format 20060101
Regards
Alex
Moderator message: date formatting questions = FAQ, please search before posting.
Edited by: Thomas Zloch on Dec 7, 2010 5:07 PM

check out FM CONVERT_DATE_FORMAT.

Similar Messages

  • BInput Data mismatch with currency format

    i am working with fs10 transaction
    I want to sum up the balance amount with respect to all
    companycode and post SUM to the bseg table using Batch input.
    i defined sum variable as below and coded.
    data : sum like glt0-hsl01.  (currency format)
    After all SUM operation.
    I have done like this to diplay SUM in report first(to check SUM output)
    SUM = SUM * 100.
    write : sum decimals 0.
    >>>>Now in report output i get value '17,222-'
    if u see in  fs10 screen we are getting same value.
    but when i try to post in Batch input.
    i have done like this below.(before posting i have checked
    for negative value )
    if sum < 0.
    sum = sum *100.
    compute sum = abs( sum )
    now...
    perform open_group................
    perform bdc_field using 'bseg-wrbtr'  (currency format)
                                    sum.
    when i execute this BI i get error in Amount(Sum)value
    display screen. (saying something differs in length )
    how to match the field.
    ambichan.

    Hello,
    Go to the Domain of the Field BSEG-WRBTR, which is WERT7. There you see the Output length as 16. So you decalre a local variable in BDC which is of CHAR16 in length to hold the value of WRBTR.
    Hope this helps you.
    Regds, Murugesh AS

  • Date search with any format in oracle

    Hi Friends
    i have Problem with the date format In Db i have column with message (VARCHAR2)
    like.
    Admin~Assigned ~01-08-2013 03:12:35~ [email protected]
    Admin~Assigned ~01-AUG-2013 03:12:35~TEXT [email protected]
    Admin~Assigned ~01-JAN-13 03:12:35~text [email protected]
    Admin~Assigned ~01-07-13 03:12:35~TEXT [email protected]
    I enter only date in varchar2 any format '01-AUG-2013' .it will give the all output.
    How do i do that. Pls help me
    Thanks

    I had to deal with crappy data like yours many times. And its always a pain. We always expect for a magical generic solution. But there is never one such solution
    This is the best I have got.
    Lets consider this is your table.
    SQL> select *
      2    from t;
    STR
    Admin~Assigned~01-08-2013 03:12:[email protected]
    Admin~Assigned~01-AUG-2013 03:12:[email protected]
    Admin~Assigned~01-JAN-13 03:12:[email protected]
    Admin~Assigned~01-07-13 03:12:[email protected]
    We can split your data into columns like this.
    SQL> select regexp_substr(str, '[^~]+', 1, 1) col1
      2       , regexp_substr(str, '[^~]+', 1, 2) col2
      3       , regexp_substr(str, '[^~]+', 1, 3) col3
      4       , regexp_substr(str, '[^~]+', 1, 4) col4
      5       , regexp_substr(str, '[^~]+', 1, 5) col5
      6       , regexp_substr(str, '[^~]+', 1, 6) col6
      7    from t
      8  /
    COL1                 COL2                 COL3                 COL4                 COL5              COL6
    Admin                Assigned             01-08-2013 03:12:35  TEXTMGMT             INSERT            [email protected]
    Admin                Assigned             01-AUG-2013 03:12:35 TEXTMGMT             UPDATE            [email protected]
    Admin                Assigned             01-JAN-13 03:12:35   textMGMT             DELETE            [email protected]
    Admin                Assigned             01-07-13 03:12:35    TEXTMGMT             INSERT            [email protected]
    Now the problem is you have the date value (COL3) in various format. That's messed up. To convert a string into a date format the first thing you need to know is the format of the string. Basically how the string is represented as date. Without knowing that there is no way you can convert a string to date. Said that now you need to device a method to convert string input having various date formats into a date value.
    Below is a function that does that. But the problem is that you need to define the possible date formats in that. I have defined 10 date formats (No magic there ).
    SQL> create or replace function convert_as_date
      2  (
      3    p_date_string varchar2
      4  ) return date
      5  as
      6    type l_dt_fmt_tbl is table of varchar2(100) index by pls_integer;
      7    l_dt_fmt_list l_dt_fmt_tbl;
      8    l_ret_dt date;
      9
    10    function check_date_format
    11    (
    12       p_str varchar2
    13     , p_fmt varchar2
    14    ) return date
    15    is
    16      l_dt date;
    17    begin
    18      l_dt := to_date(p_str, p_fmt);
    19      return l_dt;
    20    exception
    21      when others then
    22        return null;
    23    end;
    24  begin
    25    l_dt_fmt_list(1)  := 'dd-mm-yyyy hh24:mi:ss';
    26    l_dt_fmt_list(2)  := 'mm-dd-yyyy hh24:mi:ss';
    27    l_dt_fmt_list(3)  := 'dd-mm-rr hh24:mi:ss';
    28    l_dt_fmt_list(4)  := 'dd-mon-yyyy hh24:mi:ss';
    29    l_dt_fmt_list(5)  := 'mon-dd-yyyy hh24:mi:ss';
    30    l_dt_fmt_list(6)  := 'dd-mm-yyyy';
    31    l_dt_fmt_list(7)  := 'dd-mon-yyyy';
    32    l_dt_fmt_list(8)  := 'yyyy-mm-dd hh24:mi:ss';
    33    l_dt_fmt_list(9)  := 'yyyy-mon-dd hh24:mi:ss';
    34    l_dt_fmt_list(10) := 'yyyy-dd-mm';
    35
    36    for i in 1..l_dt_fmt_list.count
    37    loop
    38      l_ret_dt := check_date_format (p_date_string, l_dt_fmt_list(i));
    39      exit when l_ret_dt is not null;
    40    end loop;
    41
    42    if l_ret_dt is null then
    43      raise_application_error(-20001, 'Invalid date: Specified format not supported');
    44    end if;
    45
    46    return l_ret_dt;
    47  end;
    48  /
    Function created.
    Once you have this you can do the following.
    SQL> var input_val varchar2(100)
    SQL> exec :input_val :=  '01-AUG-2013 03:12:35';
    PL/SQL procedure successfully completed.
    SQL> with my_tbl
      2  as
      3  (
      4  select regexp_substr(str, '[^~]+', 1, 1) col1
      5       , regexp_substr(str, '[^~]+', 1, 2) col2
      6       , regexp_substr(str, '[^~]+', 1, 3) col3
      7       , regexp_substr(str, '[^~]+', 1, 4) col4
      8       , regexp_substr(str, '[^~]+', 1, 5) col5
      9       , regexp_substr(str, '[^~]+', 1, 6) col6
    10    from t
    11  )
    12  select *
    13    from my_tbl
    14   where convert_as_date(col3) = convert_as_date(:input_val);
    COL1                 COL2                 COL3                 COL4                 COL5              COL6
    Admin                Assigned             01-08-2013 03:12:35  TEXTMGMT             INSERT            [email protected]
    Admin                Assigned             01-AUG-2013 03:12:35 TEXTMGMT             UPDATE            [email protected]

  • Most efficient way to handle Image sizes with respect to Mobile Screen Size

    Hi all,
    I and trying to find the best possible way to manage Images with respect to the size of mobile screen.
    If I have an image that is best fit on mobile screen size (176 x 144) then how can I make it best fit for (128 x 128) screen size ?
    rizzz86

    Hey Rizzz86,
    You could also scale down a higher resolution image to fit smaller screens, however you will find that resizing by factors other than 2, 4, 8 is harder to achieve with a decent quality and much slower on lower spec devices.
    You could also display 128x128 image centered on 176 x 144 screen with black borders around it.
    It will look not that bad (i.e. borders of 24 pixels top and bottom and 8 pixels left and right) and will cost you nothing in terms of space or processing.
    In the end having an image in 3 different sizes will not increase the MIDlet size by much, unless you are having tens of such images (for example custom UI elements).
    Best solution is to have a bit of both I think. Personally I use scaling down by factors that are powers of 2 and displaying with the black borders.
    Daniel

  • Time Data loading with missing format

    Hi expert,
    after we load time data, find the following missing information:
    0CALDAY:
    20.080.112 (Error)
    2008.01.12 (correct one)
    0CALMONTH:
    200.801(Error)
    2008.01(correct one)
    0CALQUARTE
    20.081(Error)
    20081(correct one)
    Could anyone let us know how to correct data with missing format to correct one and how to do this step by step? Many thank!

    What is the source for this data ?
    Have it corrected in the source
    Or
    Correct in PSA and load it from there.
    Does it happen only for a few records ?

  • About to buy ipad2, Verizon aircard is already built in to my notebook - can I share that Verizon data plan with my new Verizon iPad2?

    I am about to buy an ipad2.  I already have a Verizon aircard built in to my SONY notebook - can I share that same existing Verizon data plan with my new Verizon iPad2?  I would rather not to have to buy a second data plan.
    Thanks for your input

    No.
    If your notebook can be set up as an adhoc WiFi network or HotSpot you could use that instead of activating the plan on the iPad 2.

  • Possible standard reports that can be generated with respect to lead...

    hii friends,
    i am new to CRM.
    can any on please give me some idea about what kind of standard report can be generated in crm with respect to leads and opportunity.
    thanks,
    regards,
    akshay ruia

    Hi Akshay
    Lead management
    1. Won / Lost Leads Lead Origin - Lead Management
    2. Channel Analysis - Lead Management
    3. Efficiency Reporting - Lead Management
    4. History Reporting - Lead Management
    5. Lost Leads - Lead Management
    6. Qualification Level - Channel Mgmt.
    7. Lead History - Channel Mgmt.
    8. Top n Lost Leads (Current Year) - Channel Mgmt.
    9. Won Leads (Current Year)
    Opportunity Management
    Competitors in Current Opportunities
    1. Completed Opportunities According to Status
    2. Completed Opportunities Acc. to Status (Sales Manager Portal)
    3. Expected Product Value
    4.. Expected Sales Volume per Product
    5. My Strongest Competitors Opportunity Item Details
    6. Opportunity Monitor
    7. Opportunity Monitor Timeline Analysis
    8. Opportunity Pipeline
    9. Pipeline Analysis per Phase
    10. Pipeline Analysis per Phase (Sales Manager Portal)
    11. Pipeline Analysis per Region
    12. Sales Volume Forecast
    13. Sales Volume Forecast (Sales Manager Portal)
    14. Targeting Based on Competitors
    15. Targeting Based on Lost Opportunities
    16. Top Five Opportunities
    17. Top Five Opportunities (Business Transaction Number)
    Hope this will be helpful.
    Regards

  • Applying Currency conversion with respect to Date in WAD result

    Hi Gurus,
    We have a web report with different currencies.
    Now the business requested to create a down drop with the dates as per the data when we load the exchange rates in TCURR table.
    So using the date on the web report, business wants to change the report values for different currencies (USD, EUR, CHF..) as per their wish.
    Now the technical challenge is ,
    We don't have currency types used in the cube, We are not maintaining a Unique currency values in the target (Cube)  and if incase we overcome with all the above challenges.
    In web report when we select the date , the report should not have any effect or change the result output unless after selecting the dates must click required currency button to convert the result.
    The report should only change when we press the convert to different currency button.
    So,Gurus please help me how to achieve this
    Regards,
    chandu

    Hi,
    I see that the function module is converting the FLOAT value to the internal ABAP date format (YYYYMMDD) - this is the correct format in which the date value is stored internally in ABAP. Even your info object that you used in your DSO if defined with property type 'DATS' would expect the value in this format only.
    Unless I did not understand your issue, the function module does the job and you don't need to add any additional patching for the format you are expecting.
    Regards,
    JK

  • Data conversion from 212 format

    I found a problem during conversion data.
    I have a file which contains ASCII characters (in fact they're look
    like ASCII on any editor) . I have to convert them to integer but I
    know that data are organised into pairs of 12bit numbers packed into
    byte triplets (format 212).
    I made some vi (which convert 2 following ASCII characters to binary,
    then divide them to pairs of 4bits, then some rotation etc..) but the
    whole conversion takes too much time (64kb file conversion is taking
    approx. 1minute).
    Thank you for any suggestions,
    Michael ([email protected])

    Dear Michal,
    I hope this vi work faster.
    Input: 3bytes, data type unsigned int (U8)
    Output: 2 values, data type integer. (INT16)
    of course read all file to memory. Don't read everytime from file by 3
    bytes.
    Deniss
    ps. vi i send by e-mail.
    "Michal Szaj" wrote in message
    news:[email protected]..
    > On Wed, 18 Sep 2002 02:27:25 GMT, Greg McKaskle
    > wrote:
    >
    > >This is one of those things that is quite sensitive to how it is coded.
    > > If you make your VI available, others, including myself can give you a
    > >hand with speeding it up.
    > >
    > >As for guessing at what might be going on, first look at the array wire.
    > > If you are using locals or property nodes to access the a
    rray, that is
    > >the cause. If the array is written to a global and later accessed via
    > >the global, that is causing it.
    > >
    > >I suspect that the bit manipulations on 64K should take something like a
    > >few seconds.
    > >
    > >Greg McKaskle
    >
    > Thank you for your support.
    >
    > In this case I have only one vi and I don't use any global/local
    > variables.
    > At the beginning of the vi I load all text character from file to
    > memory and then I'm making further operations.
    >
    > If it helps I can send the vi with data file.
    >
    > Thnx,
    >
    > Michael ([email protected])

  • Looking for a java-based SDK that handles file conversion to PDF and TIF...

    Hi all,
    First off, this is my first posting so I'm not 100% sure where to post this topic. So please forgive me if I'm accidentally posting in the wrong location.
    My question deals with a project I am currently working on.
    I am looking for a java-based SDK that can meet the following requirements...
    1) convert all printable file-formats (i.e. JPEG, DOC, TXT, PPT, etc.) into PDF
    2) merge multiple PDFs into one PDF
    3) convert PDF to TIF or at least do some sort of conversion to TIF
    4) works in Java or some sort of web-based language
    5) free or relatively cheap
    Any advice/suggestions would be greatly appreciated.
    Thank you very much.

    I don't think you will get one API to do them all.
    Some helpful hints:
    [http://schmidt.devlib.org/java/libraries-pdf.html]
    [http://xmlgraphics.apache.org/fop/] (with the pdf-image extension, that I can't find now :shakefist)
    JAI

  • Trying to compare date columns with differing formats...

    I have an app that created a series of tables via ODBC using ANSI standard datatypes. For most, this isn't a problem, but one in particular is driving me crazy: TIMESTAMP. In Oracle, it shows up as a TIMESTAMP(6). I don't want to mess with the app's tables, so every time there is an insert to their tables, I have a trigger which creates records in corresponding tables I build using standard Oracle datatypes (DATE).
    I have one function that gets called by several of the triggers that retrieves me a specific row to update, and it uses the value from this TIMESTAMP field in the WHERE clause like this (the value is passed into the function as a parmeter):
    SELECT TIMECARD_ID INTO tc_id FROM TS_TIMECARD_MAIN
    WHERE EMP_ID = e_id AND VEHICLE_ID = v_id
    AND IN_TIME <= logout AND OUT_TIME IS NULL; <----
    I seem to have a formatting issue, because unless the "logout" date is a full day later than IN_TIME, it doesn't pull the record (my code does a check to verify there is only one record matching the criteria but I haven't posted it all here for simplicity). I need it to be able to select the correct record with a one second difference.
    I have NLS_TIMESTAMP_FORMAT set to 'YYYY-MM-DD HH24.MI.SS.FF' and NLS_DATE_FORMAT set to 'YYYY-MM-DD HH24:MI:SS'. The relevant describes are included below. Can anyone suggest how to format my query (I expect to use the TO_DATE and TO_CHAR to compensate, but haven't found the right set) so that it resolves properly? Date math is a pain, but it is critical to my purposes.
    Vendor's table
    FIELD3_DATETIME TIMESTAMP(6)
    My table
    TIMECARD_ID NOT NULL NUMBER(10)
    EMP_ID NOT NULL NUMBER(10)
    IN_TIME DATE
    OUT_TIME DATE
    VEHICLE_ID NUMBER(10)
    Also, some sample default output from each table - not sure why formatting is wierd on my table.
    Vendor's table
    UNIQKEY STATUS FORM_ID VEHICLE_NUMBER CREATED_DATETIME
    11515780978071234994451 0 21423 24005 28-JUN-06 05.10.14.000000 PM
    CHECK_DVIR NEW_DVIR SERVICEABLE DETAILS
    1 1 1 everything ok
    INSPECTION_TIME ODOMETER LATITUDE LONGITUDE
    28-JUN-06 05.12.12.000000 PM 119885.1 44.7889490425587 -95.2167677879333
    My table
    TIMECARD_ID EMP_ID IN_TIME OUT_TIME VEHICLE_ID
    5 20044 28-JUN-06 24005

    That sounds a bit complicated. If you post your query I'm sure there will be a simpler approach, perhaps something like
    where  date_timestamp between cast(sysdate -30 as timestamp) and systimestampor if you prefer
    where  date_timestamp between systimestamp - interval '30' day and systimestampas discussed on Re: convert timestamp to date.

  • Data conversion into specified format using Script component in SSIS 2008

    We have a field in the flat file source which is of the format 13399I , and it need to be type cast to the below format.
     13399I = 1339.99
     5950{ = 595.00
    The sign field equals:
    {=0
    A=1
    B=2
    C=3
    D=4
    E=5
    F=6
    G=7
    H=8
    I=9
    please let us know how to accomplish using script component in SSIS

    You can use the following in the script task.
    1) Create a dictionary to hold the key-value pairs ({=0,A=1...).
    2) Use a substring function to pull out all the string minus the last character.
    3) Append the last character back after replacing the character with the respective value from the dictionary.
    4) Convert the final string to int/decimal/numeric as per the destination.
    Do keep in mind, the data you are referring to is in the COMP3 format. You can do some further research regarding how to convert COMP3 to decimal. There are many ways out there. I personally prefer to load the data into a table and us a lookup table
    to do all this. But it's entirely by preference.

  • Excel dates export with wrong format.

    When I exported an Excel Spreadsheet with several date columns, they displayed correctly but because of wrong formatting, they didn't sort right. The cell display was, for example, 2/7/2013 but Excel treated it as 7/2/2013 because it was assigning another country's formatting. some of the cells were formatted correctly, but about half of them were wrong and they were wrong in different ways. some were Argentinian, some Carribean, some European. Any ideas how to prevent this from happening?

    Go to Sequence>Settings and in the lower left use load presets.
    Anything that's in the HD in the sequence will have to be reset using the remove attributes function. If you have mixed media, strange things will happen.
    Also use easy setup to change your preset so any future sequences you create will be in the correct format.

  • URGENT!! date conversion with SimpleDateFormat

    java.text.SimpleDateFormat sdf = new SimpleDateFormat();
    try
    Date date = sdf.parse(elementValue);
    System.out.println(sdf.format(date));
    application.setDecisionDate(date);
    catch (Exception e)
    e.printStackTrace(System.err);
    }

    And you should always specify the following:
    -Results you got - the exact compiler error, exception - with printStackTrace(), or System.out.println() result. With code you must specify the line that the problem occurs on; add a comment to the code example specifying it.
    -What you expected to get.
    -If possible a small code example demonstrating the problem fully.
    All of the above is missing in this post.
    -Still no idea what the problem is.
    -Still no clear idea of what result was expected. For example is it supposed to verify that a user has typed in the correct date or parse a valid date from a data base? In one case you want the exception to occur, in the other you don't.
    -There is a small code example but it is imcomplete because it doesn't specify what the input value is - what date is being used?

  • Handle Date conversion error without function

    Hi,
    Database version 12.1 - though I would also like to hear if the solution is possible for 9i DB too, as I am pulling data from a view over a DB Link, and would prefer to have the date fix within the view to having to recreate the view logic in my datawarehouse.
    A small illustrative sample of what I want.
    Sample Data
    create table descriptors (attribute1 varchar2(25), creation_date date);
    insert into table descriptors (attribute1, creation_date) values ('010612',sysdate);
    insert into table descriptors (attribute1, creation_date) values ('310612',sysdate);
    commit;And the result I am after, in pseudo code....
    select case when to_date(attribute1,'DDMMYY') = error then creation_date else to_date(attribute1,'DDMMYY') end as safe_date from descriptorsYes - I know this will not work!!
    And yes, I know storing dates as text is not best practise, this is drill down data from Oracle e-business feeder files, decisions that were made before I had any influence over them - so I am having to make the best of a bad job.
    thanks for your input,
    Robert.

    Etbin wrote:
    select case when case when to_number(substr(attribute1,3,2)) not between 1 and 12
    then 'error'
    when to_number(substr(attribute1,1,2)) not between 1 and to_number(to_char(last_day(to_date(substr(attribute1,3),'mmrr')),'dd'))
    Neat solution !
    I'll remember that.
    But I fail to understand why the 2 embedded case ?
    Should this be enough ?with
    descriptors(attribute1,creation_date) as
    (select '010612',trunc(sysdate) from dual union all
    select '110612',trunc(sysdate) from dual union all
    select '210612',trunc(sysdate) from dual union all
    select '310612',trunc(sysdate) from dual
    select case when to_number(substr(attribute1,3,2)) not between 1 and 12
                          then creation_date
                          when to_number(substr(attribute1,1,2)) not between 1 and to_number(to_char(last_day(to_date(substr(attribute1,3),'mmrr')),'dd'))
                          then creation_date
                else to_date(attribute1,'ddmmrr')
           end checked
      from descriptors
    /

Maybe you are looking for