Variable to store a result of a complex calculation in bex query

Hello all,
I've got a query in BEX with some key fields to display and also need to perform some calculations not supported in bex formulas.
I think this could be made in a BEX user exit and I'm trying this by creating a project in CMOD assigning EXIT_SAPLRR0_001... Working with INCLUDE ZXRSRU01 and so on.
I just want to know if this is possible this way because I execute my query and the variable created never get any value at runtime.
Could anybody help me or give an idea on how to use BEx user-exits?
Thank you very much,
Carlos Hinestrosa.

Hi!
  I think it should work .here are some links to help topics on using user exits.
presentations
https://websmp206.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700005475091999E
Help:
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
propably they might help you
With regards
Ashwin

Similar Messages

  • Incorrect result between maintain master data and bex query, how can i fix?

    Hi ALL,
    i get some messages from the users there is incorrect result between SAP R/3 and Report on BW. i controlled the monitor and i saw there was a job for 0CUSTOMER_ATTRIBUTE that it finish correctly but the processing it was only in PSA, i started the full update immediately from PSA into Data Targets and is finished correctly. after when i control the content of the 0CUSTOMER (right click maintain master data) i get the correct attribute result that match the data in SAP R/3, but the problem is when i execute a query Bex on this master data it will not return the same attributes data.
    Can SomeBody Help please
    Bilal

    hi,
    For any master data attributes loaded you will have to run "Attributes Change Run" for that.Execute for Master data 0CUSTOMER.
    The same is avilable in rsa1->Tools(top menu)->apply hierarchy/attribute run.
    hope it helps,
    regards,
    Parth.

  • How to define variable for value range in Bex Query?

    Hi
    How to define variable for Keyfig. value range on runtime like characteristic in Bex Query?
    Example: On runtime user select one of the following condition:
    1)User want to those records where amount is greater than $1000
    2)User want to those records where amount is greater than $1000 and less than $5000
    3)User want to those records where amount is greater than and equal to $1000

    Hi ,
    Need to Use exceptions & conditions for this scenario's  & need to create variable for exceptions based on condtions.
    Below document provides steps how to make selections at run time for a kfg.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60b33a28-dca2-2d10-f3b2-d2096b460b1e?QuickLink=index&overridelayout=true&48842368468641
    Regards,
    Seshu.P

  • Setup variables for BEx Query

    Dear all,
    I am working on a BEx query. I would like to show MTD and YTD actual & planned expenses. My questions are as follows:
    (1)      how can I set up variables or variants which can look up the system date to calculate the MTD and YTD date? For example, I execute the query without input the date and I would like the query automatically look up the date for YTD  (e.g. 1/1/2009 u2013 2/20/2009) and MTD (2/1/2009 u2013 2/20/2009) for actual expenses?
    (2)     Since the planned data is by year and distribute 12 months equally and not by day, how can I set up variables which can look up the system date to calculate the number of the days from the beginning of the year up to today and beginning of the month update to today so I can calculate the MTD and YTD planned expenses based on the annual budget.
    Thanks

    Thanks Reddy,
    Since my variable for planned data is not date variable anymore, it is a factor = current date / number of days in current month and I used this to multiple by the planned monthly data.  If I used entire month and  the plan data will be overvalue, I can't compare to the MTD actual data since actual date is updated by day.  How can I create a variable for this and use it to caluclate in the BEx Query?
    I believe the function will work but I don't know much about ABAP.  I try to search sample code for the function.  here is what I get but I don't think it is going to work. Can you point out what is missing? I believe I need to put it under 'ZXRSAU01'
    Under CASE I_DATASOURCE
    I put
    WHEN 'ZMTDFACTOR'. #the variable name of the MTD factor
    PERFORM ZMTDFACTOR_EXIT.
    In ZMTDFACTOR_EXIT  and here is the code I get so far
    WHEN 'ZMTDFACOTR'.
        DATA:  SDT TYPE SY-DATUM,
              MON_FACTOR TYPE N,
              ST_CD(2) TYPE N,   
              ST_LD(2) TYPE N.     
                l_date_in  type sy-datum,
                l_date_out type sy-datum.
              SDT = SY-DATUM.
    *current date
              ST_CD = SDT+6(2).
    CONCATENATE l_v_calmonth '01' into l_t_range-low.
    l_date_in = l_t_range-low.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        day_in                  = l_date_in
    IMPORTING
       LAST_DAY_OF_MONTH       = l_date_out
    EXCEPTIONS
       DAY_IN_NOT_VALID        = 1.
    *last date
    ST_LD = l_date_out+6(2).
    *Calculate the factor based on the MTD
    MON_FACTOR = ST_CD / ST_LD.
    How can I send MON_FACTOR to ZMTDFACOTR and back to the query?
    Thanks again.

  • Can i store the Result set values as a Session variable

    hai,
    I want the result set values of a query to be used many times and I want the same resultset between different page calls.
    I want all those records fetched from the database to be available in the next page with out refetching from the database.
    can any one help me out. its very urgent.....
    Thanks and regards,
    Ravikiran
    mail to me at : [email protected]

    "can i store the Result set values as a Session variable "
    Practically Yes u can
    but u want be able to accesses it in other pages
    u can try it and see
    the other thing u can do is store the values from the resultset in a object say vector and put vector in seesion and u can use this any where
    for e.g
    Vector v=new Vector();
    While(rs.next())
    v.addElement(rs.getString(1));
    v.addElement(rs.getString(2));
    session.putValue("myVector",v);
    now where u want to get it do this
    Vector myvec=(Vector)session.getValue("myVector");
    do do futher

  • How to store the result with a time are using?

    Hi,
    I'm using the adobe captivate 5.5 to create the Visual Aid Project.
    What i want to ask in captivate 5.5 is :
    Q1. How to record and store the time are using in each slide. ( Record down how long need to take by user to complete one slide)
    Q2. How to create the file above (Q1), and save it in computer. ( For review purpose)
    The purpose for this project is record down how long(time) are need to complete for each Slide. Besides, this project will store the result in computer hardisk and for review purpose.
    Example :
    Slide
    Time Used (in sec)
    Slide 1
    10 sec
    Slide 2
    5 sec
    Slide 3
    20 sec
    Slide 4
    5 sec
    Slide 5
    30 sec
    Total Time
    70 sec
    Thanks,
    Regards,
    Shen

    Hello,
    It is possible to store the time in user variables. How to export those variables depends on the deployment of the file.
    Some information about showing elapsed time can perhaps give you a start:
    Display Time Information
    Lilybiri

  • Any default variable in PS holding result of a console command (for when I too often forget to say '$myVar =' before MyLongRunningCmd) ?

    At the PS prompt, I issued the following command:
    Get-ChildItem \\Somename\shared\folder\folder  -Recurse
    Is Powershell storing my (object) result in some default temp variable (even though the result was ultimately pipelined to the screen)  when I forget to store the result in a var?
    or
    am I out of luck and must do this:
    $myvar = Get-ChildItem \\Somename\shared\folder\folder  -Recurse
    thus, re issuing the same command again although I did realise, after waiting quite a bit of time, that I forgot to store the result ?
    Am using V 2.0

    Hi,
    AFAIK, you're out of luck and need to run the command again.
    Hopefully someone else chimes in with something I don't know about though.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • SQL Query - store the result for optimization?

    Good day experts,
    I am looking for advice on a report. I did a lot of analytic functions to get core data that I need to make my report and its takes around 50 min for SQL to complete. Now with this data I need to create 3 different reports and I cant use the same SQL since there is a lot of agregation (example would be group by product in one case and by client in 2nd). For each of those different group bys I need a different report.
    So how to create 3 reports from 1 SQL query without running the query 3 times?
    First thing that comes to mind is to store the result set into a dummy table and then query the table since the core data I get is around 300 rows and then do different group bys.
    Best regards,
    Igor

    So how to create 3 reports from 1 SQL query without running the query 3 times?
    You already know the obvious answer - store the data 'somewhere'.
    The appropriate 'somewhere' depends on your actual business requirements and you did not provide ALL of them.
    MV - if the query is always the same you could use an MV and do a complete refresh when you want new data. The data is permanent and can be queried by other sessions but the query that accesses the data will be frozen into the MV definition.
    GTT (global temp table) - if a NEW data load AND the three reports will ALWAYS be executed by a single session and then the data is NOT needed anymore then a GTT can work. The query that loads the GTT can be different for each run but the data will only be available for a single session and ONLY for the life of that session. So if anything goes wrong and the session terminates the data is gone.
    First thing that comes to mind is to store the result set into a dummy table and then query the table since the core data I get is around 300 rows and then do different group bys.
    That is commonly referred to as a 'REPORT-READY table'. Those are useful when the data needs to be permanent and available to multiple sessions/users. Typically there is a batch process (e.g. package procedure) that periodically refreshes/updates the data during an outage window. Or the table can have a column (e.g. AS_OF) that lets it contain multiple sets of data and the update process leaves existing data alone and creates a new set of data.
    If your core data is around 300 rows you may want to consider a report-ready table and even using it to contain multiple sets of data. Then the reports can be written to query the data using an AS_OF value that rolls up and returns the proper data. You don't need an outage window since older data is always available (but can be deleted when you no longer need it.
    If you only need one set of data you could use a partitioned work table (with only one partition) to gather the new set of data and then an EXCHANGE PARTITION to 'swap' in the new data. That 'exchange' only takes a fraction of a second and avoids an outage window. Once the swap is done any user query will get the new data.

  • How to insert delay without using loops, and how can I use variable to store data in labview

    Hi all,
    I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
    I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
    I have one more question, I know its a bad practice to post 2 questions in 1 thread.
    How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
    Thanks in advance.

    Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
    Try to take over the world!

  • Working with multiple results of a complex query

    Hi all!
    As I "advance" in learning PL/SQL with oracle, I now get stuck in handling multiple results of a complex query. As far as I know, I cannot use a cursor here, as there is no table where the cursor could point to.
    Here is the concept of what I want to do (pseudocode):
    foreach result in SELECT * FROM table_1, table_n WHERE key_1 = foreign_key_in_n;
        -- do someting with the resultHere is my attemt, that freezes the browser gui and throws an internal database error:
    declare
        type t_stock is record(
                baggage_id  baggage.baggage_id%type,
                section_id  sections.section_id%type,
                shelf_id    shelves.shelf_id%type
        v_stock t_stock;
        rcnt number(2);
    begin
    dbms_output.put_line(TO_CHAR(rcnt));
    loop
         SELECT COUNT(*) INTO rcnt FROM (
                   SELECT baggage.baggage_id, sections.section_id, shelves.shelf_id
                   FROM baggage, sections, shelves
                   WHERE baggage.baggage_id = sections.contained_baggage_id
                        AND shelves.is_connex_to_section_id = sections.section_id);
         IF rcnt <= 0 THEN
              exit;
         END IF;
         SELECT baggage.baggage_id, sections.section_id, shelves.shelf_id INTO v_stock
         FROM baggage, sections, shelves
         WHERE baggage.baggage_id = sections.contained_baggage_id
              AND shelves.is_connex_to_section_id = sections.section_id
              AND ROWNUM < 2;
         UPDATE sections SET contained_baggage_id = NULL WHERE section_id = v_stock.baggage_id;
         commit; -- do I need that?
    end loop;
    END;
    /So, is there a way to traverse a list of results from a complex query? Maybe without creating a temporary table (or is that the better way?).
    regards, Alex
    I reformatted the code
    pktm

    Ok, here are the details:
    The tables are used to model kind of a transport system. There are terminals connected with sections that may contain 1 piece of baggage. The baggage is moved by a procedure through a transport system. After each of these "moving steps", I check if the baggage is in front of the shelf it should be in.
    [To be honest, the give statement doesn't contain the info, in which shelf the baggage wil bee inserted. That was spared out because of the lack of a working piece of code :)]
    But: if we consider the fact, that a baggage is in front of such a shelf in the way, that it should be put in this shelf, then all this makes some sense.
    - move baggae through a transport system
    - see if you can put baggage into a shelf
    In order to "put baggage in a shelf", I need to remove it from the transport section. As the transport system is not normalized, I need to update the section where the baggage was in.
    Uhm... yes it's a task that doesn't make too much sense. It seems to be some kind of general spirit in university homework :)
    But: the FOR r IN (Statement) lloks good. I'll use that.
    And, the ROWNUM < 2 is used to limit the size of the result to 1, there is no need to have a specific ordering. It's just because - afaik - oracle doesn't have a limit clause. I would appreciate your help if you know a better way to do limit resultsets.
    best regards, Alex

  • UDF -Golobal variables to store the data

    Hi,
    We are sending order information to source system (SAP).
    Here i need to chk in message mapping : if it is the
    first time we received that order into SAP or not.
    As per the expert suggestion its better to use global variable and store the order no and compare it the next time it comes.
    Let me know the UDF code.
    Thanks
    MMV

    HI,
    Refer below blog
    /people/miguel.jorge/blog/2006/10/10/interesting-use-of-global-variables
    Here you can maintain the Global variable and then in 1st mapping assign the value for it as had shown in UDF code in blog and then innext mapping check the value of global variable.
    BUT...as per your suggestion I doubt how you will maintain multiple order information in Global variables.
    Better to go for Either DB / RFC Lookup here you can maintain the table and can check from it whether the Order information is previously send or not
    For db/rfc lukup refer to:
    Lookup’s in XI made simpler : DB lukup
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    RFC Mapping Lookups
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    Thanks
    Swarup

  • How do I create variables and store them?

    How do I create variables and store them?

    As someone already said, we need to know a little more about what you want to do with these variables, but in general, APEX Items are probably what you want. You can create APEX Items at the Application or Page level. Once you set the value of an item, you can reference it anywhere else in the application. So, if you have an item on page 1 called P1_ENAME, you can reference it on page 32 using bind variable syntax :P1_ENAME. If you just want to store but not display some information, you can use either a hidden page item or an Application Level item. Take a look at the 2 Day Developers Guide for more info.
    Tyler

  • Results based on From and To value in Bex query designer.

    Dear all,
    We are using BI7.00. In one of our report which pertains to PM user wants to get the details of number of breakdowns which falls in the value range 0 to 1 hours.
    I created a condition which has 2 variables, one is From value and the other is for the To value (since user wants to enter both the limits). I have written a condition that if the breakdown hour is greater than or equal to variable1 and less than or equal to variable2.
    Using the above condition if the query is run, i am not getting the desired output. The values avaialble in the report are 0.65,0.78,1.30,7.38,0 etc., when i give 0 to 1 i should get the values 0.65,0.78 and 0 but instead report displays "No valid results".
    I changed the condition and selected "Between" variable 1 and variable 2 - yet no change in the query.
    To my knowledge i foresee that system is not able to recognize the decimal and hence provides details only based on the whole numbers.
    How to get my requirement achieved in the Bex query designer.
    Experts suggestion with steps will be very useful to solve my problem.
    Regards,
    M.M
    Edited by: Magesh Magesh on Dec 26, 2008 11:28 AM

    Hi Magesh,
    I think you could try one more way.
    Create a formula inserting your two formula variables for limits .(FV -  are ready for input ) .
    The formula would return the result as 1 or 0 because it would have boolean condition in it.
    You could then place a condition in the query designer to only show all records where the value of the formula key fig is 1.
    You formula A would look like
    ( KF > FV1) AND (KF < FV2) * 1.
    And in the condition put A EQ 1.
    You could scale the key figures as well and multiply the limits mentioned by the users in FV1 and FV2 if decimals are still not recognized by SAP.(scaling)
    Regards,
    Sunmit.

  • SAP BO WebI Report on top of BI Bex Query with Authorization Variable

    Hi,
         We are trying to restrict row level data using BI 7.0 analysis authorization concept. We have an authorization variable in the Bex query and is working perfect in Bex Analyzer as well as in RSRT.
    Now we are trying to achieve the same thing in BO webI. We created an Universe using Authentication Mode SSO. We are on BOXI 3.1 and implemented SSO. When we try to run the query in WebI we get the error
       "A database error occured. The database error text is: Error in MDDataSetBW.GetCellData..(WS 10901)"
    Just for testing purpose, when we use query filter in WebI and use Values from List, it is showing only the authorized value it supposed to show and runs well with that value selected. But we have to achieve this without the query filter in WebI.
    So are we missing some thing here or any patch issue? Please share if you have done this type of reports in BO.
    Thanks in advance for your help.
    Moorthy.

    Yes I did run MDXTEST and it gives error as 'you do not have sufficient authorization'. The reason it is giving, I guess and we are debugging that to confirm, is first it looks for 0BI_ALL and throws error which is not the case in Bex. See the following trace in RSRT trace.
    InfoObject Properties Defined
    Reading of Directly Assigned Authorizations
    Direct Assignment Does Not Include Universal Authorization 0BI_ALL
    Reading the Indirect Assignments with Authorization Object S_RS_AUTH
    Does user have OBI_ALL?
    No, the User Does Not Have Universal Authorizion 0BI_ALL
    Negative Entry in SU53 Result of Failed Check for 0BI_ALL
    Indirect assignments found; no universal authorization
    Reduction of Authorization Dimensions on Characteristics in InfoProvider
    Reduction Successful
    Thanks!
    Moorthy

  • BEx query design: defining complex filters?

    Is it possible to define complex filters in a query definition? By complex I mean using logical operators (AND, OR, NOT)
    Example: report giving sales results
    I want to have
    (Customers from Germany <b> AND </b> product type A)
    <b> OR </b>
    (Customers from Romania <b> AND </b> product type B)
    If I define a standard filter:
    Customer country IN (DE,RO)
    Product type IN (A,B)
    I will obtain all combinations while I only want to have the couples {(DE,A),(RO,B)}.
    Thxs.
    LauQ

    Hide is just to remove the "object" from the display. It is used as an intermediate filter for the object that includes the logical combinations that one would like to get in the results.
    In my example:
    In the Query Designer:
    1. Define a structure (rows)
    2. right-click on it and make new selections corresponding with
    a) Country=Germany (:='DE')
    b) Country=Romania (:='RO')
    c) Material=A
    d) Material=B
    3. Right-click on each of them and "hide" them
    4. New formula in the structure:
    TEST:=(( 'DE' AND 'A' ) OR ( 'RO' AND 'B' ) )
    5. You need to edit the Cell definition and make use of the Help Cells (select therein the KF you need to display; e.g. "QUANTITY SOLD").
    6. "Play" with Cell definition and define a final KF such as:
    FINAL:='QUANTITY SOLD' * 'HELP'
    You need to try by yourself...
    Regards
    LauQ

Maybe you are looking for