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

Similar Messages

  • 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

  • User exit from ABAP workbench

    Hello Gurus,
           How can I get  user exit from ABAP workbench ?
    thanks very much!

    here is the program for the user exits..
    REPORT z_find_userexit NO STANDARD PAGE HEADING.
    TABLES : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    *& Selection Screen Parameters
    SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK a01.
    *& Start of main program
    START-OF-SELECTION.
    Validate Transaction Code
      SELECT SINGLE * FROM tstc
        WHERE tcode EQ p_tcode.
    Find Repository Objects for transaction code
      IF sy-subrc EQ 0.
        SELECT SINGLE * FROM tadir
           WHERE pgmid    = 'R3TR'
             AND object   = 'PROG'
             AND obj_name = tstc-pgmna.
        MOVE : tadir-devclass TO v_devclass.
        IF sy-subrc NE 0.
          SELECT SINGLE * FROM trdir
             WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir
              WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir
              WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir
              WHERE pgmid    = 'R3TR'
                AND object   = 'FUGR'
                AND obj_name = enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
    Find SAP Modifactions
        SELECT * FROM tadir
          INTO TABLE jtab
          WHERE pgmid    = 'R3TR'
            AND object   = 'SMOD'
            AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct
          WHERE sprsl EQ sy-langu
            AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(95) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          WRITE:/(95) sy-uline.
          LOOP AT jtab.
            SELECT SINGLE * FROM modsapt
            WHERE sprsl = sy-langu AND
            name = jtab-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
            WRITE:/1 sy-vline,
            2 jtab-obj_name HOTSPOT ON,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          ENDLOOP.
          WRITE:/(95) sy-uline.
          DESCRIBE TABLE jtab.
          SKIP.
          FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No of Exits:' , sy-tfill.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(95) 'No User Exit exists'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'Transaction Code Does Not Exist'.
      ENDIF.
    Take the user to SMOD for the Exit that was selected.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    give the tcode it will show the user exit and if u click on the user exit it will takes to the code..
    regards,
    venkat

  • 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.

  • Enhancements/User-Exits in ABAP

    hi all.
    if anyone have material on Enhancements/User-Exits in ABAP ..please mail me on [email protected]

    Check this SAP hlep on User exits.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
    Take a look here
    http://www.allsaplinks.com/user_exit.html
    www.sap-img.com/abap/what-is-user-exits.htm
    Also please check these threads for more details about user exits.
    Re: Screen exit
    user exit and customer exit
    user exit

  • 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 ...

  • Regarding Enhancements/User-Exits in ABAP

    Hi,
    Can anybody tell me What is meant BY Enhancements & User-Exits.
    Also what are diffrent types of Enhancements/User-Exits avialable.
    Can anybody explain me about diffrent types of Enhancements/User-Exits.
    Can anybody provide me documentation with the examples
    for diffrent types of Enhancements/User-Exits.
    If anybody is having good material on the same please post it.
    Thanks in advanace.
    Thanks & Regards,
    Rayeez.

    Customizing exits allow you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
    If you want to enhance the functionality of your R/3 System, you should take advantage of the exits available in standard R/3 applications. There are two main reasons why you should use exits rather than modifying SAP software yourself. Add-ons attached to exits have the advantage that:
    •     They do not affect standard SAP source code
    When you add new functionality to your SAP System using SAP’s exits, you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. These customer objects are linked to standard applications, but exist separately from SAP’s standard software package.
    •     They do not affect software updates
    When you add new functionality to your R/3 System using SAP’s exits, your objects (called customer objects) must adhere to strict naming conventions. When it comes time to upgrade a to a new software release, customer objects’ names ensure that they will not be affected by any changes or new additions to the standard software package.
    Customer exits are not available for all programs and screens found in R/3 standard applications. You can only use customer exits if they already exist in the R/3 System. You find find more information about locating applications with pre-defined exits in Locating Applications that have Exits.
         As part of the enhancement concept, it is possible for the customer to 
         add his own elements to application logic, screens and menus.                                                                               
    The current possibilities for enhancement are:                                                                               
    Text enhancements:                                                     
         Allow the customer to add supplementary documentation for data fields  
         non-specific to a transaction, and to change key word texts.                                                                               
    Field exits:                                                           
         Every screen element with data element reference can branch to PBO or  
         prior to PAI to a function module if desired. The field contents are   
         available here for doing special checks and making changes (e.g. user- 
         specific checks, authority checks, writing entered data and producing  
         statistics...).                                                                               
    Function exits:                                                        
         From the main program you branch into a software level, in which you you
         can store ABAP/4 coding. The applications programmer at SAP determines 
         where in the main program the function exit is placed, and which data is
         imported/exported via the interface. The accompanying documentation    
         describes the functionality of the function exit.      
         Menu enhancements:                                                       
         Pre-conceived menu items can be activated and named. On the function code
         set at menu item selection, there can be a reaction in a relevant        
         function exit.                                                                               
    Screen enhancements:                                                     
         The customer can determine the layout of areas in screens provided by the
         applications developer. Here, additional information can be displayed or 
         data entered.

  • 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 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

  • 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  or Abap programming for CO11:Goods Mvt Cancel button

    Hi Gurus,
    We need to directly exit from CO11-Goods Mvt screen without entering screen CO11-Details again (direct to SAP Menu). This need to be done, because we want to restrict from posting the confirmation if there's any error in the Goods Mvt screen.
    Is there anyway that we can rectify this?
    Thank you.

    Zmisnomer,
    I would suggest you to control this through confirmation parameters for the order type/plant combination using customization transaction OPK4. Here for the Order type/Plant combination you need to activate check box for "Goods Movement" and Also "Termination for incorrect goods movement". in the General Individual Entry tab.
    Regards,
    Prasobh

  • CRM - Pricing User Exit in Java - BADI CRM_COND_COM_BADI

    Hi All
    I have to convert some user-exit from Abap to Java in order to work in CRM Pricing Scenario (I use VMC technology based on Web AS 7.00).
    In the manual attached to note 809820 (New userexit concept for pricing)
    I find this chapter but I don't understand how to work with BADI <b>CRM_COND_COM_BADI.</b>
    <b>My objective is to create Java user-exit using Custom Tables and Fileds.</b>
    <b>Passing additional information to pricing</b>
    To summarize, if the information used in a requirement is not depending on the current calculation result, then the information can be passed to the pricing engine. This is the best way to avoid e.g. DB or JCo calls from the user exits.
    Nearly all application scenarios using the pricing engine provide a way of filling additional attributes.
    1. Create a field catalogue entry for the additional attribute
    2. Program the filling of that attribute value
    The application calling the pricing engine and the way it is allowing customer code to fill or influence attributes is not part of this document. Here is only a short list of documentation to start with (also various notes exist):
    Application Description
    CRM Online Order Processing
    Implement BADI CRM_COND_COM_BADI. Note 850077
    Mobile Solutions Implement VBA user exit methods on SPCDOCHANDLER or SPCITEMHANDLER.Note 677314 and Note 934216
    Best regards
    Davide Ivanov
    [email protected]

    Hi davide,
    The BADI CRM_COND_COM_BADI is used for filling the pricing communication structure.
    If you have added any field at header level of the field catelog that will available in the changing parameter of the method HEADER_COMMUNICATION_STRUCTURE.
    If you have added any field at item level of the field catelog that will available in the changing parameter of the method ITEM_COMMUNICATION_STRUCTURE.
    Additional fields added at catelog can be filled with the values using this BADI.
    Thanks & Regards,
    Raghuram. K.R.

Maybe you are looking for

  • Regarding layout of abap query

    hi all, i have an issue in the output of abap query. in output i have many columns with values, nw i have to insert two additional  colums in between of the existing output.how to do that???

  • Messages "Item completely/partially delivered on purchasing documents

    Dear, We're testing the new layouts of the purchase documents for the upgrade to ECC 6.O and there is a problem with a specific message on item level. If a purchase order is changed, a message "Item completely delivered" or "Item partially delivered"

  • Retained earning carry forward

    Dear All For the fiscal 2008 the FAGLGVTR has been run , but the balance of aclculated profit is not been C/F to Retained earning account Pls guide Regards Veena Kunthe

  • STRANGE Behavior in Lion

    I am exerimenting an strange beahavior WITH MY IMac, bellow IM DESCRIBING WHAT IS HAPPENING 1- Low case and high case are changing in aleatory way whILE I AM WRITHING (AS YOU SEE) 2- CMD_TAB combiantion TO CHANGE THE APPLICATION WORKS ON THE CONTRARY

  • Performance Issue in NWBC Material 6.1

    We are facing a major performance issue on Development and QA env for Material NWBC in 6.1 during UAT with a limited users only.  Initially we have observed that the memory space is 0% and 2% on Dev and Q environments.We have asked the infrastructure