Sap query designer (calculation of profit N-1 from an input year N entered by a user)

hi,
on the query designer i have a variable where the user fills in the year N, and In the query i need to calculate a profit of a year N-1 according to a year N entered by the user.
here is my code abap in exit function where CA_N_1 is my variable BEX customer exit, and YEARN_1 is the variable bex that takes the year entered by a user :
DATA: LS_T_VAR_RANGE like rrrangeexit,
LV_CALYEAR type T009B-BDATJ,
LV_FISCYEAR type T009B-BDATJ.
WHEN 'CA_N_1'.
IF i_step = 2.
READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
WITH KEY vnam = 'YEARN_1'.
LV_CALYEAR = LS_T_VAR_RANGE-low.
LV_CALYEAR = LV_CALYEAR - 1.
l_s_range-low = LV_CALYEAR .
l_s_range-opt = 'EQ'.
l_s_range-sign = 'I'.
APPEND l_s_range TO e_t_range.
ENDIF.
a copy of how i defined my variables and my ratio profit_N-1 is attached, when I compile the code with in input 2013 for example I can see that my variable Yearn-1 takes 2012 at the end, but in the query my ratio ^ profit_N-1 doesn't bring anything.
Please help me i can't find where is the problem...
Thank you for your help.

Hello !
Thks for your quick reply,
I'm from France sorry for my bed english but i hope u're understanding me, I'm new consultant in BW and like u know woman are not very comfartable with IT so i'm going to ask u 2 others questions about hierarchy and saving query in roles if u don't mind
1) I want to change some hierarchy node position in production system, do i change directly in rsh1 by adding a node to another level ? or i must to change in a file source or ECC system ? if i change just on rsh1, i will lost all i have changed when Info package will be executed (in daily process chain)...? that's right?
2) I have a query already published in rôle, but i have to move it to another one, how can i do that in query designer please?
PS : i can't send you direct message, is it possible to follow me ?
Thks in advance have a nice day !

Similar Messages

  • Incorrect texts in SAP Query Designer

    Hello,
    I have problems with incorrect text in SAP Query designer, I work with SAP codepage 1404 and I see all queries correct, but when I want to edit some query with some special character for czech language its problem. Query designer can=t use czech diacritic.
    Can you give some advice.
    Thanks
    :Petr

    Hello !
    Thks for your quick reply,
    I'm from France sorry for my bed english but i hope u're understanding me, I'm new consultant in BW and like u know woman are not very comfartable with IT so i'm going to ask u 2 others questions about hierarchy and saving query in roles if u don't mind
    1) I want to change some hierarchy node position in production system, do i change directly in rsh1 by adding a node to another level ? or i must to change in a file source or ECC system ? if i change just on rsh1, i will lost all i have changed when Info package will be executed (in daily process chain)...? that's right?
    2) I have a query already published in rôle, but i have to move it to another one, how can i do that in query designer please?
    PS : i can't send you direct message, is it possible to follow me ?
    Thks in advance have a nice day !

  • SAP Query designer going away???

    Can someone confirm for me whether or not the query designer is going away to be replaced by WebI/Pioneer?
    Thx,
    nv

    Hi Vincent,
    Please find the below links .... for more information:
    /people/kuhan.milroy/blog/2008/03/11/introduction-to-business-objects-suite-of-technologies
    /people/luc.boodts/blog/2008/09/05/enhance-your-sap-bi-landscape-with-business-objects--part-i
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/bi/business%252bobjects%252b-%252bquery%252bmore%252bthan%252bone%252bdatasource
    /people/community.user/blog/2008/04/28/connecting-business-objects-and-sap
    Regards,
    Ravi kanth

  • SAP Query Designer

    Hi Experts,
    Please Explain me what are Prerequisites for query prepration through SQ01.
    Please give me detail idea.
    Thanks and Regards
    Naveen Chawla

    Hi
    Use this the following link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c
    Regards
    Venkat

  • Design Question: Creating One Object Type From Multiple Inputs

    Hi,
    I'm attempting to expand my brain a bit and come up with a more elegant solution to a design I created a few years ago. In simple terms, I have a data object (Request) which can be created based on data in a text file or from data previously persisted in a database record using the Request object and associated DAO. Typically, the text file is initiating a "new" Request object to be persisted, and reading from the database is done to update or view previously submitted Request objects. Note that I have no ability to change the original input method of the text file.
    In my original design I basically lumped everything into the Request class using multiple constructors which made for a messy jumble and a very long class. Different parsing routines were needed when data was read from the file vs. reading it from the database. I was considering refactoring the code to use a factory class but this doesn't seem to follow the typical Abstract Factory or Factory Method design patterns. In my design I keep ending up with something like:
    public class RequestFactory {
        public Request createRequestFromFile(File file) {...build up the request object...}
        public Request createRequestFromDbRecord(int recordId) {...build up the request object...}
    }And I would change the constructor in my Request class to private and remove all of the parsing and construction methods.
    Now, I can definitely make this work but I'm not sure I'm really doing much except taking the creation garbage (there's a lot of parsing of multiple-value fields that needs to be done) out of the actual Request class. So my question is basically, do I have a better approach I'm not seeing or is this type of factory "appropriate"? I mean, would someone come along later and look at my code and think I was crazy? I'm still trying to wrap my head around some ways to use factories in my own projects so I'm probably not thinking clearly.
    Thanks!
    Pablo

    Thanks for the feedback. About your suggestions on dealing with the different loading methods, I think that's where I keep getting disconnected, at least as far as using an abstract factory is concerned.
    Extending your example code a bit using option one, I would guess I end up with something like this:
    public interface RequestFactory {
      Request createRequest(RequestSource source) throws RequestCreationException;
    public class DatabaseRequestFactory implements RequestFactory {
      public Request createRequest(RequestSource source) throws RequestCreationException {
        // do some stuff
    }The part I can't figure out is how to define the RequestSource (or RequestId in your example). It would seem that if I'm going to define member variables in RequestSource like SourceFile or RecordId it would be just as correct to skip the interface and just use two concrete classes like this:
    public class FileRequestFactory {
      Request createRequest(File file) throws RequestCreationException {
        // process file and create request
    public class DatabaseRequestFactory {
      public Request createRequest(int recordId) throws RequestCreationException {
        // load record and create request
    }I guess where I keep stumbling is a) the value of the interface and b) if I do use an interface, how to have a generic object passed to createRequest() that can refer to either a file location or a record ID. This concept is pretty clear when the creation requirements for each concrete factory are the same, but when the construction uses such disparate data sources for creation I can't seem to wrap my head around the differences.
    Your third suggestion is probably the easiest for me to understand but it seems like it would be a bit contrived. In the end it may make the most sense if I am going to go with that type of approach since I still don't really understand how to implement the first two options.
    Thanks again for your input.
    Pablo
    Edited by: Pablo_Vadear on Dec 15, 2009 6:11 AM

  • SSO with Query Designer

    Hi all,
    I need to add a link to SAP Query Designer in Portal that will launch Query Designer using SSO.
    We have SSO with R/3 and with BI already implemented (the user will click on the link and launch SAP GUI without having to type username/password), but we don't know how to do that for Query Designer.
    Can anyone help us? Is there any documentation on the subject that we didn't find?
    Thanks,
    Daniel

    Apparently there needs to be some kind of certificate to add.
    Anyone know anything about this?

  • Difference Beetween Query Designer and Adhoc Query Designer

    Hello!
    can any one explain me what exactly is Adhoc query designer and how is it different from  Bex Query designer. can you please provide me links for Adhoc query designer (not to Bex query designer)
    with regards
    ashwin

    Hi Ashwin,
    See this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/1f/03223c5f00612be10000000a11402f/content.htm
    Basically the Adhoc query designer is a web item that you can include in a web template to allow the user to create or change queries in the web environment. It has some limitations like you cannot use variables, and can only use one structure.
    Hope this helps...

  • How to write ABAP Logic in SAP Query to fetch records from many Tables

    Hi Expert,
    I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
    List of tables as below:
    EQST: Equipment to BOM Link
    TPST: Link Between Functional Location and BOM
    MAST: Material to BOM Link
    STPO:BOM item
    Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
    I have done so far is as follows:
    I create User Group, Infoset and SAP Query.
    While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
    STPO-STLNR ---> EQST-STLNR : Left Outer Join
    STPO-STLNR ---> TPST-STLNR : Left Outer Join
    STPO-STLNR ---> MAST-STLNR : Left Outer Join
    Now its showing all BOM from all plants though I enter one Plant value.
    Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
    Thanks,
    Jay.
    Edited by: jaykrishna007 on Jul 29, 2011 11:41 AM

    Hi FCannavo,
    Thanks for your quick reply.
    See, now I changed my Infoset design.
    I added one Plant Table (T001W) and then
    T001W-WERKS--->EQST-WERKS
    T001W-WERKS--->MAST-WERKS
    T001W-WERKS--->TPST-WERKS
    and then
    EQST-STLNR--->STPO-STLNR
    MAST-STLNR--->STPO-STLNR
    TPST-STLNR--->STPO-STLNR
    on selection screen, user will enter Plant Value.
    Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
    Thanks,
    Jay.

  • Query Designer - Rows between Columns

    Dear all,
    I've got the following requirement and I really cannot figure out if it is doable.
    I would appreciate your help.
    I shall create a query using Sap Query Designer regarding the actual and budet data of the assets (it's a financial report).
    I'll have 2 columns for the actual data and 2 columns for the budget data.
    Is there any way:
    a) to have the assets (the rows) in the middle of the report layout, and
    b) the actual data on the left side of the assets, and
    c) the budget data on the right side of the assets
    The goal is when drilling down the assets, both pairs of columns to be expanded as well.
    Is it doable? Is there any trick?
    Thanks in advance.

    Dear Riyez
    I do thank you for your response.
    I am wondering if there is something someone could possibly do on the Query Designer side in order to fool the system.
    For instance, to design a virtual structure (I do not know how - I am thinking loudly) which would be identical to the structure that holds the assets?
    In other words, is it designeable to have a row structure, then the column key figures and, finally, another row structure identical to the first one? And when the user expands the first structure, the second structure will follow accordingly?
    Or such a solution is out of question?

  • Doubt on Rows and Coloums in BEx Query Designer.

    Hello, Experts.
    I have a Doubt in BEx Query Designer.
    In the Rows I have a Fiscal year Period,  if the user enters the Fiscal year period for e.g. : 001/2006  .  
    in the columns i have  forecast for the Fiscal year period which user entered ( 001/2006 ),   and we have another column pervious ( Prior )fiscal year period ( 001/2005 ). 
    My Questions is ,  as we are Restricting with 001/2006 will the query retrieve the values of 2005 or not?
    Thanks in Advance .
    Sharp

    yes i am  Doing Offest.
    I moved this Fiscal year Period to Free char,   and i Restricted with Pervious Fical Year period and Fical year period .  it worked.  but
    when i kept this in Rows and deleted Previous Fiscal Year period .  it is displaying blanks.   in prior years forecast.
    is it because i am Ristricting it to only fical year period  which user entered
             Colums-->  Forcast ( User Entered year )          Prior year
    Rows
    Fiscal year period
      Fiscal year period( user enterd )
    Thanks

  • Sap query & reporting

    Hi,
    Any book that can be suggested for report writer/report painter & query reporting.. that contains almost all for reporting without programming..
    Thanks in advance...
    Vipin Arora..

    Hello Vipin,
    Sap Query
    The SAP Query application is used to create reports not already contained in the default.
    The SAP Query comprises five components: Queries, InfoSet Query, InfoSets, User Groups and Translation/Query.
    Please refer:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    A query can be created to extract information from master records i.e Infotypes.
    <u>Creation of new query:</u>
    1. T.Code SQ03 - Select Environment – Select Standard Area - Enter -- If new user group is to be created, enter name of the user group, click on create and enter necessary information and exit after saving
    2. T.Code SQ02 - Enter name of the Infoset – Create – enter name of Infoset
    3. T.Code SQ03 - Select user group
    Infoset - Enter name of newly created Infoset
    Assign users and Infosets - Assign infosets
    After creating a query use SQ01 & run.
    <u></u>

  • Attribute not visible in Query Designer

    hi BI Gurus,
    I could not see some InfoObjects(Attributes) which are marked Authorization Relevant, in the query designer. And the strange thing is, they are not visible even for the user with SAP_ALL and 0BI_ALL assigned. The authorizations for the  cube in which the main char is used looks fine.
    I have checked all the options in RSECADMIN, everything looks good.
    pls help me in finding the solution..
    thanks
    Cnu..

    check out with the info object screen in attribute tab, navigational attribute on/0f switch box, if u r using FF source system.
    check out with the infocube whether u r checked the check boxes in navigational attribute tab.
    regards
    harikrishna.N

  • Number Format in Query Designer

    Hi,
    I have changed the properties of key figure to 6 decimal places from 2 decimals in the Infoobject Properties.But in Query designer it is still displayed as (from key figure 0.00).
    As i have mentioned 6 decimal places in the key figure , why it is still displayed as 2 decimal places in the Query Designer.
    regards,
    Anita

    Hi Pradip,
    I have selected as  "from Key figure 0.00" in Query Designer.In key figure properties I have changed the data type to Fltp & in additional propertied I have set it to 6 decimal places.
    Now when i execute the Queries still it is showing me only 2 decimal places instead of 6.
    if i set it manually to 6 its working fine.but i dont want to do this , as i need to change it more then 100 queries.
    Regards,
    Anita

  • Defining Query with SAP Query

    HI All,
    1..While creating an SAP Query, I have selected the field groups, then fields, selected basic list, entered the sequence, etc and then also enetered alternate text for control level. When i execute the report, the error message displayed is 'no data selected'. How can i rectify this issue?
    2. I would also like to add the field 'Deductions' under field group 'Payroll Results'.
    Thanks and Regards,
    AM_BLR

    Using the messaging service in the b1 i achieve this
    SAPbobsCOM.CompanyService oCmpSrv;
    MessagesService oMessageService;
    Message oMessage;
    MessageDataColumns pMessageDataColumns;
    MessageDataColumn pMessageDataColumn;
    MessageDataLines oLines;
    MessageDataLine oLine;
    RecipientCollection oRecipientCollection;
    oCmpSrv = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
    oMessageService = (MessagesService)oCmpSrv.GetBusinessService(ServiceTypes.MessagesService);
    oMessage = (Message)oMessageService.GetDataInterface(MessagesServiceDataInterfaces.msdiMessage);
    oMessage.Subject = "My Subject";
    oMessage.Text = "My Text";
    oRecipientCollection = oMessage.RecipientCollection;
    oRecipientCollection.Add();
    oRecipientCollection.Item(0).SendInternal = BoYesNoEnum.tYES;
    oRecipientCollection.Item(0).UserCode = "test";
    pMessageDataColumns = oMessage.MessageDataColumns;
    pMessageDataColumn = pMessageDataColumns.Add();
    pMessageDataColumn.ColumnName = "My Column Name";
    oLines = pMessageDataColumn.MessageDataLines;
    oLine = oLines.Add();
    oLine.Value = "My Value";
    oMessageService.SendMessage(oMessage);

  • Combine two reports in query designer using key figure with sap exit

    Hi experts,
    i want to combine two reports in query designer using key figure with sap exit
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi Dirk,
    you perhaps know my requirement,
    for the management to make used in one report,
    we have in reporting finacials Ehp3.
    Vendor Due Date Analysis - which show due, not due
    Vendor Overdue Analysis - show only due and analysis in time grid frame
    i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
    krish...

Maybe you are looking for