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.

Similar Messages

  • How to edit the properties for existing variables in BEX query, so that I can get multiple input selections

    Dear fellow developers,
    I'm trying to edit an existing variable using BEX query, so that it can allow multiple input selections.
    As you can see in the screenshot attached, the option is selectable during creation.
    However, during editing of an existing field, this field (Details -> Basic Settings -> Variable Represents) is not selectable.
    Does anyone knows why, and how to remedy this?

    Yes you can do it at the table level.
    Go to SE11 enter table name as RSZGLOBV.
    Enter the technical name of variable in VNAM field..You need to change the value in VPARSEL column.
    Please make sure to get the where used list of this variable so that you can know the impact,if something goes wrong.
    Also change it in DEV and then transport across the landscape.
    PS:Same thing has been described in this blog as well
    Changing BI variable parameters
    Regards,
    AL
    Message was edited by: Anshu Lilhori

  • How to create variables in Bex query

    Hi all,
    can anyone please explain how to create the variables and how many types of variables in Bex Query.
    Thanks in advance
    James

    Hi James,
    You can create variables in the BEx Query by right clicking on your characteristic and then selecting Restrict. A pop up window will appear. On the left side of the pop-up window, right click on a white space and then select New Variable. The Variable Wizard will then appear - you can now create your variable acording to your specifications. For more info on variables, please click on the link below:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/61/579b3c494d8e15e10000000a114084/content.htm
    Hope this helps,
    Juice

  • To create variants for Bex query

    Hi Guys,
    where and how do we create variants for Bex query.
    Thanks,
    Your help is appreciated.

    Hi Sheo,
    There are several threads about this, check here:
    /thread/297437 [original link is broken]
    Hope this helps...

  • Customized variable for Bex

    Hi Gurus;
    I am using BI 7.0. My client wants a customized variable for 0CALMONTH with 2 dialog boxes in the selection screen saying "From month" and "To Month". When you input months, say; 06.2008 in "From Month" and 08.2008 in "To Month", the output which will come is data from all the months between 06.2008 and 08.2008. The 2 dialog boxes are important in this screen. I know. it can be done through interval option in BI 7.0, but the dialog boxes doesn't appear in the first screen of the Selection Screen (Like in 3.x).Is there a way to fulfill my client's requirement? Please provide me a step - by - step guide if possible.
    Regards;
    Sumanta

    Sumanta,
       Could you please clarify
    1 ] whether you are using BEx Analyser or Web queires to execute the report? Does your query has only the custom variable as it selection parmeter?
    2] Is your Custom variable(with Interval) for 0CALMONTH is defined as mandatory / optinal ?
      If you are using Web queries and you variable is defined as optional, then there is setting that you need to do on the web template that you are using.
    Choose you web template on the properties tab> Choose Web Template parameters>under the behaviour section ,choose check box for Display variable, as the default is off. This means that if you have Custom variables that are optional on you BI query will not be display as selection screen.
    Hope this help,
    Cheers,
    Balaji

  • Refreshing Hierarchy node variable in BEx query with change in hierarchy

    Hi all,
    We have used a hierarchy node variable on Characteristic ZECCSAC (user-defined) and used it in a BEx query with default value set to a particular node value. Upto this, it is working fine.
    The hierarchy used in the query, with the hierarchy node variable, was later changed ( and in future it can undergo changes ). Since the number of records in the hierarchy are changing, the nodenames of the hierarchy nodes are changing. But the hier node variable default value is still set to the earlier nodename for that node description. So at runtime it is giving an error "ECCS Account Number is invalid"!
    Can anyone suggest how to refresh a hierarchy node variable default value each time a query is run so that the latest nodename is always taken ?
    Quick reply will be appreciated.
    Thanks

    Hi,
    You get this with User exits.
    Thnaks

  • Displaying dates as column headers for BEx Query

    Hi all,
    I have to display dates in sequence as descriptions for 15 columns based on the keyed in date in Bex Query Analyser. I'm able to display date as column heading for one column using text variable with replacement path.I could not able to increment date for other descriptions.Could you please help me to solve this issue.
    Ex: Input Date 05/09/2007 then in the out put column headers should be 0509 0609    0709   ............ 1909
    These are only column headers, values for the columns are quantities calculated using formulas.
    It is urgent.
    Thanks in advance.
    Regards,
    Mandadi.

    hi mandadi,
    if u want dates as headers only then u should use a text variable .
    as a rule u can not set off set for text variable so u create restricted key figure with date restricted and set off set.
    now u use this rkf to populate the text variable using replacement path.
    text variable can use replacement path for replacing from any variable and characteristics.
    bye

  • Variables from BEx Query through Universe - separated by data provider

    Hi,
    I have a universe that is being used multiple times within a WEBI report, however, I'd like to select the BEx Queries' variables that come through as prompts separated by query. (multiple queries, multiple prompts; one for each)
    For example, I have variables that come through for Exchange Rate type, and I'd like to select query 1 as Exchange Rate Type A, and select query 2 as Exchange Rate type B.  At present, the prompting only offers me one input for all data providers that is the same.
    A similar functionality exists within BEx Analyzer that is a workbook setting, does something like this exist on WEBI or in the Designer?
    Thanks in advance!

    I am not sure if anything like what you ask exists.
    In such cases I create the prompts in WEBI that gives me control to define the prompts separately for each query.
    Edited by: Mathangi Kuppusamy on Sep 1, 2011 2:59 AM

  • How to create Text Variables in BEx Query Designer

    How  can i create Text Variables in Bex Q.D.
    I am able to create characteristic variables
    but i can't find option to create text variables.
    What's the requirement to create Text variables in Bex Q.D.
    When i try to create Text variable for 0calDay.. the variable type is characteristic by Default and disabled.
    How can i create text variables related to 0CalDay with which i need to work in Customer Exit.

    Hi,
    You have to create characteristic variable processing by Customer Exit by considering 0CalDay as a Reference Characteristic
    After creation of the above variable, you restrict your KF with the above created variable.
    Now you can create a Text variable for the description of your KF. This way it works...........
    Regards,
    Suman

  • Short dump in report generation for bex query

    Hi,
    I have e newly installed SAP NetWeaver 7.3 and I'm not able to run BEx-Queries. When I start transaction RSRT and try to generate the report for the selected bex query, I get the following short dump:
    Category               ABAP Programming Error
    Runtime Errors         RAISE_EXCEPTION
    ABAP Program           SAPLRRSI
    Application Component  BW-BEX-OT
    If I start the test in RSRV for that query I get:
    Generation limits for the generated report
    Unable to load report GPEM3XZBL2Y9VX9H6SN
    Am I missing a profile parameter for that generartion limits or something else?
    Thanks in advance!

    Hi,
    Check whether your SAP GUI is activated and installed correctly.
    check following threads
    Runtime error RAISE_EXCEPTION has occurred
    Dump when activating Business Content 7.35
    Thanks and regards
    Kiran

  • Problem with customer exit variable in BeX Query

    Hi All,
    We have created a customer exit variable in a query and populated with few patterns in customer exit.
    My query has to bring all the records where the address line is containg the patterns passed through customer exit. Here the query is not working as expected.
    It is bringing the values where the address line is exactly same as the pattern and not bringing the records where the pattern is part of the address line.
    For example: Pattern passed in customer exit = 'HOSPITAL'
    The record where address line = 'HOSPITAL' is shown in the rpeort, where the record with address line = 'HOSPITAL ROAD' is not shown in the report.
    I would appreciate your help on this.
    Regards,
    Rakesh

    Hi Diogo,
    Below is the code I am using in the customer exit.
    SELECT * FROM zae_tt_pbuild INTO TABLE gt_pbuild.
          IF sy-subrc = 0.
            LOOP AT gt_pbuild INTO gs_pbuild.
              CONCATENATE '*' gs_pbuild-pbuild '*' into lv_pattern.
              ls_range-low = lv_pattern.
              ls_range-sign = lc_sign_i.
              ls_range-opt = 'CP'.
              APPEND ls_range TO e_t_range.
              CLEAR: ls_range,
                     lv_pattern.
            ENDLOOP.
          ENDIF.
         ENDIF.
    I have tried using '%' instead of '*' aswell but the result is same.
    Thanks,
    Rakesh

  • Best Practice for BEX Query "PUBLISH to ROLE"?

    Hello.
    We are trying to determine the best practice for publishing BEX queries/views/workbooks to ROLEs. 
    To be clear of the process I am referring: from the BEX Query Designer, there is an option QUERY>PUBLISH>TO ROLE.  This function updates the user menu of the selected security role with essentially a shortcut to the BEX query.  It is also possible to save VIEWS/WORKBOOKS to a role from the BEX Analyzer menu.  We have found ROLE menus to be a good way to organize BEX queries/views/workbooks for our users. 
    Our dilemma is whether to publish to the role in our DEV system and transport to PROD,... or if it is ok to publish to the role directly in the PROD system.
    Publishing in DEV is not always possible, as we have objects in PROD that do not exist in DEV. For example, we allow power users to create queries directly in PROD.  We also allow VIEWS and WORKBOOKS to be created directly in PROD.  It would not be possible to publish types of objects in DEV. 
    Publishing in PROD eliminates the issues above, but causes concerns for our SECURITY team.  We would be able to maintain these special roles directly in PROD.
    Would appreciate any ideas, suggestions, examples of how others are handling this BEX publish-to-role process.
    Thank you.
    -Joel

    Hi Joel,
    Again as per the Best Practices.Nothing to be created in PRD,even if we create them in PRD for Power users its assumed as temprory and can be deleted at any time.
    So if there are already deviations then you can go for deviations in this case as well but it wont be the Best Practice.Also in few cases we have workbooks created in PRD as they cud nt be created in DEV due to various reasons...in such cases we did not think of Best Practice ,we had a raised an OSS on this aswell.
    In our Project,we have done everything in DEV and transported to PRD,in case there were any very Minor changes at query level we have done in PRD and immedialtely replicated the same in DEV so that they are in SYNC.
    rgds
    SVU

  • Value from a formula variable into text variable in BEx Query

    Hello,
    if anyone knows how I can do the following please let me know:
    I have a formula variable in a formula (ZUM_KVAL). The value will be entered before execution of the query.
    Now I would ALSO like to display the entered value (from ZUM_KVAL) as at text variable (ZUM_KTXT) in the name of the field in the query/report.
    If anyone could provide me with info about how to do that, I'd appreciate very much.
    Thanks in advance.
    Cu, Stefan

    Hi Shashank,
        You can achieve this by creating a customer exit variable for calendar month.
    Function module :
    READ TABLE i_t_var_range WITH KEY vnam = 'Date variable name ' INTO loc_var_range.
       IF sy-subrc = 0.
        year = loc_var_range-low(4).
        month = loc_var_range-low+4(2).
         CLEAR l_s_range.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         CONCATENATE year month INTO l_s_range-low.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    Hope this will help you. Let me know if you have any questions.
    Regards
    Suvarna

  • User Entry for BEx query

    Hi Gurus,
    When I run a standard Business Content query, I could see a dialog box popping up for the user to enter the values. This looks like a mandatory field. How do I modify this? Is there a code which I could do the modification, as to me it seems to be an SAP exit variable?
    Any help would be hugely appreciated.

    Hi,
    When we use variables in a query a pop-up appears at runtime. If we want to modify it, ie., if you want to delete this
    see for which field it's asking to enter the value, in Query -> Global definition -> go to that field, expand it, you can find a variable on that field, you can delete that variable or go to the left side panel and double click on the variable under the same field and modify it, under DETAILS change 'Variable Entery is' to optional from Mandatory.
    To create a variable right click on the field and create a 'New Variable'

  • How we create system for Bex query

    Hi
    I want to access Bex query in VC , I think we can do this by creating system in poratl. pls tell me how we  create system in prtal for this.
    Regards
    Amit

    Hi Naresh,
    Pls send the Document for me also.
    This is my mail id: [email protected]
    Thanks & Regards
    Prakash T

Maybe you are looking for

  • Connecting to a database inside a JAR?

    Hi, Can I do the following: Connect to flatfile database inside the same jar as my program? i.e., would something along the lines of: jdbc:jar://db.txt work? And if so, what would be the correct way to do it, other than my horrible example above. If

  • Dynamic Text in Apple Pages

    I know that it's possible to create Placeholder Text. However I'm looking for dynamic text. I frequently deal with documents where I need to update 30 fields with the same information. Rather than going 30 times and replacing the Placeholder Texts wi

  • Prevent to make PO/PR for In-house items

    Can we prevent making PO/PR for In-house items?? As per my understanding SAP Should not allow preparation of PR/PO. Because GL Configuration of for Valuation class for Purchase Domestic & In-house items is different & costing of method also is differ

  • How do I move my very first album off of the organization screen?

    I am NEW to Photoshop Elements 8.  I am computer literate, but this has me stumped. I read the book several times, and watched some of the tutorial videos and didn't get any help there. I made a 51 picture album "Mimi".  It is on the organization scr

  • ASMLib donwload for rhel6 (2.6.32-358.el6.x86_64 #1)

    Hi All, I have OS version - Red Hat Enterprise Linux Server release 6.4 and kernel is 2.6.32-358.el6.x86_64 #1. I want to install ASMLib for rhel6 but when I searched for ASLMib download then it showing upto Red Hat Enterprise Linux 5 AS. Can any one