Value for user-exit variable  is invalid

Hi Gurus,
My Value for a Fiscal Year Prd returns a invalid value for the 12th month of each year( for Example 12/2004, returns the error "Value 200313 for User-exit variable is invalid.
This is the code that is being used.
*Rolling 12 months for entered month
when 'ZCALM12'.
      clear: v_mth, v_yr.
      REFRESH E_T_RANGE.
      CLEAR L_S_RANGE.
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
               WHERE VNAM = 'ZCALMON'.
        exit.
      endloop.
      v_yr = LOC_VAR_RANGE-LOW+0(4) - 1.
      v_mth = LOC_VAR_RANGE-LOW+4(2) + 1.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT = 'BT'.
      concatenate v_yr v_mth into L_S_RANGE-LOW.
      L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
      APPEND L_S_RANGE TO E_T_RANGE.
Thanks in Advance.

Hi Ravi,
when 'ZCALM12'.
clear: v_mth, v_yr.
REFRESH E_T_RANGE.
CLEAR L_S_RANGE.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZCALMON'.
exit.
endloop.
<b>-->> Here, you are not checking any thing.</b> <i>On which logic you are reducing year by one and increasing month by 1..?</i>
v_yr = LOC_VAR_RANGE-LOW+0(4) - 1.
v_mth = LOC_VAR_RANGE-LOW+4(2) + 1.
-->><i>IF month is 200512 you will get output from above code is :</i> please check.
v_yr = 2005 - 1 = 2004
v_mth = 12 +1 = 13.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
concatenate v_yr v_mth into L_S_RANGE-LOW.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
APPEND L_S_RANGE TO E_T_RANGE.
Try to debug the code by keeping break point after When. and execute the report, you will be debugging mode.
Hope it Helps
Srini

Similar Messages

  • Funtion Module for user exits  variables 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

  • Cannot determine a value for an exit variable in the Formula fn w/p empty

    Hi All,
    We have an exit variable Z_EX_AR_VAR, the would read a hierarchy node input variable (Z_HN_AREA), which is furthur based on a hierarchy input variable (Z_HR_AREA), and wouuld return the first leaf of it.
    We have implemented a input ready query based on this exit variable and it is getting the first node and is input ready and saves the data to the database.
    It works well in the query when we have filtered the characteristic with the hier and hier node and the exit variables.
    We need to use the same value to be used in the Fox function.
    As per the requirement, the Fox function has to process the zero (empty) records.
    So, we have customized formula function to process emptry records.
    And in the function of type formula function that processes empty records, we have used the following statement.
    DATA AR type ZAREA.
    AR = VARI ( Z_HN_AREA, HIENM=Z_HR_AREA, 1).
    We are getting the following error message:
    Cannot determine a value for the variable Z_HN_AREA.
    Planning function ended with errors.
    What is that we are doing wrong here. Is it with the 'Process Empty Records' function that cannot read the variable.
    How come this variable is working in the query and it is not working in the FOX.
    We have done the variable to variable binding in the WAD also. Still the same problem.
    Any ideas? Thanks in advance.
    Best Regards,
    - Shashi
    Thanks in '

    Hi All,
    Michael Wolf from SAP confirmed that we cannot use VARiable read functions in the customized Formula function that processes the zero (empty records) as he spoke to SAP AG about the issue.
    Hence we have made a work around by creating a valid record using a dummy key figure in the Custom Formula function that processes empty records so that in the next step, the regular Formula function would get executed, where we could access the variable values by using VARV, VARI functions.
    Thanks,
    - Shashi

  • Modify Std. code to get value for User Exit.

    I am executing release strategry at user exit EXIT_SAPLEBND_002  ( Exit Name M06E0004 ), for the field ( USRN1)
    This has got user program ZXM06U22 in it. In this exit I get values from I_CEKKO , IT_BEKPO, IT_BEKET, IT_EKKNU
    and I have to pass the PO value from these structures to E_CEKKO-USRN1   ( This field has set in SPRO setting ) .
    I get the PO value as per standard calculation in the field IT_BEKPO-EFFWR , I also get a value in I_CEKKO-GNETW. However not one of both these values satisfy any one of my conditions. My document condition is defined in SPRO as ZVPA and values against it is calculated considering Taxes On PO. The fields EFFWR or GNETW does not include taxes. And my release startegy should get executed after considering the amount with taxes.
    After debugging a lot I have found that the PO_AMOUNT can be obtained from the Internal Table TKOMV. In this it is stored at TKOMV-KAWRT. I can get the TKOMV values at the point where this user-exit is called.
    i.e. in program MM06EF0S_STRATEGIE_CEKKO    in the last you can see the call to user exit wriiten as below
        CALL FUNCTION 'EXIT_SAPLEBND_002'
          EXPORTING
            i_cekko  = cekko
            it_bekpo = pot[]
            it_beket = ett[]
            it_ekknu = knt[]
          IMPORTING
            e_cekko  = cekko.
    If I put the debugger on  CALL FUNCTION 'EXIT_SAPLEBND_002 and go to TABLES tab and enter there 'TKOMV'
    I can get the table and it's values. However If I press F5 then I go inside my exit code i.e. ZXM06U22. But Here I Don't Get access to the internal table TKOMV , which is  accessible from main calling program MM06EF0S_STRATEGIE_CEKKO.
    My job can be done if I get value from TKOMV inside the code of ZXM06U22. However to get that code in ZXM06U22 what right now I can do is to get the access key of MM06EF0S_STRATEGIE_CEKKO and write code before exit Call and pass the ZVPA from TKOMV there. However many people here advised me not to do that since it is a STANDARD CODE.
    So I would like to know your suggestion in this regard.
    Amol

    Hi All
    Thanks for your quick replies. I wrote code below in my exit. But I am getting Compilation error at following line ( In Bold )
    DATA: l_name(50).
    DATA: my_tkomv TYPE TABLE OF komv.
    <b>FIELD-SYMBOLS: <tkomv> type standard table of komv.</b>l_name = '(SAPMMM06E)TKOMV[]'.
    ASSIGN (l_name) TO <tkomv>.
    my_tkomv[] = <tkomv>.
    The error is below
         "," expected after "TABLE".          
    I don't know whether TYPE TABLE OF is correct or not.
    I will be glad If I get some further help.
    Amol

  • How to Broadcast Control Query based on User Exit Variable

    Hi Gurus,
    How to Broadcast dashboard based on Control Query based on User Exit
    Variable to different users via mail in BW 3.5 version. Any document or
    steps to achieve this will be very helpful.
    Regards
    Vishwanath

    Hi Surendra,
    Thanks for the reply and your suggestion. It will be great if you can help me to answer the below:
    1) What exactly we mean by Control Query - Any example will be very helpful
    2) As you mentioned, yes the user exist to be written will be for user-exit variable for dynamic period selection - An Example on how to create this will be helpful
    3) Once the above variable is created, what are the steps to include this variable in the Bex Query?
    4) Once all the queries to be used in dashboard are implemented with the exit variable, how to create a variant to be used in Broadcasting?
    5) How and where to configure the email recipients (to whom this dashboard will be sent via mail)?
    6) How to set up the BW broadcaster in BW 3.5 using the control query ?( My question is though we have to send the dashboard to the users, which has multiple queries, how a single control query with variant will help us).
    Awaiting your reply.
    Thanks and Regards
    Vishwanath

  • User Exit Variable picking values from InfoProvider

    Hi,
    I've created a User Exit variable (of type Interval, Mandatory) on 0CALMONTH and populating it in exit.
    The problem is at the time of query execution, I get "BRAIN 657" error i.e.  "Value <value> is Invalid for Variable <variable name>".
    After doing some analysis I figured out that once the user-exit code is performed, system validates the entries populated in this Variable against the values in InfoProvider and gives error when it doesn't find those values.
    E.g. lets say InfoProvider has values for 0CALMONTH from 06.2010 till 10.2010 and if I populate my variable with range 03.2009 till 12.2010 then it throws above error. But if I populate the variable with exact values i.e. 06.2010 till 10.2010 then it works.
    Any idea how can I remove this validation and populate with my own value range?
    Regards,
    Vikrant.

    hi remove that default value from the variable.
    and you shd be able to run the query without any problem.
    regards,
    VJ

  • How to select several values from a user exit variable in a planning folder

    Hello,
    I have created a user exit variable for limiting the values only to which the user need to access.
    For a simulation part, it is then necessary for him to select several values from these values (not only one, and not all)
    But It seems in this case the user has only two possibilities :
    - keep all the values without any restriction
    - restrain the selection to only one value.
    It seems possible for the user to access to a multiple choice window, but this possibility doesn't seems to work : in all tests we did, only the first value was taken into account by BPS.
    If this method is not good do you know an other manner to permit the user to choice several values amongst a set of pre-selected  (because the original set is too important) values ?
    Thanks for your help.

    Hi Mayank,
    Thanks for your response, but I don't think it corresponds to my problem.
    I my case, I use a user exit variable to filter some data. It seems BPS offers the possibility to the user to select several values amongts the pre-selected values presented by the user exit variable, but it doesn't work. We can use a popup in which we enters the required values, but in final, only the first value is taken into account.
    I don't know if it is due to a BPS bug or if it is not a good solution in regard to BPS philosophy. In this case, the concerned caracteristic isn't in the header but in lead columns.
    I must present a solution to my client next monday, so I have not enough time to open an OSS message.
    An alternate solution should be interesting too.
    My need is to present to a user a selection of values amongst all values from an infoobject (the user exit variable seemed to be a good solution) and the user must have the possibility to select some values amongst these as filter.
    Regards

  • User exit variable I_STEP=1 does not show default value WebI selection scr

    Hello,
    We have a BW query with a user exit variable. We have written user exit code under I_STEP = 1 so that the default value for the field is displayed on the selection screen to the user. Works very well on the BW side.
    We based a universe on top of the query and then created a WebI report.
    When the WebI report is executed the default value is NOT seen on the selection screen,
    Note:
    1. If the user exit variable is optional and we execute the report, the default value is NOT seen on the selection screen. However if the report is executed without entering any value for the field the logic under I_STEP = 1 is picked up and the report gets the correct output
    1. If the user exit variable is mandatoryand we execute the report, the default value is NOT seen on the selection screen. The user now has to enter the value for the field.
    The scheduled reports will work in case of optional user exit variable.
    However this amounts to loss of functionality.
    Is this a known bug?
    Is there a way to display default values based on user exit variables on the WebI selection screen?
    Kindly advice. Btw we are on XI 3.1 SP3
    Rgds
    Edited by: Anup Deshmukh on Jun 29, 2010 11:13 PM

    OSS Note 1285993 - "Support of Customer Exit Variables from BEx query into WebIntelligence via OLAP universe"  deals with this issue and has deemed it out of scope for XI 3.1 SP3.
    Rgds

  • Best way to pre-populate material variable with values for users

    Hi,  I have a requirement to prepopulate a material variable with about 5 materials and that is the materials that will default when the query is called.  The users would also need the ability to change those values.
    My thought is to create a User-exit variable that derives the values from a user maintained table (infoobject). 
    Does anyone else have any suggestions or ideas on the best way to handle this?

    I don't know if there is a best solution...
    Infoobject
    With this option you have to create a new infoobject (ZMATERIAL) without attribute (you need only a list material codes) and then to set the authorization profile for the user in order to manage the content.
    The creation of an infoobject corresponds to a table creation, but you don't need any other specific options that belong to the infooject (as technical object)...
    Table
    With this option you have to create a Z table with only one field and then to allow the maintenance of the table by SM30....
    In the ending, if you want to be a purist use the table, otherwise use an infoobject (but there are no significant differences !
    Bye,
    Roberto

  • User Exit Variable for Bex in CMOD (ABAP Code)

    Hi Experts
      My requirment is to develop a Restricted Keyfigure...
      The restriction is based on 0Calmonth (Calendar Year/Month)
    The sales from beginning of calendar year up to last "closed" month in a Calendar.
    Ex: in June i want to see 01.01.2009 to 31.05.2009 data.
        in October i want to see 01.01.2009 to 30.09.2009 data.
    When user execute the report
        in Jan 2010 i want to see 0 as there is no closed month in that particular year.
        in Fed 2010 i want to see 01.01.2010 to 31.01.2010 data.
    For that purpose i need to create a User Exit variable in CMOD...
    I am struggling to get an idea on how to write a code to meet the requirment
    Please help me with code that i can use in cmod
    Thanks in advance

    Hi,
    Use the following code :
    when' variable name ' .
    DATA : year(4) type n,
    month2(2) type n,
    date_in type sy-datum,
    date_op type sy-datum.
    IF I_STEP = 1.
    CLEAR L_S_RANGE.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    month2 = sy-datum+4(2).
    if month2 = '01'.
    concatenate sy-datum+0(4) '01' '01' into l_s_range-low.
    l_s_range-high = sy-datum.
    else.
    month2 = month2 - 1.
    clear : date_in, date_op.
    concatenate sy-datum+0(4) month2 '01' into date_in.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        DAY_IN                  = date_in
    IMPORTING
       LAST_DAY_OF_MONTH       = date_op
    EXCEPTIONS
       DAY_IN_NOT_VALID        = 1
       OTHERS                  = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    concatenate sy-datum+0(4) '01' '01' into l_s_range-low.
    l_s_range-high = date_op.
    endif.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    I dint know what output do you want if the current month is jan.
    I have put it as 1st jan till current date.
    Modify it if you need.
    Regards,
    Mansi

  • Problem in transporting the text elements for user exit EXIT_SAPLV09A_002

    Hi  All,
    I am facing a problem in transporting the text element (text symbol) for the exit EXIT_SAPLV09A_002. It is implemented and transported but the text elements are not transported and even if I try to delete them and then create them again, on activation it doesn't prompts for TO and it version its shows it as local object. I have tried to manually assign the TO by using limu as id of program and rept as type and SAPLXV09 as the name of the object but still it doesn't allows as an error message comes prompting local object cannot be assigned to TO. Kindly suggest solution this problem.
    Regards,
    Sachin
    Edited by: Sachin Dangayach on Nov 15, 2010 4:21 PM

    Hello ,
               In the Quality after you run the report check in the layout option>display text elements> variables and check what value is displayed for the use exit variable , if it is correct then problem may be in the selection you gave when you run the report if the user exit variable value is wrong , then set a break point in the code and run the report from rsrt and check where the error is.
    hope it is clear
    assign points if useful

  • Read the value of user input variable during calculation of virtual char

    Hello
    Virtual characteristics is populated in custom BAPI based on values specified by user in the variable screen.
    How to read the value of user input variable outside the user exit for custom variables?
    The one way is to create faked user exit variable, read the value of user input variable in corresponding FM and insert it into table. Then value of this variable will be derived from the table.  
    Thanks

    no answer

  • BI 7 Bex Query - User exit variables after variable screen re-processed

    User exit variables are not re-calculated after the variable screen is called up to re-run report with a new selection.  Is there some way to force the user exit variables to change?   I am aware of note 1064273 but this doesn't seem to help in these circumstances.
    Example:
    My Bex Query uses OI_FYPER for a static characteristic selection and  I have defined a customer exit formula variable which uses the values in OI_FYPER.
    All works fine when the query is run first time but if the user calls up the variable screen to change the selection and re-run the query, the customer exit formula variable is not re-calculated (customer exit is called but only with ISTEP = 3).
    Software version is NS2004S (BI 7.0)  SPS10, BI ABAP SP11, BI JAVA SP10, BI Front End Package 1401 rel 354.

    hi.. i just came to know about this in another thread..
    I_STEP 3 does not have I_VNAM stored. So, to access values at I_STEP3 :
    data: l_range TYPE RRS0_S_VAR_RANGE.
    if I_STEP = '3'.
    read table I_T_VAR_RANGE into L_RANGE with key VNAM = 'OI_FYPER'
    if SY-SUBRC = 0.
    ...code as required...
    endif.
    endif.
    Customer-Exit for analysis Authorizations: i_step = 3, i_vnam is empty

  • RRI & user exit variable

    Hello RRI specialist!
    I need to implement the following logic: user executes report 1 (sender) which contains characteristic Material (and several other characteristics). With the RRI the user must be abled to jump into report 2 (receiver)displaying the Material Type(s) of the Material selectied in report 1.
    Note: in this case there is a n:m relationship between Material and  Material Type. The relationship between Material and Material Type exists in a Z-table.
    I thought to implement this with 2 alternatives:
    First alternative, under Assignment Details, assigning Material to variable V1 (being a User-Exit variable of type Material Type) used in report 2.  From report 1 I hope to jump into report 2 by "selecting" on a Material (e.g. 4711) and then read the Z-table when i_step = 2 to find the corresponding Material Type. 
    Prolem: when I set a break point for V1 in ZXRSRU01 I see that V1 does not appear in the table I_T_VAR_RANGE (for any i_step), i.e. the values (e.g. 4711) are no passed from the sender selection to V1.
    Second alternative, under Assignment Details, assigning Material to variable V2 (being a User-Entry/Default variable of type Material) used in report 2.  Report 2 will then contain variable V3 (being a User-Entry/Default variable of type Material Type). The user-exit logic will read V2 from I_T_VAR_RANGE when i_step = 2 and the Z-table to find the corresponding Material Type.  
    Problem: exactly the same as above. NOTE: it does not help that V3 is of type replacement type from the sender report.
    When I use the debugger of the RRI in RSRT2 both alternatives seem to work correctly.
    Does the variable defined under Assignment Details have to fulfill certain conditions in order for the values to be passed?
    Is it simply that ZXRSRU01 is called before the values are passed from the sender report?
    Anybody got an idea what I am doing wrong and how I could implement the requirement to read the Z-table in the RRI jump????
    Thanks for any help,
    Martin

    Dear Martin,
    That was a good explanation of issue and approach. It had been quitesome time to work on user exits. I am not sure the following views can help you.. but i am also interested in the solution..
    1) can we include the material group in the sendor ( hidden) and can this me directly assigned to target?
    2) I think i_step = 2, get excuted after user filled the values manually. How about trying i_step = 3, i think this is the loop for reading other than manual entries..
    3) how about the trails of filing the default values at i_step = 1, on the taget query names. Notsure this will give you the solution.. just my thoughts..
    regards,
    hari

  • BPS User Exit Variable based on Planning Package Selection

    Hi,
    I'm implementing a SAP BW-BPS planning layout to be integrated into the CRM we user interface.
    Most of the characteristic selections come from the CRM fields that need to be filled by the user when creates a trade promotion.
    The charcteristic selections work (as standard) just if in the planning level I flag "Selection in Package", then in package these selections are dinamically defined from what the user select in the CRM fields at runtime.
    My problem is that I have to build a BPS User Exit variable to filter, in the planning level, the proper Planning Area based on the CRM Sales Organization value.
    The characteristic CRM Sales Organization belongs to whose chararcteristic the value is determined dinamically in the planning package.
    Is it possible for a BPS user exit variable, set in the planning level, to catch the value of a characteristic selection made at planning package?
    Many thanks for your help.
    Alessandro

    Hi Indu,
    Many thanks for your answer.
    I have already took a look at the document posted by you but I didn't find the solution to my problem.
    This because i have to create a user exit variable that need to get the value of the characteristic selection in package.
    I mean in the planning level I will have the user exit variable that restrict the planning area and, his function module, need to read, at runtime, what is the value of the characteristic CRM Sales Organization restricted in package by CRM.
    So I don't have any idea to which BPS internal table I have referred to in my funcion module to catch the value of the CRM Sales Organization dinamically filtered by CRM.
    Many thanks,
    Alessandro

Maybe you are looking for