Variable User Exit

Hi have a user exit variable in a query (It must concatenate two characteristics from the user entry parameters).
WHEN 'NOMSOLI'.   " nombre solicitante tarifa compras
      CLEAR: l_s_var, l_s_var2.
      READ TABLE i_t_var_range WITH KEY vnam = 'OS_SALON'
                                                INTO l_s_var.
      IF ( sy-subrc EQ 0 ).
        LOOP AT i_t_var_range INTO l_s_var2 WHERE vnam = 'OS_EDICI'.
          IF ( sy-subrc EQ 0 ).
            CONCATENATE l_s_var-low '.' l_s_var2-low INTO l_s_range-low.
            l_s_range-sign  = 'I'.
            l_s_range-opt   = l_s_var2-opt.
            APPEND l_s_range TO e_t_range.
          ENDIF.
        ENDLOOP.
      ENDIF.
I must to take care the user entry parameters of the query : LE,BT,GE..... <,>, = , ..etc
The final result of the variable shows the follow structure data (because the entry parameters user)::
I   |GE |S028.006  
I   |LE |S028.008  
but when I execute the query, it shows an error about the interval result.
Some one knows how it works when you have more values entry data?
Because always I create user exit variables like:
I   |EQ |S028.006

Hi MP,
The code seems to be OK as per your current requirement. Please clear below mentioned points are correct as per what i understand.
User Input
1. OS_SALON
2. OS_EDICI
-> First input is going to be single.
-> Second input would always be multiple but single values with various options.
-> you need to concatenate first value with all the second values and the options of just 2nd one.
-> After concatenation, you need to validate the result value with the data in the infoprovider.
-> Validated data then needed in output.
I can suggest you some alternate method if it is same what i understand.
Regards
Raj

Similar Messages

  • How can i do a variable User exit that present the values before execute

    Hi Gurus,
    How can i do a variable User exit that present the values before execute, i need this:
    a variable that calculate SYS-DATUM until 30 days before (I got the code) but this  variable run automatic because is user exit, i want this variable but first present the values, not execute automatic, this is because the users want the report that automatic present the values , help

    Hi,
    Refer the below links,
    http://documentation.softwareag.com/natural/nat424mf/pdf/ops_mf/conf_usrex.pdf
    http://www.erpgenie.com/component/content/article/1097
    http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
    Hope it helps you,
    Regards,
    Ravindra.

  • Filters with variables user-exits on queries

    Is it possible to define complex selection criteria by using the EXIT_SAPLRRSO_001?. Something similar to what we may do a select for Sap:
    Select * from table where ((field1 = value1 and field2 = value2) or (field1 = value3 and field2 = Value4)).
    I guess not, it seems that only allows a range for output as a single variable ...
    If this is not possible, is there any way to filter the data before the show?. I do not care who is among the infoprovider and Bex, who between Bex and Excel ...
    Filters with variables user-exits on queries

    The variable can take any combination that can be specified in a select-option. The criteria used to select these values to be populated for the variable can be as complex as any ABAP program. So all combinations in a select statement are allowed.

  • Steps for Variable User Exit

    Hi All,
    I have to do some coding in my variable exit. I have followed the follwing steps to create a project a write the code. Anyone please confirm if my steps are correct or missing anything.
    1. Go to CMOD, give project name and Click on create.
    2. Enhancements -> give RSR00001. and click on Components.
    3. Double click on 'EXIT_SAPLRRS0_001'. This will bring up the functionmodule in which we can find an include.
    4. Double click on 'ZXRSRU01' Include.
    5. Press Enter for the warning message.
    6. It gave me a message saying that 'the Include doesnot exist, Do you want to create it'. Click Yes. This will bring up a blank ABAP editor.
    7. Write the required code using CASE Statement.
    Am I missing anything here?
    I would be grateful if someone can send me any documents relating to the variable User Exits.
    Best Rgds,
    James.

    Hi,
    Directly go se38 and execute ZXRSRU01 program. Then write a case statement. below is the sample code to calculate default year month variable.
    case v_name.
      when 'ZYRMTH'.
        if i_step = 1.
          read table i_t_var_range
          with key vnam = 'ZYRMTH'
               into ld_s_var_range.
          if sy-subrc ne 0.   " no value exists, assigns default
            c_year = sy-datum(4).
            c_month = sy-datum+4(2).
            if c_month = 1.
              c_year = c_year - 1.
              c_month = 12.
            else.
              c_month = c_month - 1.
            endif.
            concatenate c_year c_month into c_monyr.
            l_s_range-low = c_monyr.
            clear e_t_range.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            append l_s_range to e_t_range.
          endif.
        endif. 
    endcase.
    Regards,
    Malli

  • Selection screen values in global variable user exit

    Hi all,
    I made a project report global variable of type 3 (User Exit) and I develop the related code in enhancement KKDR0001 component EXIT_SAPLKYP1_003. In this code I need the value of project definition that user entered on selection screen.
    Does anybody know how can I get this data?
    Thanks!

    Hi,
    You can do the following for getting project in Earlier screen
    Data: l_string(20) type c
    Field-symbols: <fs> type any.
    l_string = '(Screen)variable name'.
    assign l_string to <FS>.
    Just try above...

  • Variable User Exits

    Previously I have only used CMOD to manipulate variables in queries. However, my current client has BW 3.5 and I have read that the direction now is to use the BADI RSU5_SAPI_BADI.
    Can anybody provide an example of a user exit using the BADI? I know enough ABAP to get by in the old user exit but I don't think my knowledge extends this far.
    I am on BW 3.5 SP13.
    Cheers,

    hi,
    sample code
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'CUMMONTH'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'MONTH'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.   "high value = input
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    sent doc also ...

  • Convert Variable User Exit to ABAP OO

    Hi, I recall an article that demonstrated a better way to implement the Varaible User Exit with ABAP OO, instead of the usual design.  The ABAP OO way would eliminate a single variable code error from shutting down all of the others.   Can anyone point me to the article?
    Thanks

    Hello,
    You can use BADI which is a ABAP OO.
    [Enhancing DataSources with BAdI RSU5_SAPI_BADI|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3001894b-b1fb-2910-77ba-e80b6f2053b7]
    [Implementing a Business Add In (BAdI) in an Enhancement|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702]
    Thanks
    Chandran

  • Variable user exit question

    Hi all,
    i m looking for a code to make an User exit variable  to select the actual month and the previous month , for example in this moment ( september and October )

    Hi,
    Use Tcode: CMOD, funtion module :EXIT_SAPLRRS0_001 double click on the program ZXRSRU01, start writing ur code. The code which i gave u is for Calculate Month to date, similarly u have change the code as per ur requirement.
    Regarding User exits:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
    to calculate "month to date" user input is "Calday" Key Date
    sample code:
    WHEN 'ZPUTMNTH'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(6). "low value, e.g.YYYYMM (200606) part of key date (20060625)
    L_S_RANGE-LOW+6(2) = '01'. “ low value e..g. YYYYMM01 (20060601)
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.

  • Formula variable user exit.

    Hello experts;
    I will provide max points for help with this.
    In query designer can I access a key figure from another cube and use it in a formula?
    I cannot use multi-cube in this solution so I was looking into creating a formula variable using a user exit to access a key figure stored in a different cube.
    Ex:
    I have a Tracings cube with customer and material cost information.
    I need to calculate the cost per patient for Absorbent material.
    I can get the customer cost for Absorbent material but the number of patients is stored in a different cube called Census information.
    Since the Census information is not related to a material (only customer) I cannot get the number of patients together with the cost of the absorbent material. I was hoping to access the Census information (number of patients) from the query calculating the cost per patient.
    Thanks
    Den

    I really don't see how you can implement it using exit variable even if you can read data from other cube in exit. If you still want to explore it, refer the following thread - How to read data from an InfoCube in BI 7.0?
    Why can't you build a multiprovider - these kind of requirements are precisely the reason why multiprovider is there (when you need information present in multiple infoproviders in the same report)

  • Variable user exit EXIT_SAPLRRS0_001 not called when I execute my query

    Hi *,
    I have created a variable in my query. Corresponding to that, I have written an exit in EXIT_SAPLRRS0_001. Wanted to debug this exit but unsuccessful.
    I put a breakpoint in  "IF i_step = 2." and started running the query. I thought that the point of execution will be hated at my breakpoint so that I can check my logic.
    But the query simply directly executes. Where is the fault ? What needs to be checked ? Is the exit being called? My debugging technique is right ?
    Will assign points for suggestible remedies.
    Regards,
    Srinivas

    Hi !
    Case 1.
    your cmod project may not be activated.
    a. Go to the cmod "editior" go to change mode and activate your code....
    b. press back button once ...
    c. continue to press activate button at every step till you come to cmod initial screen ...
    At last when you are at cmod initial screen ... press activate again ....
    This is very important as our cmod code (project) should be activated at every level ...
    Case 2.
    If it still does not work ... try using a break point just before the code segment ( case statement or if statement i.e. case 'i_vnam' etc .... ) and try to debug....
    Hope it helps ....
    Regards
    Anshul

  • User-Exit Variable

    Hi, I created a simple user-exit variable and for some reason the variable seems to get executed around 16 times and then the query gives me the below error messages.   Any ideas why my variable would have I_STEP = 2 many times before it bombs out? 
    Note: This variable is based on a Virtual Characteristic I just implemented and is probably related.  The query did not fail before trying to implement this user exit based on the Virtual Characteristic.
    Error for variable in customer enhancement ZVRSR_001
    Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET
    *~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    * Load Variable with NCI Authorized Sales Rep (Sales Group)
    *~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
      WHEN 'ZVRSR_001'.
        IF I_STEP = 2.                         "after the popup
          DATA: LT_REP    TYPE /BIC/AZ_P_O04300.
          DATA: LV_REP    TYPE /BI0/OISALES_GRP.
          SELECT SINGLE * FROM /BIC/AZ_P_O04300 INTO LT_REP
               WHERE USERNAME = SY-UNAME.
          IF SY-SUBRC = 0.
            W_L_S_RANGE-LOW = LT_REP-/BIC/ZSHTO_GRP.
          ELSE.
            W_L_S_RANGE-LOW = '???'.
          ENDIF.
          W_L_S_RANGE-SIGN = 'I'.
          W_L_S_RANGE-OPT  = 'BT'.
          APPEND W_L_S_RANGE TO E_T_RANGE.
        ENDIF.
    ENDCASE.

    OK, It looks like because it is a Virtual Characteristic that the User Exit Variable Code will be called every time the "Virtual Characteristic" code is executed as well.  The real problem seemed to be that I had used a BT in the Variable User Exit Range.  Once I changed that to "EQ' it works fine now.  Thanks

  • Problem with step 2 in user exit.

    Hello collegues,
    I have a problem with the variables user exit in the bex analyzer. I have created a variable user exit and this is used as user authorization, and this variables is optional and enabled to entry . When i debugg the user exit, i put the break point in the step 1, in the step 0 and in the step 2, i can check the step1 and 0 but in the step 2 don´t stop. 
    Why does this happen?
    Thanks for your collaboration.

    Variable enabled to entry are not are not candidate to step 2. This step is only called once per exit variable not enabled to entry.
    Regards,
    Fred

  • Recommended SAP user exits

    hi experts,
    in our project we are not incorporating BADI technology for extractor enhancements due to known performance issues and now its decided that we will incorporate a simple ABAP technique using PERFORM ststement that will allow a program to dynamically called based on data source name.
    now question is that:
    1) what type of USEREXIT is recommended by SAP in such a problem explained above.
    2)Is there any DATASOURCE or FUNCTION MODULE whose Data source name character exceeds 30 chars.
    please ans me in terms of:
               1) performance 2) memory and complexity.
    thank you very much.

    Hi Check the links below :
    http://knol.google.com/k/alfonzo-vega/sap-bi-global-report-variable-user-exit/2uo5n5fokb0ac/4#
    http://it.toolbox.com/wiki/index.php/SAP_BI_Global_Report_Variable_user_exit_modularization
    But the above links talks about Query level  user exit modularization.
    List of User Exits in SAP R/3 Enterprise 4.7:
    http://www.erpgenie.com/abap/1395-list-of-user-exits-in-sap-r3-enterprise-47
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Dec 18, 2009 10:59 AM

  • Using a variable not in the Export,Import, table Parameters in USER EXIT

    Hi all,
       During the Invoice Creation, I need to add an entry in the VBFS table, so that it will be displayed in the system log.  In the FM 'RV_INVOICE_CREATE', the structure corresponding to it is XVBFS.  There is a user-exit   CALL CUSTOMER-FUNCTION '002', in this FM 'RV_INVOICE_CREATE'.  But the import, export or Table Parameters does not have XVBFS.
      How can I use XVBFS inside the User exit?..
    Please help.
    Regards,
    Asha

    Hi,
    I dont know whether this will help u...
    write this in user exit...to access variables/tables of main program..
    FIELD-SYMBOLS: <komv>.
    ASSIGN ('(SAPLMEPO)TKOMV[]') TO <komv>.
    where.. SAPLMEPO is the main program...and TKOMV[] is a internal table in SAPLMEPO.
    regards
    Sukriti....

  • Can i assign a string to a variable in User Exit?

    Friends,
    I would like ot write a User Exit that will assign a string to a variable depending on the value of the other variable.
    I just wanted to know if such a code is valid:
    When zimport
    IF i_step = 2.      " read user input parameter
            l_s_range-low = 'Important'.
         APPEND l_s_range TO e_t_range.
        ENDIF.
    If so, my second problem is that in the variable exit definition with processing Customer type you need to identify a "Dimension" for the variable. Non of them really fit, because the value is a string so why convert it to another format?
    Your input is appreciated in advance,
    Xibi

    hi Xibi,
    say you have var1 and var2, var2 will be filled depend on value of var1, you can write something like following.
    please be remind that var2 is not marked as “ready for input” and is set to “mandatory variable entry”.
    hope this helps.
    The second step (I_STEP = 2) is called after the processing of the variable pop-up. This step is called only for those variables that are not marked as “ready for input” and are set to “mandatory variable entry”.
    WHEN 'var2'.
        IF I_STEP = 2.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'var1'.
            CLEAR L_S_RANGE.
            if LOC_VAR_RANGE-low = ...
              L_S_RANGE-LOW = 'IMPORTANT'.
            else.
              L_S_RANGE-LOW = '....'.       
            endif.
            L_S_RANGE-SIGN   = 'I'.
            L_S_RANGE-OPT    = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
          ENDLOOP.
        ENDIF.

Maybe you are looking for

  • Problem using File Sharing to access files from my old emac.

    I have a new imac and I'm trying to share files with my older emac. I can access my imac files from my old emac through File Sharing, but I can't seem to access the old emac files from my imac. On my imac I can get to the Drop Box folder through File

  • Set text of TextInput control inside a movieclip

    Hello, I have created a movieclip object in the library which has three TextInput components. Now I am attaching this movieclip into another movieclip object on the frame. When i try to change the text property of the TextInput component, it does sho

  • Is there any query i can use to monitor Users tried to log on to data base

    is there any way to know the users tried to log on to data base is this possible if user entered user name and wrong password 4 times for example is there a table or something let me know that for example HR tried 4 times to log into data base

  • Can somebody explane how can I get iweb to open a new site or page?

    I can't start a new site or page...since I've moved some page among different sites and the program got stuck. I did quit to start it again, but now it's not possibel to use iWeb.

  • Java SDK for RoboSapien RS Media

    I have heard that there was a Java SDK for RoboSapien RS Media. I talked to a Customer Support Rep at WowWee and they said that the current Java SDK would work in it. If not that I can obtain the right one from Sun? But I can't seem to find where I c