Date to Quarter Conversion

Hi ,
  I need to get the quarter from posting date..
  Please let me know the function module to get the quarter from the date.
Thanks
Vishal

Hi Vishal,
                Try with automatic time conversion.
please check here..
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a653be07211d2acb80000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/d3bd241ae76f75e10000000a1553f6/content.htm
Thanks,
Vijay.

Similar Messages

  • DATE vs DATETIME conversion

    I am running into a strange issue which is preventing me to finish my project. Any help would be greatly appreciated. 
    It looks like the CONVERT (the same goes for CAST) function treats DATE and DATETIME conversions differently when executed by a user with the Dutch language settings.
    Here is what I mean, I run the following query:
    SELECT CONVERT(DATE, '2014-09-01 23:00:00'), CONVERT(DATETIME, '2014-09-01 23:00:00')
    The results are:
    2014-09-01, 2014-01-09 23:00:00
    The conversion to DATETIME swapped the month and the day around, while this doesn't happen for the DATE conversion. The DATE conversion is the correct format, since I supplied it YYYY-MM-DD HH:mm:ss.
    When I run the same query using a user with the default language settings (en-US I assume) the same query works fine (no swapping of month and day values). 
    Can someone explain why this is happening? And maybe more important how to prevent it or workaround it (changing the language for the user from Dutch to default is not an option)? 
     

    >> Can someone explain why this is happening? And maybe more important how to prevent it or workaround it (changing the language for the user from Dutch to default is not an option)? <<
    CONVERT() is an old Sybase string function. It was created to keep 960's COBOL programmers happy since SQL does not have a PICTURE clause to put data in display formats. 
    CAST() is the ANSI/ISO Standard function to convert data types and this is what you should be using. It is not a string function. It uses the ISO-8601 standard for dates (yyyy-mm-dd), as you have seen. This is the only -– repeat, only! -- format allowed in
    SQL. Microsoft is a few decades behind and trying to catch up now.
    A good SQL programmer will do any local display formatting in the presentation, which will handle local languages that are never used in the database. Want to have some fun? The names of months in Polish, Czech, Croatian, Ukrainian and Belarusian not based
    on the Latin names used in most European languages. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • ANSI X12 meta data availability in conversion agent??

    Hello,
    Is there a provision for availability of ANSI X12 meta data in SAP conversion agent. We are trying to process EDI orders using the X12 INDUSTRY standard. Please advise.
    -Kris

    hi,
    SAP Conversion Agent together with SAP Net Weaver, enables  to automate complex integration activities for a multitude of data and document formats. These include unstructured and partially structured documents such as Office files, data streams, printing applications, and other application-specific formats.
    Easily integrate unstructured and semi-structured data into SAP Net  Weaver Process Integration using the Conversion Agent.
    Conversion Agent dynamically converts unstructured messages from   Microsoft Word,Excel,PDF plain text. 
    Semi-structured formats such as HL7,SWIFT,HIPA, ANSI X12 and COBOL to   PI understandable SOAP XML.
              So that it helps to easily integrate the information need into the back-end systems. Conversion can also be used as the reverse process to convert from XML to unstructured or semi-structured formats
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/sap%2bconversion%2bagent%2b-%2bthe%2blong%2bjourney
    Conversion Agent - Handling EDI termination characters
    Conversion Agent a Free Lunch?
    Integrate SAP Conversion Agent by Itemfield with SAP XI
    regards
    sr

  • Year to date, rolling quarter measures

    I need to implement reports with year to date, rolling quarter (current month + 2 previous month) measures, etc...
    The BO universe is connected to a bex query on a SAP multi provider
    Where do you recommend to implement such measures?
    Should we precalculate them in a SAP BI keyfigure ?
    Should we create a restricted key figures in the bex query and using SAP variable with customer exits to implement for example the rolling quarter functionnality?
    Should be we create a new measure in the BO universe?
    Should we create a new variable in the report. In this case what is the impact on the performance?
    We have about 30.000 records in our cube for about 3 years of data. the volume will grow on a monthly basis but analysis will mainly be done on maximum three years of data.

    Hi,
    this is not related to performance. this is related to the simple fact that the MDX on SAP BW does not have support for something like a Today() or a Now(), which means you can't have rolling months based on the system date.
    if you use an EXIT variable you have the keyfigures in the universe and can leverage it in the Web Intelligence report.
    ingo

  • What is the syntax to get last date of Quarter ?

    Hi ,
    We are planning to have Bom effective date functionality. Presently BOM Disable date is coming in between the Quarter. Is there any funtion or syntax to get last date of quarter for the bom disable date. similar to "$begin" to get the last date.
    Thanks

    Hi,
    To get this done you can do the following.
    1. Create the Result Source.
    2. Create the display template using the design manager and copy the existing template make the req. changes on the template and publish it to the document library and give the manage property that you req. for this concatenation functionality. Manage Property
    like the domain etc.
    3. Create search center and add the new page modified the core result web part and give the result source and custom template that created in step 2.
    4. Publish the page.
    5. Create the Search vertical and give the name and use the same page the created in step3. 
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-source.html
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-types.html
    http://sharepointfordeveloper.blogspot.in/2013/06/sharepoint-2013-design-manager.html

  • Need help in date to number conversion

    Hi,
    I have a doubt in a date conversion, please help me.
    I executed the below query, its throwing "invalid number" error.
    select * from test
    where date_sid between to_number(to_char('01-05-2009','dd-mm-yyyy'),'yyyymmdd') and to_number(to_char('02-05-2009','dd-mm-yyyy'),'yyyymmdd')
    date_sid column is number datatype.
    In my above query i want to pass the date value like '12-05-2009'. If i check my table date_sid looks like yyyymmdd. So how to convert '12-05-2009' to 20090512 in my above query. Please help me.
    Thanks.

    Use to_date instead of your to_char, and to_char instead of your to_number.
    That said, that's very very sad to work on date as number format.
    Nicolas.

  • Date to number conversion?

    I want to select a number of rows created within last week.
    To do it I use a select statement with:
    WHERE sysdate-o.created_on <= days;
    (days is a number, created_on is a date)
    Everything works fine, but I get warnings like this one:
    PLW-07204: conversion away from column type may result in sub-optimal query plan
    I suppose I should convert date to number to get rid of them. How can I do it isnide a SELECT query?

    While the comments regarding re-writting the query to allow the possibility of index usage are valid, the warning will still appear even with the re-written query. I am sure that this query would use an index on dt1 if one was available.
    SQL>CREATE TABLE t (id number, dt1 date, dt2 date);
    Table created.
    SQL> CREATE PROCEDURE p1 AS
      2  BEGIN
      3     FOR r IN (SELECT * FROM t
      4               WHERE dt1 = sysdate - 7) LOOP
      5        NULL;
      6     END LOOP;
      7  END;
      8  /
    SQL>/
    SP2-0804: Procedure created with compilation warnings
    SQL>show error
    Errors for PROCEDURE P1:
    LINE/COL ERROR
    3/13     PLW-07204: conversion away from column type may result in
             sub-optimal query planThe warning in this case is clearly spurious, and the reason is, at the level the compiler is looking, they are different data types. dt1 was inserted as sysdate a few minutes before I did the dunp below.
    SQL> SELECT DUMP(dt1) tab_date, DUMP(dt1 - 3) calc_date,
      2         DUMP(sysdate) sys_date
      3  FROM t;
    TAB_DATE                            CALC_DATE                          SYS_DATE
    Typ=12 Len=7: 120,107,2,27,10,45,42 Typ=13 Len=8: 7,215,2,24,9,44,41,0  Typ=13 Len=8: 7,215,2,27,9,49,13,0A date field in a table is a type 12 while sysdate, and any date that has is a result of a calculation is a type 13. Clearly a "different" datatype.
    Practically speaking, in the SQL engine, the type 13 date would be cast to a type 12 date and used in an index probe, but the compiler is likely doing something similar to the DUMP conparision.
    I believe that the type 13 dates are a representation of the C time_t struct that Oracle's kernel would likely use internally.
    John

  • File adapter modules : Access to file data before content conversion

    I have a file sender channel for which content conversion in applied. The incoming file has data in comma separated values format.
    e.g.
    102366,Amol Joshi,DEPT1
    107752,XYZ PQR,DEPT2
    I want to access the the actual data in the file before content conversion takes place. Is it possible to access this data inside the adaper module? I tried creating an adapter module and put it before CallSAPAdapter,it still gets the XML after content conversion as the input data to the module.
    Any pointers?

    Hi Amol,
    I dont know if it is the right approach.
    But if u r not able to meet ur requirement u can do one work around.
    Use Message Transformation Bean to convert it once again in to CSV (flat file structure) and then proceed with ur module.
    There should be a better way than this.
    Hope we could find a better solution in the forum.
    Regards,
    Sudharshan

  • Date Time stamp conversion

    I have a timestamp coming from flat file in the following format YYYY-MM-DD HH:MM:SS.mss(2007-02-21 11:48:31.000)
    to store in Bw I have  created a Object as data type :NUMC and length 14 ,I have conversion routine as times .I was wondering if this will work and also
    can anyone suggest me to covert this as YYYYMMDD and tIme by spliting the field i am getting from flat file.
    Thanks
    Samuel

    Hi Samuel,
    You would need to write a routine for converting.
    Char v_date(8), i_date(18), day(2), month(2), year(2).
    i_date = trans_stru-<your date>.
    day = i_date +  9(2).
    month = i_date + 6(2).
    year = i_date + 5(4).
    concatenate year month day into v_date.
    Result = v_date.
    Bye
    Dinesh
    (Do not forget to assign points!!)

  • Importing data error: SIGNEDDATA conversion error

    The complete description is:
    The number of failing rows exceeds the maximum specified. (Microsoft Data Transformation Services (DTS) Data Pump (8004202c): TransformCopy 'DTSTransformation__13' conversion error:  General conversion failure on column pair 1 (source column 'SIGNEDDATA' (DBTYPE_STR), destination column 'SIGNEDDATA' (DBTYPE_NUMERIC)).)
    We are trying to convert a value that come with miles separators, use the character "." (point) as separator and "," (comma) as decimal separator, we use a vb function (replace) to change the points for null string, but it doesn't work.  Do you have any suggestion to solve this?
    We are using BPC 7.0 MS SP3.
    Thanks in advance,
    Mariana Rodriguez.
    Edited by: Mariana Rodriguez on Mar 23, 2011 4:15 PM

    Hi Mariana,
    I've had the same kind of problem, which gave me the
    General conversion failure on column pair 1 (source column 'SIGNEDDATA' (DBTYPE_STR), destination column 'SIGNEDDATA' (DBTYPE_NUMERIC)).)
    errror message
    My issue was resolved by changing the CREDITNEGATIVE=NO option to CREDITNEGATIVE=YES, because BPC probably converted negative values as 'string' values in stead of 'numeric' when importing SAP FI data with the minus sign '-' at the end (100-) instead of SQL signeddata (-100)
    But I have to be carefull, my Account Dimension setup is as follows:
    Balance Sheet Asset => AccType=AST
    Balance Sheet Liabilities => AccType=LEQ
    Profit and Loss Revenues => AccType =INC
    Profit and Loss Expenses => AccType=INC
    My flat file seperator is a comma (,) and decimalpoint is a point (.)
    We are using BPC 7.5 MS SP07 Patch 02 and I'm not using any VBA to convert the amount.
    Maybe it can help?
    Regards,
    Peter van Drunen - FPM Solutions

  • Hierarchial data through content conversion

    All,
    we have an input file in the following format. (This is a fixed length file structure, where the first character is the type of the record and the rest is the data)
    0XXXX
    1YYYY
    2MasterRow-1
    3Childrow 1
    3Childrow 2
    4Childrow 1
    4Childrow 2
    2MasterRow-2
    3Childrow 21
    3Childrow 22
    4Childrow 21
    5XXXXX
    we need this converted as follows, (all records are master records, only record 2 can have children. and the records of type 3 & 4 that follow record type 2 (till the next occurence of record type 2) are the children of that record.
    <record><type>0</type><data>XXXX</data></record>
    <record><type>1</type><data>YYYY</data></record>
    <record><type>2</type><data>MasterRow-1</data>
        <children>><type>3</type><data>Childrow 1</data></children>
        <children>><type>3</type><data>Childrow 2</data></children>
        <children>><type>4</type><data>Childrow 1</data></children>
        <children>><type>4</type><data>Childrow 2</data></children>
    </record>
    <record><type>2</type><data>MasterRow-2</data>
        <children>><type>3</type><data>Childrow 21</data></children>
        <children>><type>3</type><data>Childrow 22</data></children>
        <children>><type>4</type><data>Childrow 21</data></children>
    </record>
    <record><type>5</type><data>XXXX</data></record>
    Can we do this using content conversion? or should we go for multi step mapping?
    Thanks,

    Hi,
    Ref. this doc. <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/482aae19-0301-0010-3485-8efd618818d0">How to Handle Unstructured Source Contents for Adapters</a>
    Regards,
    Jakub

  • Every Friday date given quarter

    How do you return the date for every Friday given the quarter? Thank you.

    Hi,
    Welcome to the forum!
    This will show all the Fridays in the same quarter as target_date:
    DEFINE     target_date     = "DATE '2010-04-24'"
    WITH     got_a_date          AS
         SELECT     NEXT_DAY ( TRUNC (&target_date, 'Q') - 1
                     , 'FRIDAY'   -- NLS dependent.  See note below
                     ) + ( 7
                             * (LEVEL - 1)
                             )            AS a_date
         FROM     dual
         CONNECT BY     LEVEL <= 14
    SELECT       a_date
    FROM       got_a_date
    WHERE       TRUNC (a_date, 'Q')     = TRUNC (&target_date, 'Q')
    ORDER BY  a_date
    ;This depends on NLS_DATE_LANGUAGE. If you can't count on that, then use
    TO_CHAR ( DATE '2010-04-23'    -- or any date you know is a Friday
            , 'DAY'
            )instead of the literal 'FRIDAY' as the 2nd argument to NEXT_DAY.
    This relies on the fact that there are, at most, 92 days in any quarter, and therefore there will never be more than 14 of any given weeekday in any quarter. ( (7 * 14) > 92) That explains the "magic number" 14 in the CONNECT BY clause of got_a_date.

  • Converting Coverage Start Date during OAB Conversion for current elections

    We have a requirement to convert the coverage start date of current elections in the Legacy System to OAB.
    We are using 'BEN_ELECTION_INFORMATION.ELECTION_INFORMATION_W' api to convert current enrollments and is passing the actual coverage start date of the current enrollments to the parameter 'p_enrt_cvg_strt_dt' in this API. We have an administrative Life Event configured in OAB for converting the current enrollments with Assigned Life Event date as '29-JUN-2010' . After the Conversion API is executed for all the Enrollment records the coverage Start Date is set to '29-JUN-2010', which is not the requirement.
    We also tried using the APIs 'BEN_PRTT_ENRT_RESULT_API.UPDATE_ENROLLMENT' and 'BEN_PRTT_ENRT_RESULT_API.UPDATE_PRTT_ENRT_RESULT', but they behave the same manner as 'the Legacy System to OAB. We are using 'BEN_ELECTION_INFORMATION.ELECTION_INFORMATION_W'.
    Please let us know which API would allow us to convert the current elections without changing the actual coverage start date from the Legacy System.

    I did run the default enrollment process, but nothing happens. I tried this with the Assign on Default check box checked and unchecked. Here is what I have setup for the enrollment details on this plan:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Program Enrollment Requirements > General > Plan
    Method: Automatic
    Enrollment: Current, Keep Only; New, Can Choose
    Default Enrollment:
    - Code: Rule
    - Rule: DEV_X
    - Assign on Default: Checked
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    I removed the eligibility profile from the plan and it will default when running the participation process, however that does not solve the problem. I even rewrote the rule to include plan id, but that did not work either. The employee needs to be enrolled automatically when they select a given plan. Because the person is not eligible for the plan until after they select it, OAB will not know that the person is eligible until the participation process is run.
    The only thing I can think is to have a separate life event that triggers at the end of the enrollment period, but I haven't figured how to do that yet. And it still doesn't quite solve the problem completely, as will be the case when enrollments are made after the enrollment period, i.e. corrections.

  • Display of timestamp data as quarter in report

    Hi,
    I am using BO XI R3.1 version and webI rich client and trying to display the output of object scheduleenddate (9/1/2009 12:00:00 AM) as quarter in report. I need the output as Q1,Q2,Q3, Q4. The database am using is sqlserver 2005 and this field scheduleenddate is defined as datetime,null. I would like to change the definition of object in universe so that the output should come as Q1,Q2,Q3.
    I've tried using the following in the select clause of object.
    Case when DATEPART(QQ,Scheduleenddate) =1 Then 'Q1'
    when DATEPART(QQ,Scheduleenddate)=2 Then 'Q2'
    when DATEPART(QQ,Scheduleenddate)=3 Then 'Q3' else 'Q4' end
    have tried in the object definition with the object type as 'date' but it given message as 'The expression type is not compatible with object type' so i changed it to character and then receiving the error message as follows:
    Incompatible data
    There is a incompatibility between the data that has a 'character' type and the object that has a 'Date' type.
    To avoid this incompatibility, your data of the type 'Char' must be presented according to the Date format ''mm/dd/yyyy HH:m:s'', for example, '03/30/2010 10:30:59'.
    Any suggestion. Could anyone please advice or suggest any solution.
    Thanks in advance,
    Eswar

    Hi,
    I've used the following code
    Case when DATEPART(QQ,Scheduleenddate) =1 Then 'Q1'
    when DATEPART(QQ,Scheduleenddate)=2 Then 'Q2'
    when DATEPART(QQ,Scheduleenddate)=3 Then 'Q3' else 'Q4' end
    I changed the data type and it is now working.
    Thanks for your help.
    Eswar

  • Updated workspace data causes document conversion?

    I have some preference data stored in the workspace database which I've recently added to. I've changed the version number and added a schema converter in the .fr file and have noticed that when opening documents saved while the old plug-in was installed they have the  "[Converted]" status and need to be re-saved (using save-as)  I'm assuming that ID is seeing the newer plug-in version ID and running its document conversion routine, but since only the workspace database is modified I wouldn't expect the document would actually need to be marked as converted.
    This is causing some confusion and annoyance among people testing the plug-in, so I'm wondering how others deal with versioning workspace data. Do you just leave the plug-in version alone when making changes to the schema? I've tried that and it seems to work, but I'm not sure how safe it is or if it will cause problems later on. Seems that the best way to handle things might be to just store your preference data as an XML or JSON string and bypass ID's versioning system.

    When you extract the data from the form it is already XML.....or it should be. I do not use ProcessFormSubmission .... there is an easier way - under Common/Form Data Integration there is an Export Data service that will take your form as input and create a document that contains your data as output. You can then use a setValue to change the doc object into an xml object (doc object on right, xml object on left). Once it is xml you will need to see what the format is so either write it out or dump it to the log. Ultimately you want to get down to the forms root node and set that and all of its children to the xfaForm variable. The xfaForm variable is a complex object that has multiple nodes beneath it. Use a setValue service to put the xml you extracted into the xfaForm Var. In the XPath editor you can expand it out and put the xml data under this node:
    xfaFormVar/object/data/xdp/datasets/data
    Now your xfaForm var is ready to go

Maybe you are looking for

  • Windows Storage Server 2008 R2 Essentials connecting with Launchpad on Mac OS 10.9.2

    Note: Note to moderators, I accidentally submitted this to Windows Small Business Server Forums. If someone could move this thread to the appropriate directory would be much appreciated. Hello we have a client which has a Mac OSX 10.9.2 and we are tr

  • Got NullPointerException using plain/text content in the mail.

    Hi, Here is the code sipnet, and i am facing problems, when i use it         InternetAddress[] addressTo = new InternetAddress[tok.countTokens()];         int i=0;         while(tok.hasMoreTokens())             addressTo[i++] = new InternetAddress(to

  • Input predetermined date from column in Numbers

    Hi! I'm trying to calculate my worked hours by inputing Time in in cell C and Time out in cell D, and having Numbers calculate the numbers of worked hours in cell E, by using =Cell D - Cell C and it is working fine. My problem is that Numbers automat

  • Can i change assignment of sales organization/company code?

    Hi, I have sales organizations SO1, SO2 assigned to company code CC1 sales organizations SO3, SO4 assigned to company code CC2 can i change this assignment?, for example: sales organizations SO1, SO2 reassigned to company code CC2 i.e.: before: sales

  • How to create quick query region?

    Hi, How to create quick query region? I have got some tip from OAF developer guild: OAPageLayoutBean pageLayout = pageContext.getPageLayout(); pageLayout.setQuickSearch(quickSearchRN); But I don't know how to create 'quickSearchRN'. So, I try to crea