Variable for calender month in BEX Query

Hi all ,
I am new to BI .
Can any one please guide on how to create a month year variable that I can get calculated from a date..
For Example
if billing date is 01.02.2009 then my variable should have 02.2009 in Query   .
Regards,
Shashank

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

Similar Messages

  • 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

  • LOV custom sorting in prompts for calender month

    Hello Everyone,
    I want to do sorting in prompts in webi for Calender Month in the form (Jan,Feb,Mar....)
    Whereas, it comes alphabetically As (Apr,Aug and so on....) i want to know that can we find the solution for the same.
    I also want to know if yes can we do it in webi itself or we will have to do it on Information Design Tool?

    Hi Foram. I, too, am using HANA as my backend. Here's one way you can sort your data-driven prompts that appear in Web Intelligence:
    Open your business layer within the Information Design Tool.
    Verify that the column to be displayed in the Webi prompt (e.g., "Month") has been defined in your business layer.
    Select the "Parameters and Lists of Values" button.
    In the "List of Values" frame, press the down arrow and then select "List of values based on business layer objects".
    Give the the list an intuitive name; e.g., "Month LOV".
    On the Definition tab, press the "Edit Query..." button.
    Drag the column to be displayed in the Webi prompt (e.g, "Month") to the Result Objects frame.
    Press the "Sort dialog..." button.
    In the Sort dialog box, press the "Insert Sort Object" button.
    Select the column to sort on; e.g., "Month" and then press the OK button.
    Verify the sort type; e.g., "Ascending".
    Press the OK button.
    Press the Preview button to confirm the results.
    Save and publish the universe to your repository.
    Open your Webi report.
    Enter into Design mode.
    Open the Query Panel.
    Select the appropriate query.
    In the Query Filters frame, select the prompt (e.g., "Month") and press the "Show prompt properties" button.
    In the Prompt Properties dialog box, in the Prompt Properties frame, make sure "Prompt with List of Values" is selected.
    Press the OK button.
    Press the Close button.
    Press the Refresh button.
    Confirm that the prompt (e.g., "Month") is sorted properly.
    Hope this helps!
    Chris

  • How to create a text variable for Calender Yr/Month depending on the prompt for calendar year

    Hi everyone
    Please assist on this issue:
    i have created a Bex report that has an offset for 12 months from the current calender month, i tried to use text variables to replace the calender months but i just learned now text variables from Bex dont work in BO, so I would like to create a prompt in BO to enter Calendar Year and then based on the input(Calender Year) the Webi report must display a 12 months for that Year.
    Please also indicate where exactly  i have to click in order to get that "Helpful icon "  when the my issues have been resolved, because i searched it and havent seen it anywhere on the communications
    Thanks in Advance
    Ole

    Hi Gill
    In BO I recieve my all months for existing data  and when i create a prompt for Calender Year the months in the report still has those text varibale for exampl if i enter 2011 on the prompt the text remains for the year that was already there wen i created my text variable... so its not dynamic.....
    So if i have text variables in Bex it will display like this in Webi in which it wont change if i put in 2011 as input for the prompt...

  • How to use one Bex Variable for two purposes in one query?

    Hi,
    I want to prompt for a UOM in a query. Then I want to use that one UOM variable to do 2 tasks in the query:
    1. Perform a UOM conversion on one restricted key figure (no filtering)
    2. Filter in a second restricted key figure (no conversion)
    How would I use a variable (or two?) to do this? I do not want to have 2 UOM prompts.
    Thanks!
    Gregg

    Oh, it all seems so easy now!  Hindsight 20-20...
    Solution was to create a new input ready variable for Unit.
    1. Restrict the key figures which need restricting using new variable
    2. For conversions, in BI backend us T-code RSUOM and create new conversion type associated with new variable. Then for each key figure needing conversion, set the conversion parameter to use the new conversion type.
    Between both 1 & 2 above, the same variable is used & thus prompted only once.
    Solution works perfectly.... as it should. Hope this helps someone else!

  • $300 /month for 4 conecutive months in BEx Query Designer

    Hello.
    Iu2019ve a business requirement to monitor customer spending habit.
    The report should display all customers who have spent more then $300 per month for 4 months consecutively.
    Please help
    Thanks in advance

    Hi Khaja,
    Thanks for your quick response.
    I've Customer and Calendar Year/Month in Rows and Amount in column. Created a condition for Amount > $300.
    What I want is; whenever user runs the report; the report should show only those customers who have spend more then $300 per month for last 4 months consecutively.
    My report would display:
    Customer No.   Calendar Year/Month    Amount
    What do you mean by RKF's and how would I create these?
    Thanks

  • Selection variable for next month in RFPERIOD_OPEN in closing cockpit

    Hi,
    we would like to use RFPERIOD_OPEN in the closing cockpit in order to open the next period on D-10 automatically. I would like to use the selection variables of the closing cockpit in the program variant in order to avoid unnecessary variant maintenance every month.
    Unfortunately I cannot find a variable for the next month. There is only SAP_FAST_CLOSE_PERIOD_P. Do you know if it is possible to base a calculation logic to derive the next period from SAP_FAST_CLOSE_PERIOD_P.
    Thanks!
    Kind regards,
    Mariya

    Thanks! I checked it, but the appearance of months and order is okay in T247.
    Any other ideas?
    I thought I read somewhere that this is a bug but can´t remember where I found that bug hint.

  • Count and Percentile calculations for various Lines in BEx Query.

    Dear Experts
    I working on a BEx Query at the moment and the output is required in the format below:
    This and another report (which will be displayed above this report) will go into a WAD eventually.
    I have Key Figure for 'Document Count' but not sure how to get the percentage displayed in the second line and also for the Top 3 Reason Codes (not having anything displayed across 'Top 3 Reason Codes' though). I have tried Selection and other ways but nothing worked so far.
    Do I have to use Cell Editing by any chance or is there a way to work-around this.
    Thanks in advance for your help.
    Kind regards,
    Chandu

    You can achieve your report format by creating a Structure in rows with Cell definitions. Define each cell in COunt Document KF according to the row logic.

  • Variable with proposed value in BEX Query View

    Dear SAP-Gurus,
    I have a Web Application with some views on one query. In the inital screen i show the popup for entering the global variable values. Now my question; is it possible to give a global variable used filled by exit and used in these queries a proposed value, receeived by user exit?
    With normal query this works, but not with a query view.
    any suggestions?
    kind regards.
    Jürgen

    Hi,
    if anyone has the same problem - you just have to set the parameter variables_clear=x in webtemplate.
    same applies to bookmarks, if you want the variables to be filled by your exit.
    regards
    Jürgen

  • Substitution variable for multiple months

    Ideally, i would like to have a calc script with a substitution variable FIX(&Month) which points to specified months. I have tried setting the value for my substitution variable in different ways
    1.
    Variable = Month
    Value = "January""February"
    2.
    Variable = Month
    Value = "January","February"
    However, the script seems to be failing to pick up the second month as it returns no values for February. If i specify the months in the calc script, it works just fine. This suggests to me i'm getting the syntax wrong for the substitution variable.
    Any ideas?

    There is nothing strange it can behave. It will work.
    I am using this in production for years to genarate comma seperated scenario list with out any issues.
    What a substitution variable will do?
    It will store a string as a value for the variable and resolve at the time of calc. if the value is a valid member set it will work.
    I believe issue is not because of that.
    However, the script seems to be failing to pick up the second month as it returns no values for FebruaryIs it throwing any error in syntax check or in executing. Answer is No from the above statement. But you are not seeing the expected results in the calc.
    first check the application log whether the calc is happening for both jan and feb.
    Then why the calc is not as of expected for feb.

  • User Prompt for Date Range in Bex Query Analyzer

    I have a workbook that has two queries. The queries both require the user to enter a date range upon refresh. I want the user to be able to hit refresh, enter the date input into the dialog box and then both queries to use this date range for their input. I have seen this in other book, but when I click refresh on my book it only runs the first query. How do I get the second query to use the first queries input?

    use the same variable in both the queries. this will let the user enter the date in a single variable and this will refresh both the queries.
    rgds, Ghuru

  • Rolling month for webi report using Univ based on BEX Query

    Dear Experts,
    I'm new to OLAP universes.
    We have a requirements of having last 12 months rolling  for given measure(Key figure) in webi report using Univ based on Bex Query.
    We require a calmonth (time dimension) object  (restricted for last 12 months) where user can drag and drop on column section of cross-tab table.  User should drag more than one Key figure ( for ex. sales rev and & qty sold) for each month
    Could you please provide me the solution to do this?
    Thanks
    Akshara

    Hi Henry,
    Thank  you for your response.
    BEx query has not been created yet. we need to create accordingly and require your help in creating the same.
    Regarding reporting requirements,  User wants to have adhoc reporting  with rolling months ( 12 months or 6 months) functionality. Users want to link any KF to this rolling months dimension.
    If we can't have this, what is the alternative that we can propose to user.
    Thanks
    Akshara.

  • User Exit Variable for Infoprovider based on month characterstic in query

    Hi,
    I am financial reporting with reports created on a mulit-provider over a plan & Actual cube.  Along the top of the report is a structure which has amongst other restricitions a column for each month, i.e columns 1 to 12. 
    Currently we are in month 9, so the report should show data from the Actual infoprovider for months 1 to 9, but data from the plan infoproviders for 10 to 12.  My question is how should the variable be coded for the infoprovider which will return a value based on the month characteristic in each columns selection.  I understand how I can look at say the current system date, derive the month and return the plan/actual value for the correct infoprovider based on the current month.  But I need to create a variable which will look at the month value which is in each column selection in the query itself.
    Many thanks,
    Richard

    we recently had this kind of reporting requirement. only difference being week instead of month.
    you need to create 12 variables for actual month columns and 12 for budget.
    now you will write a code to address all the variables. in following format :-
    when var1.         "suppose var1 represents month 1 of actual columns
    1. derive month from date.
    2. if month <= i_vnam+3(1)                         "get the number from var and compare
                  set the  variable value as the month number of that year for e.g
                  concatenate year i_vnam+3(1)      into        l_s_range-low       
        else
                  set the variable value way back in past which will not have any data.
    above logic will cause values in following fashion
    if this month is 3 and year is 2008
    var1 = 200801
    var2 = 200802
    var3 = 200803
    var4 = 199001
    var5 = 199001
    etc.
    In the query all columns will be set with the property = hide if not values are present. so if 199001 is set in the variable then it will be collapsed.
    same way logic for variables in budget column can be written which will set all the month variables which are less than
    current month to 199001 (just in reverse fashion of above mentioned logic.)

  • Sort the values in Bex query variable screen

    Dear Experts,
    Is it possible to sort the values of a dropdown list for variables on BEX variable selection screen ? 
    For example, For calender month selection, the values are by default sorted by ascending order.
    Is it possible to sort by descending order ? 
    Regards,
    ravindra

    Hi Ravindra,
    yeah it is possible by writing an abap code for the field calmonth/week...etc this is depends on the F4 help of the selection field. so you need to write a code for F4 help for making it in descending order. hope it helps.
    Thanks,
    Vachan

  • Best practice for multiple instances of the same BEX query

    Hi there,
    I'm wondering what's the best way to use multiple instances of the same BEX query. Let me explain what I mean:
    I have a dashboard with different queries feeding different period of time such as: week to date, month to date and so on. One query for each since it is based on a user exit.
    For each query I want to show different data in different sections of my dashboard. Per example: sales per directors or sales per customer group, sales per day, sales per week and the like.I tried to connect a simple bar chart via a direct connection but with no success due to the multiple lines generated by the addition of the sales director, customer group, week number and so on.
    My question is about the way to connect the different queries efficiently in order to show the different data while avoiding multiple useless lines.
    The image above shows the query browser where, per example, for a Month to date query there will be mutiple line for each week as well as one line for each director. If, for two different components, I want to show data per week and data per director or other representation what is the best practice:
    Add another instance of the same query and only put the week information and another one will only the director info?
    Should I bind those to the excel file and use formulas to make final calculations?
    Will there be a performance issues for adding different instances of the same query
    I have 6 different queries (read 6 user exit that filters time via user exit).
    Depending on the best practices there might be 4 instances for each for a total of 24 instances in the query browser.
    I hope my question is clear enough, if not please do not hesitate I'll clarify as much as possible.
    Regards,
    Steve

    Hi Steve,
    Might be trying for solution for a long time, If i understood your question clear let me clarify you few points.
    You are trying to access the bex query which is designed with the exit's in the background based on the logic and trying to call the entire dimensions and key-figures in a single connection. Then you are trying to map those data in the charts.
    Steve, try to make more connections based upon the logic and split them. use the same query but split them by sales per customer group, sales per day, sales per week by making three different connections and try. You can merge the prompts from all connections.
    Hope this Helps!!!
    Sorry if i misunderstood your question.
    --SumanT

Maybe you are looking for