BEx User Exit on Variable to populate with YTD values.

Hi All,
I have a multiple selection option variable on 0CALDAY that I want to prepopulate with the YTD range.
When the variable screen pops up it should display the range 01/01/2008 to 05/05/2008 (Current Date), however the user shall have the ability to change these populated values.
Thanks.

Hey thanks for the quick resposne. I was thinking of using the following code, but have the following questions, how do i know that the I_T_VAR_RANGE contains the current date that the report is on?
WHEN 'ZCCYTDIN'.
    if i_step = 1.
      read table I_T_VAR_RANGE INTO LOC_VAR_RANGE
      with key VNAM = 'ZRPTDATE'.
      clear l_date1.
      clear l_date2.
      move LOC_VAR_RANGE-LOW to l_date1.
Move First day of the year to low
      concatenate l_date1+0(4) '0101' into l_date2.
      L_S_RANGE-LOW = l_date2.
Move Calendar day entered by user to high
      L_S_RANGE-HIGH = LOC_VAR_RANGE-low.
      L_S_RANGE-SIGN =  'I'.
      L_S_RANGE-OPT  =  'BT'.
      APPEND L_S_RANGE TO E_T_RANGE.
    endif.

Similar Messages

  • BEX User exit variables in WEBI

    Hi Experts,
    Need your help please.
    I have a report in BEX with a user exit variable wich depends on other manual input variable.
    In BEX it works properly but in WEBI it doesn't recognize the user exit variable.
    It displays the error message: Not possible to determine the value for ZPD_YEAR_DAY variable
    Error in DB.​ ​Error message is​:​ ​failure to execute the query ​M​D​X​ ​S​E​L​E​C​T​ ​ ​{​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​F​E​O​H​J​3​T​3​2​H​4​Q​D​Z​4​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​9​K​1​N​I​T​C​Z​E​4​U​Y​3​J​4​U​A​E​T​Z​4​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​9​K​1​N​I​T​D​R​2​R​6​P​F​2​K​G​C​U​8​8​W​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​E​M​Z​V​7​C​H​J​M​V​2​A​Z​P​C​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​K​0​S​7​H​N​Q​B​O​5​J​A​R​L​S​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​G​6​D​3​U​V​4​M​I​3​7​5​S​8​W​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​H​P​Q​C​I​D​R​P​D​B​C​0​K​S​G​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​I​H​E​Y​U​5​3​8​S​X​E​F​Z​2​8​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​2​8​D​W​V​F​6​7​4​2​E​6​4​Z​O​L​8​F​X​3​4​]​ ​}​ ​ ​O​N​ ​C​O​L​U​M​N​S​ ​,​ ​N​O​N​ ​E​M​P​T​Y​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​ ​{​ ​[​0​C​A​L​Y​E​A​R​]​.​[​2​0​1​0​]​ ​}​ ​,​ ​ ​{​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​5​0​]​,​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​7​0​]​ ​}​ ​ ​)​,​ ​[​0​I​N​F​O​P​R​O​V​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​D​A​T​E​_​A​T​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​ ​{​ ​[​Z​C​P​M​]​.​[​X​]​ ​}​ ​ ​)​,​ ​[​Z​P​R​O​M​O​C​A​O​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​R​E​S​P​_​A​V​L​_​_​Z​N​I​V​_​C​A​R​R​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​R​E​S​P​_​A​V​L​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​N​I​V​_​C​A​R​R​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​ ​D​I​M​E​N​S​I​O​N​ ​P​R​O​P​E​R​T​I​E​S​ ​M​E​M​B​E​R​_​N​A​M​E​,​ ​M​E​M​B​E​R​_​C​A​P​T​I​O​N​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​2​0​E​M​P​L​O​Y​E​E​]​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​4​0​E​M​P​L​O​Y​E​E​]​,​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​2​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​,​ ​[​Z​R​E​S​P​_​A​V​L​]​.​[​2​Z​R​E​S​P​_​A​V​L​]​ ​O​N​ ​R​O​W​S​ ​F​R​O​M​ ​[​Z​A​V​D​P​_​M​0​1​/​Z​P​D​_​G​P​S​_​V​A​R​I​A​V​E​L​_​0​0​2​]​ ​ ​with error:​ Not possible to determine the value for ZPD_YEAR_DAY variable​.​ ​(​W​I​S​ ​1​0​9​0​1​)
    This ZPD_YEAR_DAY variable​ is the user exit variable.
    Thanks in advance,
    José Simões

    Hi!
    I am following up to this post to see if there is something I am missing.
    We have bex query with user exit variable and webi bi4sp04.4
    In bex the user exit variable works correctly, in webi, it is ignored  (the webi results are not filtered as they are in bex web results)
    I have tried moving the variable to the char restrictions and removed ready for input - so there are now no prompts in bex query.
    I have reviewed note 1611185 as well as other info on restrictions of BICS and webi, but cannot find a clear answer if bex user exit variables are supported in BI4 clients or not.
    Lee Lewis

  • Funtion Module for user exits for variables used in BEx Queries.

    Hi,
    This is for BW Query customer exit variable (zvar2) for include ZXRSRU01 and exit :EXIT_SAPLRRS0_001.
    Can anyone please suggest the function modules that can be used to do the following.
    1)Read value of zvar1 from selection screen whatever
    user enters at run time.
    2)How to define the zvar2 in the include. zvar2 is the
    variable created in BEx to be populated from this
    customer exit.
    3)How to use case statment where once the value for zvar1
    is determined then,
    Case zvar1.
    when zvar1 = 0 , then zvar2 = 10
    when zvar1 = 1 , then zvar2 = 20
    3) Assign zvar2 value as computed in the case statement.
    Can anyone please help with the code to achieve this.
    Any information regarding function modules that can help write user exits for variable reading and input will be greatly helpful.
    Thanks
    Sarah.

    Hi Sarah,
    You don't need any FM for your issue.
    Please try thie sample code :
    DATA: VAR_INPIUT LIKE RRRANGEEXIT.
    CASE I_VNAM.
      WHEN 'ZVAR2'.
       CLEAR L_S_RANGE.
       IF I_STEP = 2."PROCESSED AFTER VARIABLE INPUT
    *Reading value of ZVAR1
        LOOP AT I_T_VAR_RANGE INTO VAR_INPIUT
          WHERE VNAM = 'ZVAR1'.
          CASE VAR_INPIUT-LOW.
    *FILLING ZVAR2
           WHEN 0.
              L_S_RANGE-LOW     = 10.
           WHEN 1.
              L_S_RANGE-LOW     = 20.
          ENDCASE.
          L_S_RANGE-SIGN     = 'I'.
          L_S_RANGE-OPT      = 'EQ'.
          APPEND L_S_RANGE TO E_T_RANGE.
          EXIT.
        ENDLOOP.
      ENDIF.
    ENDCASE.
    Hope this helps
    Joe

  • Difference between bex user exit and macros in functionality?

    Hi all,
    I need to create a report on material master data. I created an infoset on 0material and 0mat_plant. In the requirem
    ent, I have a report containing different material numbers followed by attributes in each row. the final column in each
    row should be calculated using logic. the logic involves comparing different row values and arrive at final conclusion.
    the logic comprises of large number of if conditions. so should i use bex user exit or excel macros?
    what is the difference between user exit and macros in funcitonalilty?
    is there an issue transporting the macro to Prod for end users to use?
    any performance criteria?
    Any how to documents ..will be of a lot of help
    plz send them to [email protected]
    Message was edited by:
            ravi a

    Hi,
    Macros offer a powerful and flexible way to extend the features of MS Excel. You can either create a macro using VB code or Record a macro. Use Alt+F11 for creating macro using VB code.
    You can refer to Microsoft help site or this link for more details:
    http://www.taltech.com/support/sw_tricks/exmacros.htm
    User-exits are empty subroutines that SAP Developers have provided for you.You can fill them with your own source code.Technically this is a modification.Customer exits are nothing but a include in customer name space will be provided in the function module which starts with CALL CUSTOMER.You can fill them with your own source code.Technically this is an enhancement.
    look into following links for procedure to find and use user-exits transaction for finding user-exits is 'SMOD'
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/user_exits_tutorial.html
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

  • User Exit Formula Variable - to calculate #days of any month

    Hello Team,
    I need a column in my report layout which shows the #days of any month entered by the user. User entry 01.2014 to 03.2014 report should have 31 28 & 31 according to the Calendar month in the rows.
    To achieve this I'm using a user exit formula variable in my local calculation. An Optional Interval User Entry variable on CALMONTH is also put in at the filter section.
    I created a CLASS with 2 methods CONSTRUCTOR( vNam = 'ZC2C_DSONWDAYS') & GET_VALUES. We may also use FM /OSP/GET_DAYS_IN_MONTH but i need the code because I failed terribly.
    GET_VALUES method code:
    if i_step = 2.
       DATA: wa like line of i_t_var_range[].
       DATA: L_V_INDICATOR TYPE SCAL-INDICATOR.
       data: begin of ccrange ,
               iobjnm(30) type c,
                 sign(1),
                  opt(2),
                  low(7) type c,
                 high(7) type c,
             end of ccrange.
      data: l_s_range type rrrangesid,
            no_of_wrkdays type i value 0,
            startdate     type d,
            enddate       type d,
            startmth(2)   type c,
            endmth(2)     type c,
            startyr(4)    type c,
            endyr(4)      type c,
            endday(2)     type c,
            leapyear      type i value 0,
            dayofmth      type syst-datum.
    DATA:  day           type SCAL-INDICATOR.
      loop at i_t_var_range into wa.
        if wa-iobjnm = '0CALMONTH'.
           ccrange-sign = wa-sign.
           ccrange-opt = wa-opt.
           ccrange-low = wa-low.
           ccrange-high = wa-high.
           exit.
        endif.
      endloop.
      startyr  = ccrange-low+0(4).
      startmth = ccrange-low+4(2).
      endyr    = ccrange-high+0(4).
      endmth   = ccrange-high+4(2).
      concatenate startyr startmth '01' into startdate.
    * determine last day of the end month
      if endmth = '02'.
         leapyear = endyr mod 4.
         if leapyear = 0.
            endday = '29'.
         else.
            endday = '28'.
         endif.
      elseif ( endmth = '04' or endmth = '06' or endmth = '09' or endmth = '11' ).
           endday = '30'.
      else.
           endday = '31'.
      endif.
      concatenate endyr endmth endday into enddate.
      dayofmth = startdate.
    IF startmth <= endmth.
       startmth = startmth+1.
    ENDIF.
    * do it for all days in space of time
       WHILE dayofmth <= enddate.     "to date
         CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
         EXPORTING
           input = startmth
         IMPORTING
           output = no_of_wrkdays.
           CLEAR l_s_range.
           l_s_range-sign = 'I'.
           l_s_range-opt = 'EQ'.
           l_s_range-low = no_of_wrkdays.
       append l_s_range to e_t_range.
           startmth = startmth + 1.
           CONCATENATE startyr startmth '01' into dayofmth.
        ENDWHILE.
    endif.
    endmethod.

    Hi Vasavi,
    1)  Create a FV to calculate no.of days  like below, with calmonth in ref characteristics :
    2. If you see number of days is an attribute of calmonth. Please enter that as below :
    3. Create a formula with above variable and make sure calmonth is added in the row.
    Its giving output like this :
    I hope this will help you.
    Thanks,

  • Objects in BEx User Exit ???

    Hello all,
    I have come across these in some sample codes. I am new to ABAP coding.
    Can anyone please take some time and explain what these objects mean in the BEx User Exit. I dont know if they are just some objects or tables. What is the use of them?. I would really appreciate if anyone can answer atleast a few of the below. Some of these might be just some declarations made by the programmer whilst coding.
    E_T_RANGE
    L_S_RANGE
    RSR_S_RANGESID
    L_S_VAR_RANGE
    RRRANGEEXIT
    I_T_VAR_RANGE
    LOC_VAR_RANGE
    RESULT-SIGN
    RESULT-OPT
    RESULT-HIGH
    RESULT-LOW
    Thanks in advance
    S N

    SN,
      This is the Function Module - EXIT_SAPLRRS0_001
    Go to SE37 and enter above Function Module and You will find different Tap strips
    Go to Import and Export Tab Strips you will find the mentioned Variables.
    E_T_RANGE - Variables Value Table
    L_S_RANGE - Structure (work Area of E_T_RANGE)
    RSR_S_RANGESID
    L_S_VAR_RANGE
    RRRANGEEXIT
    I_T_VAR_RANGE - Table
    LOC_VAR_RANGE - Work Area of I_T_VAR_RANGE
    RESULT-SIGN - I (Interval)
    RESULT-OPT - EQ- Equal
    RESULT-HIGH - To Value in the Variable
    RESULT-LOW - From Value in the Variable
    This is the sample code
    XYZ - Is your customer exit variable
    SY-DATUM - This will get System Date (Current Date)
    WHEN 'XYZ'.
           DATA: V_LOC TYPE D.
           V_LOC = SY-DATUM.
      IF I_STEP = 2.
               LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE.
                 CLEAR L_S_RANGE.
                 L_S_RANGE-LOW = V_LOC.
                 L_S_RANGE-SIGN = 'I'.
                 L_S_RANGE-OPT = 'EQ'.
                 APPEND L_S_RANGE TO E_T_RANGE.
                 EXIT.
               ENDloop.
           ENDIF.
    Thanks
    Sriram

  • Regarding User Exits in VARIABLES

    can any one let me know,
    1>  wen can we go for user exits in variables ?
    2>  any suitable examples for that ?
    3>  and can u people provide CODE for better Xplaination.?
    Thanks and Regards,
    Hawkin.

    Read this article, it will clear your concepts.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d

  • How user exit is used to populate the Profit center field in  Sales order?

    Hi All,
    Please let me know :
    How the user exit is used to populate the Profit center field in the Sales order?
    Please gurus answer as quickly as possible as I require this urgently.

    Hi,
    To derive the correct profit center in the Sales Order, you customize in 0KEM.
    Trust this helps much and do encourage our efforts!
    Cheers!

  • User Exits: Global Variables

    Please help me in how to create User Exits: Global Variables
    if there is step by step doc pls send it to my mail id
    [email protected]

    I guess by default (if text is maintained) F4 for calmonth should show you key, short description and long description.
    refer: Variable - Name of month instead of Number
    Edited by: sam hennry on Mar 17, 2008 11:00 AM

  • Authorization variable not filled with authorization values

    Hello All
    I post a similar message earlier this week, I thought that my issue was solved, but it was not.
    I've got a workbook with 4 differents queries.
    There as an authorizations variable in each query. This variable properties is as follows :
    **General tab**
    Type of variable : characteristic value
    Processing type : authorization
    Characteristic : company code
    **Details**
    Variable represents : selection options
    Variable is : optional
    Variable is ready for input : yes
    I've followed recommandations from OSS notes 976680
    My issue is : if I run each query individually, variable is filled with authorized values
    If I run the workbook, variable is not filled with authorized value, so when end user run the workbook, BW consider that end user wants to see all data and get "No authorization".
    I don't understand why variable within the workbook doesn't show the authorized values and why the queries do.
    Any suggestion about this issue ????
    Thanks
    Catherine

    Hi
    thanks for replying
    I ran the query with UserID from RSECADMIN and I could open the query. But if I want to select 0profit_ctr I get this error No authorization to characteristic values.
    I  checked the log and this is the message.
    Value Authorization
    InfoProvider FIGL_MP1
    Value Authorization for Characteristic 0PROFIT_CTR
    Building the Buffer...
    Building the Buffer...
    No Authorization for Values
    thanks

  • Query with user-exit hierarchy variable and input ready hierarchy node var.

    Hello everyone.
    we are using several hierarchies (2005, 2006 and 2007) of the same info object 0FUNDS_CTR (one for each fiscal year). We would like to be able to use same reports regardless of chosen fiscal year (selected hierarchy) and ever more, to select node inside proper hierarchy. At the moment reports use 3 parameters:
    1) fiscal period from - fiscal period to
    2) hierarchy name
    3) hierarchy node
    Our goal is to get report with only 2 parameters:
    1) fiscal period from - fiscal period to
    2) hierarchy node
    since hierarchy name could be derived (user exit) from fiscal period.
    When user selects hierarchy node he is being asked to select hierarchy name (despite of user exit for hierarchy name) and key date (populated with current date).
    We would like to avoid step of user selecting hierarchy. Is it possible?
    Any other approaches to problem would be appreciated.
    Kind regards,
    Josko.

    Hi Jörg,
    As mentioned, I_STEP = 3 is  processed once per query, not once per varaiable.
    If this statement is placed within case-endcase for I_VNAM it never will be processed.
    Please take a look on this, it might be helpful..
    Regards
    Joe

  • User Exit is required to populate PO type in IDOC

    Hi,
    My requirement is:
    DELVRY03 Idoc presently doesn't carry any field in which we can store a purchase order.
    here i need to extend the idoc with a new segment with PO type as field and sales order number field.
    I need to get Purchase document type field(BSART). from EKKO table ,
    here i need to retrieve the PO number from the line item reference field LIPS-VGBEL., based on the PO number i need to get the EKKO-BSART.
    in which exit i need to write the logic for this.
    Pls help me on this ASAP.
    Thanks,
    Satish

    Hi
    Go to the related Function module for this IDOC type/Message Type/PROCESS CODE which you are using for this purpose
    then in that Fun module search for the CUSTOMER-FUNCTION's which are nothing but the user exits where we write code to populate the custom segments and other values.
    search for the relavent FUNCTION and write the above code.
    Regards
    Anji

  • User Exit for CO11N to populate the Ref Order in Prod Order when Rework Ord

    HI All,
    I created a Production Order(100023) using TCode CO01 with 10 Qty.
    When i am creating a Production Order confirmation using TCode CO11N, i Confirmed 9 Qty and 1 Qty for Rework Order, it is confirming the 9Qty and creating a new Production Order (100024) for 1Qty.
    As per the requirement it is working fine. While system creating a Production Order (100024) for the Rework Qty, i need to populate the Reference Production Order number (100023) in the field Ref. Order in Control Data tab in the Production Order.
    Can any one suggest me how to populate this field? Is this possible by any USER EXIT or BADI ?
    Or Can we do it by configuration?
    Regards,

    Hey all: I already have solved it. This was solved using a batch input application: before is launched the MIGO transaction, we print the smartorm using ME38 transaction with SHDB.

  • Get hierarchy name in user-exit from variable

    Hi everybody
    I have a WebTemplate with different queris. The user can select the costcenter in the beginning. In a further query of the template I show all the orders regarding that costcenter. But with this concept I block all the orders with one user executing the template.
    So now I want to select the orders that belong to the selected costcenter in a user exit (with a variable). This works fine when the user selects a costcenter.
    But it is also possible that the user selects a higher node of the costcenter hierarchy. How can I get all the orders that are connected to a costcenter node?
    So far I thought that I have to get all costcenter nodes that have the selected node as a parent (etc..) in the hierarchy table. But how do I find out which hierarchy is used by the query? I get the Variable name loc_var_range-vnam. And I know which table the hierarchy is in. But how do I find the correct HIEID?
    or does anybody have a better suggestion to solve my problem?
    Thanks in advance.
    Christophe

    Hi Christophe,
    I've written a code for finding the name of hierarchy using the node.
    It's little bit big code, if send ur email id i can pass it to you.
    hope that helps you.
    regards
    rajesh

  • User Exit EXIT_SAPLMGMU_001 doesn't work with all MM views

    Hello,
    I'm using user exit EXIT_SAPLMGMU_001 in MM02/MM01 tcode to check if valuation class is correctly filled and i've a problem when i select all views for material. In MM02, when i select Accounting View, i can make the validation because in user exit, structure wmbew is filled, but if i select all views, only structure wmara is filled, all others structure are empty.
    does anyone can help me in this?
    Thanks

    HI
    CHECK WITH THESE USER EXITS
    MGA00001 Material Master (Industry): Checks and Enhancements
    MGA00002 Material Master (Industry): Number Assignment
    MGA00003 Material Master (Industry and Retail): Number Display
    Hope this helps !!!
    Cheers
    Alfred

Maybe you are looking for