How to create a variable in Bex Query Designer

Hi guys,
I am writing a query for a travel management report using the SAP Standard cube. I would like to restrict the query so it only shows me the last two months excluding the current month. I have checked BI content in RSA1, but I canu2019t find a relevant SAP standard variable that I can use.
Can anyone please tell me if I can create my own? And if so, how I can do this.
Many Thanks
Forhad.

lets say u want to display following picture:
sept$-----august$
City
-chicago123$--
44$
so in Query designer go to Default values section.
Bring in Calendar month
right click calendar month
and hit Restrict
now select variable
use standard sap variable Current Month.
hit okey
now select Variable and hit Red button
Result u restricted current month.
in columns bring in keyfigure $
right click and hit edit
bring in time field calendar month
right click and hit restrict
bring in Current month
right click and select - SET OFFSET FOR VARIABLE
select -1
hit okey
repeat the above process
and this time select offset = -2
this way u restricted current month
but displayed last 2 months for keyfigure values.

Similar Messages

  • 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

  • How to create a variable in BEx 7.0

    Hi,
    Can anyone please tell me how to create a variable in BEx 7.0
    In 3.5, when we right click on a characteristic, we used to get an option for restrict.
    I cant find any such option in 7.0

    Hi,
    Right click on the characteristic 0CALMONTH in the default values or drag it to char. restriction section and say restrict.Pull the drop down menu in that to select variables. There u will get a create icon.Click on that...then in details tab u can specify whether mandatory,interval and all..
    Regards,
    Rathy

  • How to write a condition in BEX Query Designer

    Hi
    How can i write a condition in Query Designer
    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    But i char assigment of a condition i find 4 option
    How can i achieve this
    Thanks

    Hi Aurun,
    Thanks for the help,Really appreciated
    As this is my first enhancement using ABAP & CMOD
    What type of key (either Access or developer ) do i require to perform the following  enhancement......so that i can raise request with basis team
    I shall be great ful if u can asnwer below question
    First, you need to create a variable for expiry date with processing type as customer exit, and then give the necessary info.
    In details tab, unchk ready for input as we wont be taking the value from the prompt.
    Now go to CMOD transaction.
    Open the correcsponding project which has the exit code
    (How can i identify the project which has exit code)
    and go to ZXRSRU001 module inside taht.
    Go to the module where u write the exit.
    (How to locate the required module)
    Then, under i step 1, write the code:
    IF I_STEP = 1.
    CASE V_NAME  (What is 'V_NAME',Is it my variable technical name)
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

  • How can i achieve tis in Bex Query Designer

    Hi Experts,
    Please advise on how can i achieve this in Query.
    I got Location,Material_ID,Price and Change_Date.
    (Change_Date is defined as both CHAR & KF in cube)
    (Change date is on monthly basis they execute a programe in non sap source system to update the prices of material)
    The Price of material tends to change or may not change ...
    Every month we get a record from source system on material price
    My requirment is to bulid a report that show
    LocationMaterial_IDCurrent Price  and Previous Price
    Please advise how can i develop this report

    While loading into cube, normally you map  price field coming from datasaource to
    infobject  ZPRICE_CURRENT   in your infocube.
    So in transformation you map like this
    price  -
    > ZPRICE_CURRENT
    Now, Maintain another keyfigure in cube  ZPRICE_PREVIOUS.
    That is not mapped with anything.But is assigned a value in the Start routine
    which just runs before, the transformation.
    In the start routine write code something like this :
    Read current value of price from cube for that Material.
    (Select  ZPRICE_CURRENT into price_curr  from cube where material = DATA-PACKAGE- Material   )
    if  DATA_PACKAGE-price <> price_curr   ( if new_price <> old_price)
    ZPRICE_PREVIOUS = price_curr. (storign present value of price in the cube )
    endif.
    Now save the Start routine. When mapping the fields in the transformation
    dont map anythign to  ZPRICE_PREVIOUS as it is already filled in teh start routine from the above  code.Leave it unmapped.
    The below mapping is normally maintained without change..
    price  -
    > ZPRICE_CURRENT
    If you find this to be useful ..please do the needful (points)

  • How to display 0 Percentage in BEx Query Designer

    The BEx queries which I'm doing are ported to EP & client views all charts & data in portal only.
    I have a small requirement. My client requires to display 0% in the data output.
    Sample data is like
    Mon/Grade     A | B | C | D | E | F             " These are headings
    April                |     |    | 3  | 5 | 4 |  |           " These are data I got in BEx
    Required O/p
    Mon/Grade     A | B | C | D | E | F                  " These are headings
    April                |   0  | 0   | 3  | 5 | 4 | 0 |           " These are data I got in BEx
    My current formula is like
    > NODIV0( ( TEST1 * 12) %A TEST2 )
    What changes must I make so that 0% is displayed in the O/p? Please let me know earliest.
    P.S . The values TEST1 and TEST2 are 'Selections', which holds no data for those displaying values.

    Hi Kavitha,
    The problem  is I'm viewing the data in Web based BEX & not in BEX Analyser. So only.
    >            GROUP E GROUP D2 GROUP D1 GROUP C2
    >APR              6.0      46.0
    >MAY %           14.3      48.0      11.4      16.9
    >JUN %             11.6      16.2
    As you can see there's no data for the months-grade (Apr-GroupD1 etc).. Now, how to view it in portal with 0s for all the ones with no data?

  • How to filter hierarchy node in BEX query designer

    Dear experts
    We are working on FI balance sheet with hierarchy infoobject 0GLACCEXT. Example of our balance sheet is as follow:
    Parent Node A = 20
         Sub-parent Node A1 = 10
             Leaf A11 = 5
                 Leaf A12 = 5
    Parent Node B = 20
         Sub-parent Node B1 = 10
                   Leaf B11 = 5
                   Leaf B12 = 5
    We require only:
        Sub-parent Node A1 = 10
        Leaf B12 = 5
    So I filter those out in BEX restriction;  however, after we examine the report in tcode RSRT, "Sub-parent Node A1" is not shown in BEX Report, and the result is as follow:
    Parent Node B = 5
         Sub-parent Node B1 = 5
                 Leaf B12 = 5
    Are there solutions for us to show merely A1 and B12 ?

    Hi Chu
    Try the following steps.
    Initial Output
    In this example I will restrict the query for only displaying Node 8603 and leaf 9000
    Proceed to restrict the Characteristic. Please be aware of the difference between hierarchy nodes and leaf characteristic values. Also set the Hierarchy display properties to expand up to level 1.
    Execute the query again:
    Please be aware that users will still be able to expand node 8603 and see the lower level nodes/leaf. In order to restrict users from doing this set up users authorizations.
    Regards,
    Carlos

  • 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

  • Creating Restrictions in BEx query designer for (1-a), where a is variable.

    Dear All,
    >>  Suppose for the variable in the BEx query designer, I've created restriction for 0FISCPER to the variable 0P_PER (as 0P_PER-1) by right clicking 0P_PER3, from that a dialog box appears.  In that I've selected 0P_PER3 and then clicked on offset variable and when I set the offset variable, it works for (0P_PER-1.etc, 0P_PER+1,etc..)
    But if I want to have (1-0P_PER), then plz tell me how to define this restriction?
    Plz explain me the steps to perform (1-0P_PER) restriction in BEx query designer in BW1.
    I'm using SAP BI 7.2 gui.
    Expecting your reply soon,
    with Regards,
    Jerald

    My requirement is that I want to have " 1-fiscal year"., But this I could not define using offset variables, since using offset we can define "fiscal year +1" or "fiscal year -1". 
    So there would be some other way to define "1-fiscalyear".  So Please help me to define "1-fiscalyear"  by giving me the steps.
    Thank you,
    with Regards,
    Jerald

  • 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 selection variables on the KF

    Hi,
        i need to create a variable on the CKF and the user is going to give the selections like >90% or <100%  in the variable screen before runing the report.on the report should show the values based on the selection.
    1.how to create the variables on the CKF.
    2. how to restrict the values and give the selections(like >90%,<100%) values in the selections.

    Hi Venkat,
    You can achieve this by the following way:
    1. Create a CKF or a local formula(based on which queries it needs to be used)
    2. Then go to BEX Query Designer -> View -> Conditions
    3. Create New Condition -> select 'New' -> Select your CKF/Local Formula -> Define your Operator ( BT, GT, LT, Top % etc.) -> Create a Formula variable (Ready for input with Processing type as ;manual Input')
    4. DO the char. assignement for the condition with your condition definition
    4. Execute the report with your values.
    This will solve your prob.
    Cheers,
    VA

  • How to create a transport request with query and only with its structure.

    HI guru,
                how to create a transport request with query and only with its structure.transport request should not  include any other query items like ( variables, conditions...etc)
    thanks in advance.
    venkata

    Hi,
    Goto RSA1 and then Transport Connection -> In SAP Transports select Object Types-> Query Elements -> Then select Query->Give Technical name of the query and then select for transfer. In the right side you can choose the components which you wanted to transport.
    Regards,
    anil

  • Created Webi report using BEx Query.

    Hi All,
    I am going to upgrade in BW and using BEx  & Webi Report. I have created webi report using BEx query. Now I need to test data in webi report.
    Can anyone tell me how to test data?
    Regards,

    Hi,
    compare the webi report data with Bex report. more you can compare webi report with SAP R3 system for random records.
    Thanks,
    Amit

  • HOW TO CREATE A VARIABLE IN SAP SCRIPT

    HI ALL,
    CAN ANYONE TELL ME HOW TO CREATE A VARIABLE IN SAP SCRIPT.
    THANK YOU,
    BYE
    TAKE CARE.

    Hi Ravi,
    You can use like this
    A text in the editor contains the following DEFINE commands:
    /: DEFINE &mysymbol& = 'xxx xxx xxxxx xxxx'
    &mysymbol&
    /: DEFINE &mysymbol& = 'yyyyy yyy yyyy'
    / &mysymbol&
    The printed text appears

  • Is it possible to create a variable in bex with the last work day?

    Hi Gurus
    Is it possible to create a variable in bex with the last work day?
    Actually end-user every day open queries,
        - Put in selection date day - 1 or
        - put last Friday if the day is Monday or
        - put last Thursday if the day is Monday and Friday is holiday (in a calendar for example 25 the December).
    Please do the needful. It is urgent
    Thanks in advance
    Raj

    Try this logic in a customer exit:
    DATA:  l_s_range TYPE rsr_s_rangesid.
    DATA:  X_PERIOD LIKE T009B-POPER,
               X_YEAR   LIKE T009B-BDATJ.
      CASE I_VNAM.
      WHEN 'ZPREVWORKDAY'.
        DATA: l_DayOfWeek(1) TYPE C,
              l_act_date     TYPE d,
              l_prev_date    TYPE d.
        l_act_date = sy-datum.
        CALL FUNCTION  'DATE_COMPUTE_DAY'
             EXPORTING DATE = l_act_date
             IMPORTING DAY  = l_DayOfWeek.
        CASE l_DayOfWeek.
          WHEN '1'.
            l_prev_date = l_act_date - 3.
          WHEN '2'.
            l_prev_date = l_act_date - 1.
          WHEN '3'.
            l_prev_date = l_act_date - 1.
          WHEN '4'.
            l_prev_date = l_act_date - 1.
          WHEN '5'.
            l_prev_date = l_act_date - 1.
          WHEN '6'.
            l_prev_date = l_act_date - 1.
          WHEN '7'.
            l_prev_date = l_act_date - 2.
        ENDCASE.
        l_s_range-low  = l_prev_date.
        APPEND l_s_range TO e_t_range.
    ENDCASE.
    Edited by: Tyler Blouse on Feb 13, 2008 8:28 PM

Maybe you are looking for

  • Apple Mail in 10.6.8 not displaying attachments

    I am unable to get consistent results on displaying attachments from Apple Mail on 10.6.8 with Exchange Server 2007 SP3 RU4. Attachments sent from an Outlook 2007 client on the same exchange server are not displayed in Apple Mail. The message shows n

  • Le port série de mon nouveau PC ne marche pas sous labview7

    Je travaille à l'université de POITIERS et touts les ordinnateurs acquis dernierement ont ce problème. J'envisage d'acheté des convertisseur USB->serie mais avant j'aimerait savoir si il n'éxiste pas une solution

  • JSF Caching old values on webpage.

    Hey Guys, I have a jsp page that updates a profile values. This seems to work since the values change on the Oracle Database are updated. The problem is when I view the profile the jsp shows the previous values. I hit shift refresh and the page shows

  • Need help with masking a time-lapse animation

    Hi all, I'm working on a time-lapse project where I have taken 240 shots of a highway heading into my city, and have erased the cars from the shot, creating the look of an "empty city". This will be one of many sequences like this. I got the highway

  • Cannot find javac program

    Hello, I just recently installed Java 2 SDK, version 1.3.1 on my NT computer. After installation (went by the book according to the java installation notes) and adding my path, I did a quick check in the folder I installed to..in this cas C:\jdk1.3 .