Help me in Writing USER EXIT

I want to write user exit in the GR Creation.
Please help me out.

did you find the user exit.
find the user exit in smod ,what do you want to do..
accordingly you can find the user exit.
these are the exists..
MBCF0002            Customer function exit: Segment text in material doc. item       
MBCF0005            Material document item for goods receipt/issue slip              
MBCF0006            Customer function for WBS element                                
MBCF0007            Customer function exit: Updating a reservation                   
MBCF0009            Filling the storage location field                               
MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_CREATE1       
MBCF0011            Read from RESB and RKPF for print list in  MB26                  
MB_CF001            Customer Function Exit in the Case of Updating a Mat. Doc.
vijay
Message was edited by: Vijay Babu Dudla

Similar Messages

  • Help me to find user exit  for  MB1B

    IN MB1B TRANSACTION I WANT ONE FIELD LIKE <b>REASON FOR TRANSFER</b> APPEAR IN THE FIRST SCREEN  ONLY WHEN I AM ENTERING PARTICULAR MOVEMENT TYPE,PLANT AND STORAGE LOCATION.HELP ME TO FIND USER EXIT FOR THIS
    Message was edited by:
            neela renganathan

    THIS FIELD ALREADY AVAILABLE IN THE NEXT SCREEN ,BUT WHILE AM ENTERING PARTICULAR  MVEMNT TYPE ,PLANT,STORAGE LOCTN IT WILL APPEAR IN INITIAL SCREEN AND IT WONT ALLOW TO GO NEXT SCREEN WITHOUT GIVING THE REASON
    Message was edited by:
            neela renganathan
    Message was edited by:
            neela renganathan

  • Hi Help on SD Pricing user exit

    Hi Guru's,
    I need help on sd pricing user exit..
    when preceding order document do not have ZW15 condition type,if we try to create the return order using the preceding order , we will not have ZW15 condition type in the returns order. But if we try to enter ZW15 condition type manually in return order,system should  throw a warning message that manual entry of ZW15   is not allowed.
    i need write code for this concept..Please provide exact user exit for this concept.
    Regards
    P.Senthil Kumar

    Hi,
      The error is due to the configuration of the pricing condition type. For the present configuration you will not be able to add the condtion manually. In order to add the condition type in your return order you have to create a new pricing routine and get it configured. Add checks in the routine for the order type while applying it. This routine will get trigerred while creation of the orders.
        Go to trasncation VOFM  and then go to Requirements--->Pricing, you will be able to see the pricing routines here. You can create a routine similar to these.
    Regards,
    Susanta

  • Help me on SD user exit

    Hi Guru's,
    I need help on sd pricing user exit..
    when preceding order document do not have ZW15 condition type,if we try to create the return order using the preceding order , we will not have ZW15 condition type in the returns order. But if we try to enter ZW15 condition type manually in return order,system should throw a warning message that manual entry of ZW15 is not allowed.
    i need write code for this concept..Please provide exact user exit for this concept.
    Regards
    P.Senthil Kumar

    did you find the user exit.
    find the user exit in smod ,what do you want to do..
    accordingly you can find the user exit.
    these are the exists..
    MBCF0002            Customer function exit: Segment text in material doc. item       
    MBCF0005            Material document item for goods receipt/issue slip              
    MBCF0006            Customer function for WBS element                                
    MBCF0007            Customer function exit: Updating a reservation                   
    MBCF0009            Filling the storage location field                               
    MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_CREATE1       
    MBCF0011            Read from RESB and RKPF for print list in  MB26                  
    MB_CF001            Customer Function Exit in the Case of Updating a Mat. Doc.
    vijay
    Message was edited by: Vijay Babu Dudla

  • Help needed in Substitution & User Exit.

    Hi Experts,
    I have a peculiar recuirement. In the <b>Vendor Invoide Creation</b> transaction (<b>FB60</b>), if you try to create a Invoice/Credit memo for a "<b>One Time Vend</b>or", a pop up window comes asking Bank and Address data.
    The user need to enter the bank key and acc no and  need to substitute the name, address fields in this pop up window screen, with some data fetched from custom DB tables according to the bank keys.
    Since the pop up screen fields are from structure BSEC, I cant really do the substitution them from OBBH (Since it only allows BSEG & BKPF fields to be substituted !! ).
    Also since the Only user exit (ZXCPDU01) avaliable in FB60 does not have any Export table, I can send the values back to the screen.
    <b>Can any one of you by any luck have a feasible solution for this ?</b>

    hi Saurav.
    there are 14 user exits in thsi transaction. these are as follows
    F050S001            FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002            FIDCC1: Change IDoc/do not send
    F050S003            FIDCC2: Change IDoc/do not send
    F050S004            FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S005            FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S006            FI Outgoing IDoc: Reset Clearing in FI Document
    F050S007            FIDCCH Outbound: Influence on IDoc for Document Change
    F180A001            Balance Sheet Adjustment
    FARC0002            Additional Checks for Archiving MM Vendor Master Data
    FEDI0001            Function Exits for EDI in FI
    RFAVIS01            Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00            Line item display: Checking of selection conditions
    RFKORIEX            Automatic correspondence
    SAPLF051            Workflow for FI (pre-capture, release for payment)
    check if anyone of them meets ur requiremnt
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Help needed in "V45A0003" User Exit

    Hello All,
    I have one problem doing Userexit "V45A0003" for VA01.
    I want to disable one field in VA01 Screen no. "4900" when order type is "RE". I try mentioned Exit for the same and i am able to disable that field for all order type but i am unable to get order type value and unable to disable field, so i want your valuable help to get the order type value given at very first screen (101) of VA01.
    So, Please i request all of you to help me in this.
    Thanks & Regards,

    Hi,
    If you want to get the Sales order no in your exit you can make use of below code.
    data:wa_vbak type vbak.
    field-symbol <FS> type any.
    ASSIGN (' (SAPMV45A)VBAK') to <FS>.
    If sy-subrc eq 0 and <FS> is assigned.
    wa_vbak = <fs>.
    endif.
    Now in wa_vbak-AUART you will get the sales order type given initial screen of sales order.
    You can also use below form in User exit include MV45AFZZ for your requirement.
    FORM userexit_field_modification.
    ENDFORM.
    Here you will all sales order data and no need to use above field symbol assignment to read vbak data.
    Regards,
    Pawan

  • Help required on finding User Exit in LM02 or in program RLMOB001

    Hi,
    I want to put 2 buttons in LM02 standard screen. is there any exit available do this in LM02 or in Program RLMOB001?. or is there any other way to achieve this?
    Your help will be appreciated.
    Thanks,
    Sree.

    check which one suits for you: there is a program which searches are the available user exits and gives you a list.. use that.. check my wiki's
    EXIT_SAPLLMOB_002     MWMRF701
    EXIT_SAPLLMOB_003     MWMRF702
    EXIT_SAPLLMOB_004     MWMRF703
    EXIT_SAPLLMOB_005     MWMRF704
    EXIT_SAPLLMOB_006     MWMRF705
    EXIT_SAPLLMOB_008     MWMRF760
    EXIT_SAPLLMOB_009     MWMRF761
    EXIT_SAPLLMOB_010     MWMRF762
    EXIT_SAPLLMOB_011     MWMRF763
    EXIT_SAPLLMOB_012     MWMRF764
    EXIT_SAPLLMOB_013     MWMRF765
    EXIT_SAPLLMOB_014     MWMRF766
    EXIT_SAPLLMOB_015     MWMRF767
    EXIT_SAPLLMOB_016     MWMRF768
    EXIT_SAPLLMOB_017     MWMRF769
    EXIT_SAPLLMOB_018     MWMRF170
    EXIT_SAPLLMOB_019     MWMRF700
    EXIT_SAPLLMOB_030     MWMRF105
    EXIT_SAPLLMOB_034     MWMRF634
    EXIT_SAPLLMOB_035     MWMRF105
    EXIT_SAPLLMOB_036     MWMRF634
    EXIT_SAPLLMOB_040     MWMRF106
    EXIT_SAPLLMOB_045     MWMRF106
    EXIT_SAPLLMOB_050     MWMRF107
    EXIT_SAPLLMOB_052     MWMRF633
    EXIT_SAPLLMOB_054     MWMRF633
    EXIT_SAPLLMOB_060     MWMRF107
    EXIT_SAPLLMOB_062     MWMRF650     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0650)
    EXIT_SAPLLMOB_064     MWMRF650     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0650)
    EXIT_SAPLLMOB_070     MWMRF108     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0108)
    EXIT_SAPLLMOB_072     MWMRF632     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0632)
    EXIT_SAPLLMOB_074     MWMRF632     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0632)
    EXIT_SAPLLMOB_075     MWMRF108     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0108)
    EXIT_SAPLLMOB_077     MWMRFUP     Customer defined general purpose pushbutton called from scr.
    EXIT_SAPLLMOB_080     MWMRF412     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0412)
    EXIT_SAPLLMOB_082     MWMRF631     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0631)
    EXIT_SAPLLMOB_084     MWMRF631     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0631)
    EXIT_SAPLLMOB_085     MWMRF412     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0412)
    EXIT_SAPLLMOB_090     MWMRF630     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0630)
    EXIT_SAPLLMOB_095     MWMRF630     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0630)
    EXIT_SAPLLMOB_100     MWMRF151     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0151)
    EXIT_SAPLLMOB_110     MWMRF152     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0152)
    EXIT_SAPLLMOB_120     MWMRF153     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0153)
    EXIT_SAPLLMOB_130     MWMRF202     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0202)
    EXIT_SAPLLMOB_140     MWMRF203     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0203)
    EXIT_SAPLLMOB_150     MWMRF204     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0204)
    EXIT_SAPLLMOB_160     MWMRF205     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0205)
    EXIT_SAPLLMOB_170     MWMRF212     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0212)
    EXIT_SAPLLMOB_180     MWMRF213     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0213)
    EXIT_SAPLLMOB_190     MWMRF221     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0221)
    EXIT_SAPLLMOB_210     MWMRF302     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0302)
    EXIT_SAPLLMOB_220     MWMRF303     ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0303)

  • Configuration for writing user exits

    sir provide me the configuration of user exits,purpose how to write it
    thank u

    Hi Supraja,
    User exits are the enhancements provided by SAP
    you can use them in transactions. Each transaction will have user exits.
    If you want to use your own requirements by making your coding while the transaction is run you can use user exits.
    For example if you want to run the MRP in MD02 specific to MRP controller you can user exit.
    Please also refer the document below.
    USEREXIT
    Userxits allow us to add our own functionality to SAP standard program
    without modifying it. These are implemented in the form of subroutines and hence are also known as FORM EXITs. The userexits are generally collected in includes and attached to the standard program by the SAP.
    All Userexits start with the word USEREXIT_...
    FORM USEREXIT_..
    z..
    ENDFORM.
    The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary customer code is inserted in the customer include starting with the z. in the form routine.
    e.g. USEREXIT_SAVE_DOCUMENT_PREPARE
    Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions instead they are using EXITs which come bundled in enhancement packages . Nevertheless existing USEREXITS will be supported by SAP an all the newer versions of SAP.
    HOW TO FIND USEREXITS
    Userexits can be found in number of ways:
    1) To find userexits in SD module , goto object navigator(SE80) and select
    development class from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press enter and you will find all the includes which contain userexits in SD for different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it and start coding.
    Some examples of userexits in SD (SALES & DISTRIBUTION) are:
    1)ADDING OF NEW FIELDS IN PRICING
    In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure. This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields. The fields which are not in either of the two tables KOMK and KOMP cannot be used in pricing .Sometimes a need arises when the pricing is to be based on some other criteria which is not present in the form of fields in either of the two tables. This problem can be solved by using USEREXITS which are provided for pricing in SD. Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done. Hence SAP provides 2 userexits ,one for sales order processing which is
    USEREXIT_PRICING_PREPARE_TKOMP or
    USEREXIT_PRICING_PREPARE_TKOMK
    Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.
    In the case of userexit which will be called when invoicing is done ,these
    are provided in the include RY60AFZZ which is in the standard SAP program SAPMV45A. The name of the userexits are same. i.e.
    USEREXIT_PRICING_PREPARE_TKOMP or
    USEREXIT_PRICING_PREPARE_TKOMK
    These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newly created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.
    Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose includes are provided in each of them .
    To create the field in header data (KOMK) the include provided is KOMKAZ
    and to create the field in item data (KOMP) the include provided is KOMPAZ.
    One possible example for the need of creating new fields can be e.g. Freight to be based upon transportation zone, for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.
    2) The other method of finding userexit is to find the word USEREXIT in the
    associated program of the transaction for which we want to determine userexit using SE38.
    3) The other method of finding userexits is to find the include in case of SD/MM applications where the userexits are located, this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.
    Some other examples of userexits in SD are:
    USEREXIT_NUMBER_RANGE
    This userexit is used to assign a different internal document number to the
    sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .
    USEREXIT_SAVE_DOCUMENT_PREPARE
    This userexit is used to insert the ABAP code which will be called when
    the document (sales order VA01) is just about to be saved. This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.
    Exits & Enhancements
    There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.
    These are different from USEREXIT in the way that they are implemented
    in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits.
    These start from the word EXIT_ followed by the program name and then followed by a three digit number.
    e.g. EXIT_SAPMV45A_002
    This exit is found in SD in enhancement V45A0002.
    TYPES OF EXITS
    1) MENU EXITS
    2) FUNCTION EXITS
    3) TABLE EXITS
    4) SCREEN EXITS
    5) KEYWORD EXITS
    6) FIELD EXITS
    We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit, it is required to create the project by using CMOD
    selecting the enhancement e.g. V45A0002 and selecting the component
    (one which fulfills our need) i.e. the exit which will be implemented in SMOD and after coding has been done the project has to be activated.
    An exit can be coded only once.
    FUNCTION EXITS
    These are used to add functionality through ABAP code. These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any type of exit including function exits.
    The function exits are called from the standard SAP program in the form
    of ABAP statement
    CALL CUSTOMER-FUNCTION 'NNN'
    This is in contrast to USEREXITs where PERFORM statement is used to call
    the required userexit.
    To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its components the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.
    e.g.
    ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation
    To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located in enhancement no V45A0002 . Before we can choose the exit we have to create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components. In the components you will see the exit EXIT_SAPMV45A_002. This exit is used for our purpose.
    Double clicking on this exit will takes us to function builder (SE37) . This
    function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is E_KUNNR of type KNA1-KUNNR i.e. if we move the desired customer name to this structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order. This function also contains a customer include ZXVVA04. This include will be used to write our custom code.
    Double clicking on this include and it will prompt us that this include does not exists do you want to create this object, select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.
    e.g. E_KUNNR = 301.
    Activate the include and Activate the project. Now when ever the SALES ORDER will be created, sold-to-party field will come up with a predefined customer.
    FIELD EXITS
    The field exits are managed, created, activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element.
    The format of field exit is:
    FIELD_EXIT_dataelement_A-Z or 0-9
    If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.
    The function module associated with field exit shows two parameters
    INPUT and OUTPUT. Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3, we can write our own code to change the output parameter depending upon our requirements.
    Before the field exit can have any effect the system profile parameter
    ABAP/FIELDEXIT in all the application servers should be set to YES
    ABAP/FIELDEXIT = YES.
    TYPES OF USER EXITS
    User exits are basically 4 types,
    1. Field exit,
    2. Menu Exit,
    3. Function module and
    4. Screen exit.
    These exits we can use according to a situation...
    Please Reward If Really Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • Need help in creating a user exit variable

    Hi all,
    I have created a query in which a key figure needs to be automated with an user exit variable.I want to derive the value of this key figure 'x' based on calender month.
    This key figure should get the cumulative value from the first month of the fiscal year till the calender year month entered while executing the query.
    I got a basic understanding on the User exits from SDN. But Im not sure how to implement this logic.
    I would really appreciate if you could provide me a detailed explanation of how to do this.
    Thanks in advance,
    Vinoth

    Hi
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2d99121a-0e01-0010-e78c-b1ae566a2413
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/how-can-i-set-bex-variables-in-i_step3-exit_saplrrs0_001-335232

  • Help with Stock Removal User Exit

    Hello All
    To control the storage bin selection, I am using the user exit MWMTO004.  When I use the transaction LT03 to create a transfer order the system selects the storage bin selected by me.  However, when I create a transfer order through L_TO_CREATE_INT it doesnt select the storage bin chosen by me.  After debugging the code in LT03, I found out that SAP locks the bin with lock object ELLQUAX and ELLQUAY and thus prevents it from re-selecting the same bin.  Is there a way in the user exit, through which I can prevent selecting the same bin.  I would be thankful for your inputs in this regard.
    Thanks in Advance.

    Oh God, such a relief I solved it.  SAP provides a FM, L_TO_CREATE_GET_INFO, which updates the quantity that has already been picked.  The following is what I am doing to select a bin in the user exit:
    1) Clear the internal table sent to the user exit (t_qmat).
    2) Call the FM L_TO_CREATE_GET_INFO to check the quantity left in each bin.
    3) Select a bin and insert that bin as the first record of the internal table.
    Thanks
    Sunil Achyut

  • Can any please help in Sales Order User Exit

    Hi
    Please Can anybody show the solution to my problem.
    My problem is:
    Using Table having 2 columns(Customer,Route), we have to display Route(present under shipping tab in Sales Order) in Sales Order. Route has to be displayed based on the customer present in the table.

    Hi!
    If you wanted to create an own search help for that field, just go to SE11 transaction, and create a new search help.
    Join your Z-table with the customer table and create a view. Use this view in your new search help.
    Regards
    Tamá

  • Help to find user exit/BADI in cj20n to save requisitioner as use name

    Hi,
    I have requirement in cj20n. Please help me to find user exit or BADI for cj20n which saves requisitioner as user name automatically.
    Thanks,
    Roshani.

    Hi,
    Check this BADI :                   WORKORDER_CONFIRM.
    Goto SE18 ---> Give the above BADI name. If you want to create go to SE19 and use the above definition to create.

  • Help With an User Exit

    Hi Everyone,
    I need help to build a user exit.
    I need to get a quarter period, but i only have the 0FISCPER3 and 0FISCYEAR.
    I tought in use 0FISCPER3 in some addition.
    Can anyone help me or give some exemple of time user exits?
    Thanks

    Use a routine for 0CALQTR, pass Fiscal year Period to the Func. Module below:
    FUNCTION Z_FISCPER_TO_QTR.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_PERIV) TYPE  PERIV DEFAULT 'K4'
    *"     REFERENCE(I_FISCPER) TYPE  WDY_NUMC_7
    *"  EXPORTING
    *"     REFERENCE(ES_CALQUARTER) TYPE  /BI0/OICALQUARTER
    *"  EXCEPTIONS
    *"      INVALID
      DATA: ld_gjahr      LIKE t009b-bdatj,
            ld_poper      LIKE t009b-poper,
            ld_date       LIKE sy-datum,
            ld_year(4)    TYPE n,
            ld_month(2)   TYPE n,
            ld_quarter(1) TYPE n.
      ld_gjahr = i_fiscper(4).
      ld_poper = i_fiscper+4.
      CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
        EXPORTING
          i_gjahr              = ld_gjahr
        I_MONMIT             = 00
          i_periv              = i_periv
          i_poper              = ld_poper
       IMPORTING
         e_date               = ld_date
       EXCEPTIONS
         input_false          = 1
         t009_notfound        = 2
         t009b_notfound       = 3
         OTHERS               = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING invalid.
      ENDIF.
      ld_year  = ld_date.
      ld_month = ld_date+4(2).
      CASE ld_month.
        WHEN 1 OR 2 OR 3.
          ld_quarter = 1.
        WHEN 4 OR 5 OR 6.
          ld_quarter = 2.
        WHEN 7 OR 8 OR 9.
          ld_quarter = 3.
        WHEN 10 OR 11 OR 12.
          ld_quarter = 4.
      ENDCASE.
      CONCATENATE ld_year ld_quarter INTO ES_CALQUARTER.
    ENDFUNCTION.

  • Re: User exits, BAPI & BAdI

    Dear gurus,
    I have several questions, which may be quite general to some if you but I hope someone can assist to give me full detail information: -
    1. What is user exits? How it is used? How to configure in Customizing? Details appreciated on the customizing steps.
    2. What is the difference between BAPI and BAdI? How is it used? Customizing techniques and steps?
    Thanks.
    Full points will be awarded if helpful.
    Rgds.

    Hi,
    User exit - A user exit is a three character code that instructs the system to access a program during system processing.
    SXX: S is for standard exits that are delivered by SAP.   XX represents the 2-digit exit number.
    UXX: U is for user exits that are defined by the user.  XX represents the 2-digit exit number
    Customer exit - The R/3 enhancement concept allows 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.     *-- Mani
    The following document is about exits in SAP :-
    The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. 
    SAP creates user 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.
    Types of Exits 
    There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.
    Menu Exits
    Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.
    SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.
    Screen Exits
    Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.
    Function Module Exits 
    Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits. 
    When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated. 
    Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs. 
    These calls have the following syntax: 
    CALL CUSTOMER-FUNCTION ‘001’.
    Field Exits
    Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field.  Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100. 
    The field exit concept lets you create a special function module that contains this logic. 
    You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number. 
    In 4.6c, you can use "RSMODPRF" program to create field exits.
    An example of a user exits :-
    MODULE user_exit_0001 INPUT 
        CASE okcode.
            WHEN 'BACK OR EXIT'.
                CASE sy-dynnr.
                        WHEN '100'.
                             SET SCREEN 0.
                             LEAVE SCREEN.
    2.HOW TO FIND BADIO OR USEREXIT CUT AND PATE THI SPROG RAM IN SE38 NAD CLICK ON F8 AND PROVIDE UINPUT WHICH TCODE U WANT
    orrun this report u get the corresponding badi associated with perticular transaction
    *& Report ZNEGI16 *
    REPORT ZNEGI16 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    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 EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    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:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    or
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    •Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    Go to the Transaction, for which we want to find the BADI,
    Get the Program Name of Corresponding Transaction.
    (Click on System->Status. Double Click on Program Name)
    Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked.
    A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it.
    The changing parameter ‘INSTANCE’ will have the interface assigned to it.
    •Finding BADI Using SQL Trace (TCODE-ST05).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    •Finding BADI Using Repository Information System (TCODE- SE84).
    Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    BAPIS
    SAP created the Business Framework to allow the technical integration and exchange of business data among SAP components and between SAP and non-SAP components. Important components of the Business Framework are the Business Application Programming Interfaces (BAPIs), which represent visible interfaces at the component boundaries and whose properties serve to integrate these components. 
    The integration can include both components within a local network and components that are connected with one another through the Internet.
    BAPIs allow integration at the business level, not the technical level. This provides for greater stability in the link, and independence from the underlying communication technology.
    You can get all the standard SAP BAPI functions with the transactions code 'BAPI'.
    thanks mate,
    points if helpful,
    Phani.

  • Unable to debug user exit in CRM BW  (EXIT_SAPLRSAP)

    Hi Gurus,
    Please help me to debug user exit in CRM BW.
    I am using below enhancement
    RSAP0001 (Customer function calls in the service API)
    "EXIT_SAPLRSAP_003"
    Datasource is ZSTAONESYS0_TEXT
    The extract structure
    I have modified is "CRM_BIW_ST_T"
    ===========================
    Data Source "I_CHABASNM"
    CASE i_chabasnm.
    ZSTAONESYS0_TEXT -- Data source name
      WHEN 'ZSTAONESYS0_TEXT'.
        CLEAR l_s_crm_biw_st_t .
        LOOP AT  c_t_texts   INTO  l_s_crm_biw_st_t .
          l_tabix = sy-tabix.
          SELECT SINGLE * FROM crm_jest
                   INTO   wa_status
                   WHERE   inact  =  ' '.
          SHIFT wa_status-stat LEFT DELETING LEADING space.
          CLEAR l_stat.
          l_stat = wa_status-stat(1).
          IF  l_stat  = 'E'.
            l_s_crm_biw_st_t-bwstoppt   = wa_status-stat+3(2).
            MODIFY  c_t_texts  FROM l_s_crm_biw_st_t
                                  INDEX l_tabix.
          ENDIF.
        ENDLOOP.    
    ENDCASE.
    ===========
    Should I use a BADI?
    It would be great if you could give me
    relevant definition name for creating new BADI.
    Can I use "CRM_BWA_MFLOW" ?
    I promise to return and reward the answers.
    Really heart warming
    to see the dedication/ participation of
    Bhanu Gupta / A.H.P / Pizzaman and many others
    Thanks in advance, :-D
    AbyJacob, Bangalore
    ===================

    Dear SB,
    I was able to Debug my user exit successfully.
    ==>include ZXRSAU02. "EXIT_SAPLRSAP_003"
    You guys are really a big help
    Keep up the good work.
    Special Thanks to SDN community
    warm regards,
    Aby Jacob, Bangalore

Maybe you are looking for