Derive 0fiscyerar from 0calmonth in a query

Hello all,
We need to build a query which will show three columns: the first two will use calendar month using the value of the entry variable the user will enter. The third one has to show YTD values using 0fiscyear. But the user only wants to enter 0calmonth, so, is there a way to derive 0fiscyear from 0calmonth in a query?
Thanks in advance
Kenya

hi,
to get the YTD value you can use SAP EXIT variable.
for 0FISC YEAR check the variable which sap has provided.
there r variable like >>cumulated upto current month>>.
u check them.
regards
sridhar.v

Similar Messages

  • Month count from 0CALMONTH

    I am trying to get the count of the month from 0CALMONTH using an exit variable. Is this code correct? Thanks.
      WHEN 'ZMONTHCT'.
        IF i_step = 2.
    data: month_num type i.
            LOOP AT I_T_var_range
               INTO loc_var_range WHERE vnam = '0PCALMONTH' or
                                        vnam = 'ZCMONTH2' OR
                             vnam = 'ZCMONTH3' OR
                             vnam = 'ZCMONTH4'.
            month_num = loc_var_range-low+4(2).
            l_S_range-low = month_num.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO E_T_range.
            EXIT.
          ENDLOOP.
        ENDIF.

    sohini,
    Instead of doing all that...
    Take the calmonth variable value - have a formula variable in your query to get the text value of the charactewristic..
    Lets take 022007...
    The internal format would be 022007 use the formula to calculate absolute value of (022007 / 10000) you would get 2 which is what you want - you need not use any exit for this or use the other number functions to get the value that you want when you divide this value by 10000 ...
    Arun
    Assign points if useful

  • Unable to access the data from Data Management Gateway: Query timeout expired

    Hi,
    Since 2-3 days the data refresh is failing on our PowerBI site. I checked below:
    1. The gateway is in running status.
    2. Data source is also in ready status and test connection worked fine too.
    3. Below is the error in System Health -
    Failed to refresh the data source. An internal service error has occurred. Retry the operation at a later time. If the problem persists, contact Microsoft support for further assistance.        
    Error code: 4025
    4. Below is the error in Event Viewer.
    Unable to access the data from Data Management Gateway: Query timeout expired. Please check 1) whether the data source is available 2) whether the gateway on-premises service is running using Windows Event Logs.
    5. This is the correlational id for latest refresh failure
    is
    f9030dd8-af4c-4225-8674-50ce85a770d0
    6.
    Refresh History error is –
    Errors in the high-level relational engine. The following exception occurred while the managed IDataReader interface was being used: The operation has timed out. Errors in the high-level relational engine. The following exception occurred while the
    managed IDataReader interface was being used: Query timeout expired. 
    Any idea what could have went wrong suddenly, everything was working fine from last 1 month.
    Thanks,
    Richa

    Never mind, figured out there was a lock on SQL table which caused all the problems. Once I released the lock it PowerPivot refresh started working fine.
    Thanks.

  • How to get Hierarchical XML File from a Database Join Query !

    Hi,
    How can i get a Hierarchical XML File from a Database Join Query ?
    Any join query returns repeated values as below:
    BD17:SQL>select d.dname, e.ename, e.sal
    2 from dept d
    3 natural join
    4 emp e
    5 /
    DNAME ENAME SAL
    ACCOUNTING CLARK 2450
    ACCOUNTING KING 5000
    ACCOUNTING MILLER 1300
    RESEARCH SMITH 800
    RESEARCH ADAMS 1100
    RESEARCH FORD 3000
    RESEARCH SCOTT 3000
    RESEARCH JONES 2975
    SALES ALLEN 1600
    SALES BLAKE 2850
    SALES MARTIN 1250
    SALES JAMES 950
    SALES TURNER 1500
    SALES WARD 1250
    14 rows selected.
    We tried use DBMS_XMLQUERY to generate a xml file, but it was unable to get xml in Hierarchical format.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <ROWSET>
    - <ROW num="1">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>CLARK</ENAME>
    <SAL>2450</SAL>
    </ROW>
    - <ROW num="2">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>KING</ENAME>
    <SAL>5000</SAL>
    </ROW>
    - <ROW num="3">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>MILLER</ENAME>
    <SAL>1300</SAL>
    </ROW>
    - <ROW num="4">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SMITH</ENAME>
    <SAL>800</SAL>
    </ROW>
    - <ROW num="5">
    <DNAME>RESEARCH</DNAME>
    <ENAME>ADAMS</ENAME>
    <SAL>1100</SAL>
    </ROW>
    - <ROW num="6">
    <DNAME>RESEARCH</DNAME>
    <ENAME>FORD</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="7">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SCOTT</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="8">
    <DNAME>RESEARCH</DNAME>
    <ENAME>JONES</ENAME>
    <SAL>2975</SAL>
    </ROW>
    - <ROW num="9">
    <DNAME>SALES</DNAME>
    <ENAME>ALLEN</ENAME>
    <SAL>1600</SAL>
    </ROW>
    - <ROW num="10">
    <DNAME>SALES</DNAME>
    <ENAME>BLAKE</ENAME>
    <SAL>2850</SAL>
    </ROW>
    - <ROW num="11">
    <DNAME>SALES</DNAME>
    <ENAME>MARTIN</ENAME>
    <SAL>1250</SAL>
    </ROW>
    - <ROW num="12">
    <DNAME>SALES</DNAME>
    <ENAME>JAMES</ENAME>
    <SAL>950</SAL>
    </ROW>
    - <ROW num="13">
    <DNAME>SALES</DNAME>
    <ENAME>TURNER</ENAME>
    <SAL>1500</SAL>
    </ROW>
    - <ROW num="14">
    <DNAME>SALES</DNAME>
    <ENAME>WARD</ENAME>
    <SAL>1250</SAL>
    </ROW>
    </ROWSET>
    Thank you for some help.
    Nelson Alberti

    Hi,
    I wrote a general ABAP program which can be configured to grab contrent from an URL and post that content as a new PI message into the integration adapter .... from that point on normal PI configuration can be used to route it to anywhere ...
    It can be easily scheduled as a background job to grab content on a daily basis etc ...
    Regards,
    Steven

  • Derive YYYYMM from YYYYMMDD with formula variable replacement path

    Dear All
    For deriving month from date I tried the replacement path variable with the offset 0, length 6 (for YYYYMM). But the YYYYMM displayed as a number i.e. 200502 as 200,502. Tried to divided by 100. It still displayed as 2,005.02. Any idea how to let it as 200502?
    Thanks, Jessica
    Message was edited by:
            jessica sheng

    Actually, here's a quick example of a customer exit that I think does what you want (I did it here in this text, so you might need to debug):
            WHEN 'ZDAT_MTH'.
    DATA: l_curdate  like sy-datum.
    *           Initialization
                CLEAR: l_calmonth, l_curdate.
    *           Get calmonth from curdate
                CALL METHOD cl_rsar_function=>date_month
                  EXPORTING
                    i_curdate  = l_curdate
                  IMPORTING
                    e_calmonth = l_calmonth.
    *           Return calendar month
                CLEAR l_s_range.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = l_calmonth .
                APPEND l_s_range TO e_t_range.

  • Using a Procedure in the FROM clause of a query

    Is it possible to use a Procedure that accepts multiple parameters and returns multiple parameters in the FROM section of a query?
    I have a Procedure that formats a postal address from BS7666 format into an Oracle Apps friendly format.
    I'd like to be able to select the data from the source, feed it through this procedure and output it as part of a Materialised View.
    PROCEDURE Format_llpg_Address
    In_Loc IN VARCHAR2,
    In_Description IN VARCHAR2,
    In_County IN VARCHAR2,
    In_Town IN VARCHAR2,
    In_PostTown IN VARCHAR2,
    In_Saon_Start_num IN NUMBER,
    In_Saon_Start_Suffix IN VARCHAR2,
    In_Saon_End_num IN NUMBER,
    In_Saon_End_Suffix IN VARCHAR2,
    In_Saon_Text IN VARCHAR2,
    In_Paon_Start_num IN NUMBER,
    In_Paon_Start_Suffix IN VARCHAR2,
    In_Paon_End_num IN NUMBER,
    In_Paon_End_Suffix IN VARCHAR2,
    In_Paon_Text IN VARCHAR2,
    In_PostCode IN VARCHAR2,
    Out_Address1 OUT NOCOPY VARCHAR2,
    Out_Address2 OUT NOCOPY VARCHAR2,
    Out_Address3 OUT NOCOPY VARCHAR2,
    Out_Town OUT NOCOPY VARCHAR2,
    Out_County OUT NOCOPY VARCHAR2,
    Out_PostCode OUT NOCOPY VARCHAR2)
    Many Thanks,
    Jason.

    You should look at [pipelined functions|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/tuning.htm#i52954]
    Adrian Billington has a number of excellent articles on pipelined functions.
    Here's a [link to one of them|http://www.oracle-developer.net/display.php?id=207]
    Edited by: dombrooks on Oct 12, 2009 4:45 PM

  • Error while deriving currency from table T001P

    Hi All,
    Error while deriving currency from table T001P
    I am getting this error while payroll run by using country GRP=99 in SU2 for Non-SAP supported country.
    I assigned country grouping as 99 in V_T500P table while assigning comp code to personnel area.
    The company code is assigned with BD as country key in configuration and currency as BDT.
    Referring previous links for the same error I checked all concerned tables and maintained correctly.
    What will be the probable reason of this error?

    Hi,
    I had the exact same problem a while back. The problem was that in V_T001 I had a different comp code which was either assigned to the same country  that had a blank currency  or assigned to the same currency but was missing the country. It was a different comp code than the one I was running payroll for so it took a long time to find the cause - I'll bet this is what's causing your error. 
    Rgds,
    Kristopher

  • Can I work with a derived class from u0093ApplicationClassu0094

    Hello, I want to create a derived class from “ApplicationClass” for use in my Application, the problem is the function “SAPbouiCOM.SboGuiApi.GetApplication(-1)”, it return a COM object. If I do a specific cast to my own class (that derive from ApplicationClass), the metod give a COM exception and say that I can’t do a specific cast with a COM object.
    Can I do that cast? And How can I do it?
    I’m programming in C#.
    Thanks.

    I think that you can´t assign an object of the base class
    to an object of the derived class. I don´t know why you need to do that. With more information we could help you

  • Possibility of returning derived type from inherited operator

    Hello forum,
    I am wondering the possibility of returning a derived type from an inherited operator. A test case would include two class definitions such as:
    Public Class Base
    Dim _a
    Public ReadOnly Property A As Integer
    Get
    Return _a
    End Get
    End Property
    Public Shared Operator +(ByVal base1 As Base, _
    ByVal base2 As Base) As Base
    Return New Base(base1.A + base2.A)
    End Operator
    Public Sub New(ByVal a As Integer)
    _a = a
    End Sub
    End Class
    Public Class Derived
    Inherits Base
    Public Sub New(ByVal a As Integer)
    MyBase.New(a)
    End Sub
    End Class
    and implementation such as:
    Dim derivedA As Derived = New Derived(1)
    Dim derivedB As Derived = New Derived(1)
    Dim derivedResult As Derived = derivedA + derivedB
    'would like result as derived, not base!
    This test case returns the error that the derivedResult cannot by cast to the base type (as this is how the operator is defined). I am wondering: is there a way to change the operator definition so that the derived type is returned from the operation? There
    could be many derived types and avoiding overloading the method in each type definition could reduce the amount of code.
    Many thanks.

    I'm just Frank, not "Mr. Smith". ;-)
    I suspect that Reed is onto it with generics. He's quite familiar with it and in a question I posted a few years ago - about derived classes - he answered it using generics.
    Let's see what you or he comes up with. :)
    Still lost in code, just at a little higher level.
    Haha, I was like "who is Mr. Smith.... oh yeah, that's Frank's last name".  ;)
    @James3210:  same here... it's just Reed.  Wearing a shirt with a collar is about as formal as I get.  :)
    Anyway, back to the subject at hand, I think the generic method in conjunction with the operator overload is the way to go.  Since you'll have to write the operator on each class anyway, at least you can copy-paste the operator code and then just change
    the type used for "T":
    Public Class FooBase
    Private anInteger As Integer
    Protected Shared Function Add(Of T As {FooBase, New})(source As T, target As T) As FooBase
    Return New T() With {.anInteger = source.anInteger + target.anInteger}
    End Function
    Public Shared Operator +(source As FooBase, target As FooBase) As FooBase
    Return FooBase.Add(Of FooBase)(source, target)
    End Operator
    End Class
    Public Class DerivedFoo
    Inherits FooBase
    Public Overloads Shared Operator +(source As DerivedFoo, target As DerivedFoo) As DerivedFoo
    Return FooBase.Add(Of DerivedFoo)(source, target)
    End Operator
    End Class
    Public Class DerivedFooTwo
    Inherits FooBase
    Public Overloads Shared Operator +(source As DerivedFooTwo, target As DerivedFooTwo) As DerivedFooTwo
    Return FooBase.Add(Of DerivedFooTwo)(source, target)
    End Operator
    End Class
    In this example the shared Add() method is internal to the FooBase objects, but you could make the access modifier public if you wanted to expose the method for direct use.
    -EDIT-
    Sorry, I forgot you wanted to return the object type from the operator, not the internal result.  I've updated the code to return a new object instance.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

  • Derive segment from business area

    Dear Experts,
    Is there an easy way to derive segment from business area when making GL postings ?
    Thank you for you answer.
    Best Regards,

    Hi,
    To what I know, you'd probably have to write a user exit, as well as maintain a mapping table.  The fact is that segment works almost similarly to business area and hence there is not connection between the 2.
    The closest I can think of is the connection between cost centre and profit centre.  Cost centre contains the business area assignment and profit centre the segment assignment.
    Hope this helps.
    Cheers,
    Gimmo

  • Cannot export Financial Report from HTML view to Query Ready Mode

    Hi,
    I am opening Hyperion Financial Reports in Workspace in HTML mode. On the bottom right of the report, when I click on "Export in Query Ready Mode", the report does not get transported to excel. Rather, a message flashes for a split-second and disappears. The message is "The address is not valid". Can anyone please advise as to what should I do to get the report in excel? I did notice that there is also File->Export->Excel->Fully Formatted Grids & Texts, but we want to get it in Query Ready Mode.
    Version is 11.1.1.3. Thanks for any suggestions.
    ABG

    We have resolved this issue. The problem was that Smart View installation/configuration was not complete on the machine which I used to launch report into Query Ready Mode. Once Smart View was fixed, we were able to convert report from HTML view to Query Ready Mode.
    ABG

  • Find current age from day in mdx query

    Hi,
    I need to find current age.In my cube i have dob attribute.
    so how can  i find current age from day using mdx query.
    Thanks,
    Indu
    indu

    Hi,
    when i ran above query, i am getting days.
    But i need current age in years.
    so i tried with below query, then i am getting value  like 8.99.how can i round off in mdx query?
    in sql i used Floor function for roundoff. in mdx which function should i use?
    With
    MEMBER [DOB] AS DATEDIFF('d',[Ship Date].[Date].CurrentMember.Name,Now())/365.25
    Select {[DOB]}
    on columns ,
    NON
    EMPTY {[Ship Date].[Date].[Date]}
    ON ROWS From [Adventure Works]
    indu

  • Security Issue: How to create a derived role from the Base role

    Hi All,
    Kindly let me know how can i create a derived role from the base role?
    Please respond at the earliest.
    Thanks in advance.
    Ramesh.

    Go to PFCG and Create a role with desired Name.
    In the Description Tab, on the Left Side there is a text box for "Derive From "
    enter the Base role.
    Now your newly created role is derived from the Base role.
    Save the newly created role and again run PFCG, enter the Base role name and execute.Select Edit role. Go to Authorization tab.
    Edit Authorization.
    In the Menu Adjust Derived -> Generate and Adjust derive
    This will Generate the derived role.
    Now you may go and check the authorization in the derived role.

  • How to get second maximum salary from employee table(sql query)

    how to get second maximum salary from employee table(sql query)

    dude there is no matter of structure .........that user already said its from employee table ...............its basic table in sql and there is no need to specify the table structure
    .........i think u got my point I think you are the one who didn't understand Sarma's point.
    Give a man a fish and you feed him once. Teach a man how to fish and you feed him a life long.
    >
    and the query is
    select max(sal) from emp where sal<(select max(sal)
    from emp);
    this will give the 2nd max salary from the emp tableBtw: You solution is bad, because it needs to scan and sort the table emp twice. And a better solution has been given already.
    Message was edited by:
    Sven W. - reordered statements

  • How to pass parameters from html to xacute query

    hi experts,
    I need to pass a variable from  html to xacute query.i need the correct syntax for that .
    Thanks in advance.
    lokesh

    Hi Lokesh,
    I apologize if my message came off sounding rude - passing parameters to queries is fundamental to xMI, one of the basic concepts.  I only meant that if you haven't had xMII training, you could benefit greatly
    Kind Regards,
    Diana Hoppe

Maybe you are looking for

  • APPLE ID SYNC ISSUE

    I just synced my new IPhone to my daughter's computer, yet when I now try to download for example, SKYPE from my iphone, there is a pop-up that shows up and it continues to ask me for my daughter's APPLE ID using her gmail account. I updated my APPLE

  • Mailbox sending emails from another address?

    I don't think this is in the right category however I couldn't work out which forum to put it under. Basically I have several accounts in my mailbox. I recently deleted one of them as I don't want to use that email address anymore, however, emails ar

  • Cluster Tables and Open SQL

    Hi, I am planning to replace several transparent tables with cluster tables. And this also implies that I have to read from cluster tables. One of the reason, I did not do this is until now is, that at the moment I  am heavily relying on the possibil

  • How do i redeem a 10.00 gift... when i click redeem i am prompted to download itunes... i already have itunes...how do i get the code... or get past the download

    omg how many times do i have to ask the question...., i am trying to redeem a gift of 10.00.. when i click on redeem it wants me to download itunes... i already have itunes.... how do i get the code.... when it gets this complicated to ask a question

  • Unwanted iTunes startup

    After the last update, my iTunes starts up when I plug in either my iPhone and iPad. After quitting it, it also starts up again when I REMOVE my iPhone or iPad. I already have "Open itunes when this iPhone/iPad is connected" disabled. How do I stop t