BADI ME21N

Hello All,
           I read the correspondance on BADI posted by Kripa and answers by all, I also want to learn BADI.
Kripa, can you send me the BADI code & how you write methods along with the technical specifications.
My ID : [email protected]
Thanks & Regards,
Dilip
Regards,
Dilip
Message was edited by: Diliip Gupchup

Business Add-Ins
Overview
BAdi Definition
BAdi Implementation
Calling BAdi
Filter Dependent Badi
New SAP enhancement technique
To accommodate user requirements not available / too specific to be included in the SAP standard Program
Based on ABAP Objects – It has Interfaces & Methods
Guaranteed upward compatibility of all Business Add-In interfaces
Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces
Though different enhancement technique, BAdi has following distinct features
-Uses Object oriented approach
-Two parts - Definition and its Implementation - definition can either be SAP provided or user may also create it
-no longer assumes a two-system infrastructure (SAP and customers)
-allows multiple levels of software development (by SAP, partners, and customers, and as country versions, industry solutions, and the like)
-Can have multiple representations – specific one will be executed based on some criteria (filter)
-No SSCR registration
Application Programmer defines an interface for the Business Add-Ins
Enhancement management takes this interface & generates an adapter class for implementing it, thus opening path for implementation
As per need, BAdi is suitably implemented
Developer then creates an instance of the adapter class in the application program and calls the corresponding method at the appropriate time
Application program simply calls the adapter class methods; it does not know which implementations are actually being called
Adapter class methods generated by add-in management decide which implementation is to be called
Look for BAdi in IMG and in component hierarchy
Create own implementation of the add-in (complete coding for Methods) and activate
Enhancement's active components are called at runtime.
BAdi Definition
To include Business Add-Ins in the program
- Define an interface for the enhancement in the SAP menu under Tools-> ABAP Workbench -> Utilities -> Business Add-Ins (transaction SE18)
-Call the interface at the appropriate point in application program
-Customers can then select the add-in and implement it according to their needs
Let’s plan a simple task:
We want to convert strings in your application program is a specific way through Business Add-Ins technique
As the application developer, first task is to define an enhancement consisting of an interface & a method with a changing parameter to transfer value
Choose Tools ->ABAP Workbench -> Utilities -> Business Add-Ins (transaction SE18) from the SAP menu
Create a new Business Add-In containing a maximum of 20 characters and move to Interface Tab
Name of the interface is proposed by the system but may be changed
Save and double-click on the interface name to add a method
System branches to the Class Builder
Assign a method to the interface (default is Instance Method)
Add a parameter
Save and Activate
Definition screen(SE18) will now contain the method assigned to the interface
Documentation may be created to describe the intended functionality of this Add-Ins
BAdi Implementation
ABAP Workbench ->Utilities -> Business Add-Ins (transaction SE19)
Find the suitable Business Add-Ins present in system (Use IMG or Component hierarchy)
Use Add-Ins Documentation to understand functionality & to decide
Implement the Add-Ins
-a class is created with the same interface
-Finalize coding for the method
Implementations are discrete transport objects and lie within the namespace of the person or organization implementing them
Work on Simple Badi project – Continued…
Already structure of the interface defined
In order to create an implementation for the text conversion example, the add-in (in this case, the interface's method) needs to be filled with logic that converts the string. This logic will be run through every time the add-in is called from the application program
Choose ABAP Workbench ->Utilities -> Business Add-Ins (transaction SE19)
Create a new implementation and select the appropriate definition in the dialog box
Add a short text and move to Interface tab
Save
Double-click the method name when the system will take you to the code window for the method
Insert the desired source code for the implementation between the method if_ex_businessaddin~method. and endmethod. statements automatically provided to you by the system.
Save and return to the Change Implementation screen
On Activation, this implementation may be executed from the application program
Sample code to call Add-In from ABAP Program
To call static method of a global class directly, class … definition load statement is needed
Instance of the Adapter class is created and its method is executed
If enhancement needs to be different based on some parameter (e.g. country-specific or company-code specific), separate implementation of the same Add-In can be created and activated
At run time, the specific implementation will be execute
Possible through Filter-Dependent Badi
How it works
-Switch on Filter-dependency while defining the interface
-Select a suitable filter element
-All methods created in the interface will have filter 'FLT_VAL' as one import parameter
-Application program provides the filter value to the enhancement method
-The method then selects the active implementation for that value
What qualifies as a Filter
A Data element
Underlying domain may contain a maximum of 30 characters and must be of Character type
The data element must
-Either have a search help with a search help parameter of the same type as the data element and this parameter must serve as both the import and export parameter or
-the element's domain must have fixed domain values or a value table containing a column with the same type as the data element
Custom data element with the criteria may also be used
Implementing a Filter-Dependent Business Add-In
Implement the Add-In for each relevant filter value
However, multiple filter values may use the same implementation
Enter a characteristic filter value for the implementation
Calling a Filter-Dependent Business Add-In
Same as before
Pass the filter value as export parameter to the method
BAdi – some useful information
There can be more than one implementations of the same BADI definition, and in that case only the active implementations will be executed
You can activate or de-activate any of the implementations after creation
Enhancement, interface, and associated classes generated all lie in the appropriate application development namespace
Business Add-In implementations lie in the respective namespaces of the people who created them
Changes made to the interface and changes made to the Business-Add-In definition are always incompatible
-If implementations already exist for a Business-Add-In definition, they are invalidated if you make changes to the interface. This means that their syntax is no longer correct. No statements can be given on the runtime behavior. Avoid making changes to the interface or the Business-Add-In definition after the transport has taken place.
-If changes to the interface are inevitable, navigate to the Class Builder for all implementing classes and clean up the method includes of these classes (Utilities > Clean up > Method includes)
Thanks,

Similar Messages

  • Re: BADI +  ME21N  + internal table

    My task is this below using BADI...........! plz give solution for this task..
        1> I will enter all the details in me21n to create Standard PO no... When i click SAVE button in me21n,
    BADI should trigger &what r the details entered in the screen me21n should be moved to one internal tables... Is there any solution for this .... Plz replay me soon,,,,,,,,,,,!

    Hello,
    Once you save PO in ME21n transaction the following BADIs are triggered.
    REFERENCE_SITE     
    CACL_CHARACTER_INPUT
    ME_COMMTMNT_PO_RELEV
    ME_COMMTMNT_PO_REL_C
    ME_COMMITMENT_STO_CH
    ADJUST_NET_DAYS
    BUAVC_CHECK_RESTRICT
    ME_INFOREC_SEND           
    WVKU_DETERMINE_SP
    ME_CHECK_SOURCES
    LFM2_DB_STRG
    ADDRESS_UPDATE
    ME_PURCHDOC_POSTED
    EXTENSION_US_TAXES
    Among these BADIs  ME_PURCHDOC_POSTED is very useful. You will get the PO number and its corresponding details here.
    Method is POSTED and useful parameters are 
    IM_EKKO(New Purchasing Document Header) , IM_EKPO(New Items)
    Regards
    Arindam
    Edited by: Arindam Ganguly on Dec 24, 2008 5:34 AM

  • BAdi for Vendor Master Creation XK01

    Hello All ,
    I want to have a new subscreen in XK01 transaction .
    So i include it by implementing the Badi VENDOR_DATA_CS
    Now i can get a subscrenn in my transaction .
    But i couldn't transfer the value of the field from my subscreen to my main program ...
    Could someone guide me how i can proceed ...
    If the you know the exact coding what should be done and where should be done , Kinldy guide me
    DO i need to set some customization also ?

    Hi,
    Go thru this thread, this will help u with example...
    BADI ME21N
    Reagrds,
    Kumar

  • Custom Screen using BADI seen in ME23N, ME22N Display, but not in ME21N

    Hi,
    I have developed a custom screen for purchase order using badi ME_PROCESS_PO_CUST and ME_GUI_PO_CUST.
    But, its not visible in ME21N, whereas its dipalyed in ME23N, ME22N .
    Please advise.
    Thanks,
    Shivaa....

    In TC CMOD you can create a new proyect and use the component MEREQ001 with this component you can see adicional tab in those TC.

  • Error on BADI for ME21N

    Am doing and enhancement on transaction ME21N. Where I am validating a price based on the Purchase requisition.
    I implemented the BADI YWVKU_DETERMINE_SP and in method GET_SALES_PRICE I used my code.
    I created a custom message class in se91 to display the error message when we run me21n. I get a short dump as follows
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).
    Please assist

    This is part of the dump
    Error analysis
        Short text of error message:
    General system messages
        Long text of error message:
        Technical information about the message:
        Message class....... "ME"
        Number.............. 000
        Variable 1.......... "Price cannot be greater than 10% of PR"
        Variable 2.......... " "
        Variable 3.......... " "
        Variable 4.......... " "
    How to correct the error
        Probably the only way to eliminate the error is to correct the program.
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "MESSAGE_TYPE_X" " "
        "SAPLMEPO" or "MM06EF0B_BUCHEN"
        "BUCHEN"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP

  • BADI to uncheck free item indicator (field UMSON) in PO through ME21N)

    Hi All,
    I have a requirement to remove the UMSON ( free item ") indicator while creating a PO using ME21N transaction based on the input from user. If material starts with 'P' and it is a standard order, then this field should be unchecked for that particular item. I am implementing the BADI ME_PROCESS_PO_CUST and method CHECK. However, I find that though the PO is held and not saved, the value of UMSON field is not changed.
    This is the code.
    DATA:   lt_mepoitem   TYPE purchase_order_items,
            ls_mepoitem   TYPE purchase_order_item,
            ls_mepoheader TYPE mepoheader,
            ls_head       TYPE REF TO if_purchase_order_mm,
            ls_item       TYPE mepoitem,
            ls_local      TYPE ttyp_fieldselection_mm,
            ls_inval      TYPE REF TO if_purchase_order_item_mm,
            l_error       TYPE c.
      INCLUDE mm_messages_mac. "useful macros for message handling
      ls_mepoheader = im_header->get_data( ).
      lt_mepoitem = im_header->get_items( ).
      IF ls_mepoheader-bsart = 'NB' .
        LOOP AT lt_mepoitem INTO ls_mepoitem.
          ls_item = ls_mepoitem-item->get_data( ).
          IF ls_item-matnr(1) = 'P' AND ls_item-umson IS NOT INITIAL .
            ls_item-umson = space.
            l_error = 'X'.
            CALL METHOD ls_mepoitem-item->set_data
              EXPORTING
                im_data = ls_item.
          ENDIF.
        ENDLOOP.
        IF l_error = 'X'.
          ch_failed = 'X'.
          mmpur_message_forced 'E' 'ME' '303' text-001 '' '' ''.
        ENDIF.
      ENDIF.
    Can anyone tell me what I am missing or where this can be implemented?
    Thanks
    S R

    hi,
    With Error it won' t allow you to save PO.
    What i would suggest is that
      either you give message that indicator need to checked or unchecked as per condition. and let user change is manually and 
      you check it in BADI and then save it .
      or  you change free item check as per your requirement in BADi and give a information message that this item is to be checked for  free goods or need to be unchecked .

  • User exit or Badi for ME21N transaction

    Hi Gurus,
    In ME21N tranasaction i need to make the field 'Free Item' ( checkbox ) as a mandatory field at item over view level for specific document types. so that user can't  save the PO order with out checking the checkbox.
    So is there any exit or badi to achieve the functionality.
    Thanks in advance.
    Regards,
    krisc.

    Hi gurus,
    Thank you very much for your replies.
    I resolved this issue my self.
    Thanks,
    krisc.

  • User Exit or BADI for Updating Tax code (MWSKZ) using ME21N

    Hi all,
    I am trying to fin out an exit or badi for Updating Tax code (MWSKZ) and Unit of Measure in transaction ME21n.
    The scenario is like this...
    For Purchase Orders Tax code will be defaulted from Purchasing info record or contract or parameter id for that item-vendor-plant.
    If the Tax Code is not defaulted and account assignment is blank then tax code on the PO is updated according to the below mentioned table
    Table
    Supplying Plant/              Receiving Plant                      Tax code
    Vendor/Country
    Any plant/vendor/
    country                           5050(NA)                               20
    2300                              6700                                     E0
    If the tax code on PO cannot be updated by the above table, then buyer needs to put tax code on the purchase order manually.
    Thanks,
    Shiva, Bangalore

    Hi Siva.,.,.,
    These r the exits.,..,which will be called while calling ME21N/ME22N/ME23N
    EXIT_SAPMM06E_006
    EXIT_SAPMM06E_007
    EXIT_SAPMM06E_008
    EXIT_SAPMM06E_009
    EXIT_SAPMM06E_012
    EXIT_SAPMM06E_013
    EXIT_SAPMM06E_014
    EXIT_SAPMM06E_016
    EXIT_SAPMM06E_017
    EXIT_SAPMM06E_018
    U want to default some values while the Initial screen will come right,
    while u Enter ME21N in command Prompt.,.,two exits will get triggerd,
    EXIT_SAPMM06E_014
    EXIT_SAPMM06E_016
    If u want to Default some values u can use these two exits.,.
    Try using EXIT_SAPMM06E_016.,.this will solve ur purpose.
    and if the user changes some values on screen.,,and you want them to get reflected .,.,.that means if user changes and saves data .,.
    While saving.,.,EXIT_SAPMM06E_012 and EXIT_SAPMM06E_013 will get triggerd
    Try using EXIT_SAPMM06E_013.,,.it was somehow the same requirement as mine.,.,IN my case it worked fine.,.,
    Regards
    Debasish
    Message was edited by:
            Debasish Das

  • BADI/user exit for ME21N - Warning message for "our reference" field

    Dear all,
    I have a problem.
    In ME21N, I need to show a warning message (message w... ) when user enter an already-used-before input in "Our reference' field (EKKO-UNSEZ).
    I've tried in two methods.
    1. Using fm EXIT_SAPMM06E_004. But it can only works for Error message. My warning message never shows up.
    2. Tried to implement classic BADI ME_PROCESS_PO_CUST, using the PROCESS_HEADER method. Got the break-point spot on, but still didn't show the warning message.
    Why is my warning message always got override?
    Please advise.
    Thanks in advance
    Ahmad

    Hi Ahmad,
    Check the below links:
    Unable to put Warning messages in ME21N and ME22N in Exit / BAdI in ECC 6.0
    Warning message in me22n check user-exit can't process?
    Custome warning message in T. code me51n me52n & me21n , me22n
    Regards,
    Nisha Vengal.

  • Badi & User Exit for ME21N & ME22N

    Hi,
            My requirement is when a Purchase order is created using ME21n or when a line is added or changed using ME22n, the system should copy the vendors tax jurisdiction to the purchase order line items jurisdiction code. I tried badi (ME_PROCESS_PO_CUST) but could not suceed. Can any one tell me if any badi or user exit available for the same???
    Thanks in Advance.

    hi,
    Enhancement/ Business Add-in            Description
    Enhancement
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N
    MEVME001                                WE default quantity calc. and over/ underdelivery tolerance
    MM06E001                                User exits for EDI inbound and outbound purchasing documents
    MM06E003                                Number range and document number
    MM06E004                                Control import data screens in purchase order
    MM06E005                                Customer fields in purchasing document
    MM06E007                                Change document for requisitions upon conversion into PO
    MM06E008                                Monitoring of contr. target value in case of release orders
    MM06E009                                Relevant texts for "Texts exist" indicator
    MM06E010                                Field selection for vendor address
    MMAL0001                                ALE source list distribution: Outbound processing
    MMAL0002                                ALE source list distribution: Inbound processing
    MMAL0003                                ALE purcasing info record distribution: Outbound processing
    MMAL0004                                ALE purchasing info record distribution: Inbound processing
    MMDA0001                                Default delivery addresses
    MMFAB001                                User exit for generation of release order
    MRFLB001                                Control Items for Contract Release Order
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.
    AMPL0001                                User subscreen for additional data on AMPL
    LMEDR001                                Enhancements to print program
    LMELA002                                Adopt batch no. from shipping notification when posting a GR
    LMELA010                                Inbound shipping notification: Transfer item data from IDOC
    LMEQR001                                User exit for source determination
    LMEXF001                                Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001                                Customer-Specific Source Determination in Retail
    M06B0001                                Role determination for purchase requisition release
    M06B0002                                Changes to comm. structure for purchase requisition release
    MEFLD004                                Determine earliest delivery date f. check w. GR (only PO)
    MEETA001                                Define schedule line type (backlog, immed. req., preview)
    ME590001                                Grouping of requsitions for PO split in ME59
    M06E0005                                Role determination for release of purchasing documents
    M06E0004                                Changes to communication structure for release purch. doc.
    M06B0005                                Changes to comm. structure for overall release of requisn.
    M06B0004                                Number range and document number
    M06B0003                                Number range and document number
    Business Add-in
    ME_PROCESS_PO                           Enhancements for Processing Enjoy Purchase Order: Intern.
    ME_PROCESS_COMP                         Processing of Component Default Data at Time of GR: Customer
    ME_PO_SC_SRV                            BAdI: Service Tab Page for Subcontracting
    ME_PO_PRICING_CUST                      Enhancements to Price Determination: Customer
    ME_PO_PRICING                           Enhancements to Price Determination: Internal
    ME_INFOREC_SEND                         Capture/Send Purchase Info Record Changes - Internal Use
    ME_HOLD_PO                              Hold Enjoy Purchase Orders: Activation/Deactivation
    ME_GUI_PO_CUST                          Customer's Own Screens in Enjoy Purchase Order
    ME_FIELDSTATUS_STOCK                    FM Account Assignment Behavior for Stock PR/PO
    ME_DP_CLEARING                          Clearing (Offsetting) of Down Payments and Payment Requests
    ME_DEFINE_CALCTYPE                      Control of Pricing Type: Additional Fields
    ME_COMMTMNT_REQ_RE_C                    Check of Commitment Relevance of Purchase Requisitions
    ME_COMMTMNT_REQ_RELE                    Check of Commitment Relevance of Purchase Requisitions
    ME_PROCESS_PO_CUST                      Enhancements for Processing Enjoy Purchase Order: Customer
    SMOD_MRFLB001                           Control Items for Contract Release Order
    MM_EDI_DESADV_IN                        Supplementation of Delivery Interface from Purchase Order
    MM_DELIVERY_ADDR_SAP                    Determination of Delivery Address
    ME_WRF_STD_DNG                          PO Controlling Reminder: Extension to Standard Reminder
    ME_TRIGGER_ATP                          Triggers New ATP for Changes in EKKO, EKPO, EKPV
    ME_TRF_RULE_CUST_OFF                    BADI for Deactivation of Field T161V-REVFE
    ME_TAX_FROM_ADDRESS                     Tax jurisdiction code taken from address
    ME_REQ_POSTED                           Purchase Requisition Posted
    ME_REQ_OI_EXT                           Commitment Update in the Case of External Requisitions
    ME_RELEASE_CREATE                       BAdI: Release Creation for Sched.Agrmts with Release Docu.
    ME_PURCHDOC_POSTED                      Purchasing Document Posted
    ME_PROCESS_REQ_CUST                     Enhancements for Processing Enjoy PReqs: Customer
    ME_PROCESS_REQ                          Enhancements for Processing Enjoy PReqs: Internal
    ME_COMMTMNT_PO_REL_C                    Check for Commitment-Relevance of Purchase Orders
    ME_CCP_BESWK_AUTH_CH                    BAdI for authorization checks for procuring plant
    ME_CCP_ACTIVE_CHECK                     BAdI to check whether CCP process is active
    ME_BSART_DET                            Change document type for automatically generated POs
    ME_BAPI_PR_CREATE_02
    ME_BAPI_PR_CREATE_01
    ME_BAPI_PO_CREATE_02
    ME_BAPI_PO_CREATE_01
    ME_BADI_DISPLAY_DOC                     BAdI for Internal Control of Transaction to be Invoked
    ME_ACTV_CANCEL_PO                       BAdI for Activating the Cancel Function at Header Level
    MEGUI_LAYOUT                            BAdI for Enjoy Purchasing GUI
    EXTENSION_US_TAXES                      Extended Tax Calculation with Additional Data
    ARC_MM_EKKO_WRITE                       BAdI: Enhancement of Scope of Archiving (MM_EKKO)
    ARC_MM_EKKO_CHECK                       BAdI: Enhancement of Archivability Check (MM_EKKO)
    ME_CCP_DEL_DURATION                     Calc. of Delivery Duration in CCP Process (Not in Standard)
    ME_COMMTMNT_PO_RELEV                    Check for Commitment-Relevance of Purchase Orders
    ME_COMMITMENT_STO_CH                    BadI for checking if commitments for STOs are active
    ME_COMMITMENT_RETURN                    Commitment for return item
    ME_CIP_REF_CHAR                         Enables Reference Characteristics in Purchasing
    ME_CIP_ALLOW_CHANGE                     Configuration in Purchasing: Changeability Control
    ME_CIN_MM06EFKO                         Copy PO data for use by Country version India
    ME_CIN_LEINRF2V                         BADI for LEINRF03 excise_invoice_details
    ME_CIN_LEINRF2R                         BADI for CIN India - Delivery charges
    ME_CHECK_SOURCES                        Additional Checks in Source Determination/Checking
    ME_CHECK_OA                             Check BAdI for Contracts
    ME_CHECK_ALL_ITEMS                      Run Through Items Again in the Event of Changes in EKKO
    ME_CHANGE_OUTTAB                        Enrich ALV Output Table in Purchasing
    ME_CHANGE_CHARACTER                     Customer-Specific Characteristics for Product Allocation
    No.of Exits:         35
    No.of BADis:         55
    Arunima

  • BADI for Disabling NetPrice field in ME21N & ME22N based of Material Type.

    Hi.
    I had a requirement to disable "net price" field while creating or changing a PO (ME21N & ME22N) based on the type of material entered.
    Please asssit me in finding the BADI or exit name which can meet my requirement. Thanks.

    Hi Ranga nadh,
       The BAdi what you have mentioned is correct.
    ME_PROCESS_PO_CUST - In this BAdi, we are having a method PROCESS_ITEM. These method is used to process all the Item data. As the field Netprice is at the level. You can use this method.
    Here inside this method we are having a parameter IM_ITEM
    So, You create a implementation and inside this method you can code here to appear the field in disable mode.
    Cheers,
    Swamy Kunche

  • User EXIT, BADI for T-code ME21n, ME21

    Hi Guru's,
    I have rquirement where for some company codes user dont want GR and GR based invoicing if net price for PO is less than 100 GBP as it is very small quantity.
    To achive this we have to uncheck Goods receipt check bax from tab 'Delivery'  and uncheck inv. receipt check box from tab 'Invoice' of item level view at the time of PO creation.
    Now, i am serching for User exit or BADI which will serve this purpose, as T-code ME21n is enjoy transaction for ME21 i dont think we will get any user exit, we have to do it through BADI.
    If anyone has done something like this and have idea how i can achive this please revert back.
    regards,
    Rahul

    http://www.erpgenie.com/sap/abap/code/abap26.htm
    which gives the list of exits for a tcode
    Below code will give a list of BADIs for particular 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.
    It may help you.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Need the user exit/BADI name for Reverese order MIGo- ME21N(changing item)

    Hi
    I have the below requirement.
    I am changing the item details in the transaction MIGO transaction,the value of MSEG entries
    are got changed.and also it should change in the Purchase order level also(in the table EKKO).
    Can anybody tell me the User Exit /BADI name which is triggered in the Reverse order
    i.e MIGO -> ME21N.So that i can implement my code in the reverse order in the User Exit/BADI.

    hi I did not find any paramater type EKPO in the Exporting or changing of any methods in the BADI's given by you...........

  • EXIT BADI FOR ME21N ME22N AND ME23N

    Hello Boys.
    I want  to change the field 'Tax code' (MWSKZ) in a Purchase order on transaction ME21N, ME22N AND ME23N.
    I want to change thios field in a BADI, USER EXIT or ENHANCEMENT-POINT.
    But I can't find where change this field.
    thanks for your help.
    Best regards.

    Try Badi : ME_PROCESS_PO_CUST
        CALL METHOD im_item->get_data
          RECEIVING
            re_data = v_data_item.
    Your code to change the tax code
    CALL METHOD im_item->set_data( v_data_item ).
    <REMOVED BY MODERATOR>
    Edited by: Aparna Shekhar on Jun 12, 2008 11:33 AM
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:52 PM

  • In ME21N,User Exit/BADI for  Defaulting  Vendor number at item level.

    Hi Experts.
    In ME21N, for every purchase order, we have condtion tab for each line item.
    Many condition typesot taxes  are listed based on the config for the materials.
    My requirements is, When we go inside by selecting a condition type we find vendor number displayed.
    I need a user exit/BADI for defaulting the Vendor number.
    Regards
    Balaji R

    Hi,
    check with below link,
    fo this one you will find both user exit and badis
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/find%252bapplication%252bclass%252bwith%252bexits%252band%252bbadis%252bfor%252ba%252btransaction
    Regards,
    Madhu

Maybe you are looking for

  • Itunes movies wont play on computer, itunes keeps asking for authorisation

    The movies in my itunes will not play on my computer. Itunes continaually asks for computer to be authorised, then once authorised it says that the computer is already authorised then asks for authorisation again. Movies will however play on ipad. An

  • Is there a bug in Mac Mail

    I've read several other threads that seem to describe a problem similar to my own. None of these threads seem to offer a proper solution. Maybe by stating the problem clearly, someone will tell me how to proceed. I just got a new imac with Lion onboa

  • Yahoo! Maps prevent module from loading!?

    Hi All, I'm trying to implement a map control in Flex 4, and thought Yahoo! Maps would be a good place to start (please do suggest a better alternative, if you know one). I have my map control in a module. The module load fine without the Yahoo map b

  • Coding actions

    Hi. I was wondering how can I code actions for automator. I want, for example, to have shell scripts to act as actions if possible, or, I don't know what, python scripts, whatever else. I was wondering how is that possible. Thanks

  • Document edits not printing

    Afternoon All, Supporting a user using Acrobat 9.0 (Standard / Professional etc. unknown but this can be found out) who has received a PDF as an attachment in an email. When she opens it, the edits that were made by a previous user to the document sh