Whats the use of having pragma autonomous transaction

Hii All,
The below is the procedure developed by our predecessors.We are making use of this for writing our debug messages.
I'm aware of pragma autonomous transaction ,this allows my code to run independently of the calling program.
But here we are just using utl_File and we are neither using any DML(Inserting error messages into a table) or DDL statements in the below code.
What is real use of having pragma autonomous transaction.???This code is working in the same way even without the pragma...I dont' find any difference .
Please let me know the use of having pragma autonomous transaction in the below procedure and where it actually comes into usage.
Create or replace Procedure logmesg
p_file_name          in          varchar2,
p_mesg_text          in          varchar2,
p_dir_path          in          varchar2 default fn_get_debug_path,
p_file_ext          in          varchar2 default 'log',
p_append_flag     in          varchar2 default 'Y'
) Is
          pragma autonomous_transaction;
          l_utl_file                    utl_file.file_type;
          l_append_flag               varchar2(1);
          l_mesg_text                    varchar2(32000);
          l_file_name                    varchar2(3000);
          l_dir_path                    varchar2(32000);
          l_delimeter_occurance     number;
          l_buffer_str               varchar2(32000);
Begin
          if trim(p_dir_path) is null then
               l_dir_path     := fn_get_debug_path ;
          else
               l_dir_path := p_dir_path;
          end if;
          l_mesg_text := p_mesg_text;
          l_append_flag := nvl(p_append_flag,'Y');
          l_file_name     := p_file_name||'_'||to_char(sysdate,'ddmmyyyyhh')||'.'||p_file_ext;
          l_append_flag := Case     l_append_flag
                                   When 'Y' then 'a'
                                   When 'N' then 'w'
                               End;--l_append_flag
          Begin
               l_utl_file := utl_file.fopen(l_dir_path,l_file_name,l_append_flag);
          Exception
               When Others Then
                    l_utl_file := utl_file.fopen(l_dir_path,l_file_name,'w');
          End;
          if dbms_lob.getlength(l_mesg_text) > 32000 then
               loop
                    exit when dbms_lob.getlength(l_mesg_text) < 32000;
                    l_delimeter_occurance := dbms_lob.instr(l_mesg_text,chr(32),1,1);
                    l_buffer_str := dbms_lob.substr(l_mesg_text,l_delimeter_occurance-1);
                    utl_file.put_line(l_utl_file,l_buffer_str);
                    l_mesg_text := dbms_lob.substr(l_mesg_text,l_delimeter_occurance+1);
                    utl_file.fflush(l_utl_file);
               end loop;
          end if;
          utl_file.put_line(l_utl_file,l_mesg_text);
          utl_file.fflush(l_utl_file);
          utl_file.fclose(l_utl_file);
End logmesg;
/Here

Please let me know the use of having pragma autonomous transaction in the below procedure and where it actually comes into usage.Seems it is redundant in that procedure, and doesn't add any value, since the procedure isn't doing anything 'transactional'.
I would remove it.

Similar Messages

  • What is pragma autonomous transaction

    Pragma Autonomous transaction:-
    -- When ever we commit.. all the transactions before the last commit in that session get saved. Suppose that if we hav a senario & we jst want a particular transaction only 2 be save. Inorder to achive that we make this as a seperate transaction which can b commited but prior to this the txns are not commit.
    eg:
    being
    insert into tab1 () values ();
    update tab2 set values.. some more stmts..
    pragma sutonomus transaction
    insert into tab3 values();
    commit;
    here.. insert into tab3 is only commited & saved but not tab1 and tab2.
    Pls let me know if this correct approach to build the Pl/Sql

    Better yet, here's the section of the manual:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#sthref1514

  • What the advantages of having an BAPI over Other data migrations

    What the advantages of having an BAPI over Other data migrations

    Th advantages of BAPI
    1. Simple to use (its just an FM)
    2. Not cumbersome like bdc
    where we have to record each and every screen
    sequence.
    3. SAP guarantees the consistency
    of bapi in future releases.
    One of the big plusses for BAPIs is that the interface and function are not supposed to change. This is a big plus when you do upgrades or hot packs because the transaction can change (format, required inputs etc) which means you then need to update the call transaction.
    Some of the BAPIs are better documented and easier to use than others.
    You usually need to perform the BAPI that actually does the COMMIT after you call your BAPI.
    The Program coding for calling a BAPI is usually cleaner than setting up the screen flow etc for the Call Transaction.
    You don't need to worry about special data circumstances interrupting the normal data flow of the screens and causing errors because of that.
    BAPIs probably have better performance since they don't do the screen flow processing.
    In general if the BAPI exists for the transaction you want to perform and you can figure out how to use it the BAPI is probably the best way to go.
    This is just from my experience working with both BAPI and Call Transaction. I have had some very good successes with BAPIs, but very occasionally found that I could not get the BAPI to perform the update I needed.
    Refer the transaction BAPI for detail information.
    You can also refer to below links:
    http://www.sapgenie.com/abap/bapi/example.htm
    Basic learning guide:
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    BAPI intro:
    http://www.sappoint.com/abap/bapiintro.pdf
    Overview:
    http://www.planetsap.com/Bapi_main_page.htm
    Also have a look at the following link :
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    Go through the following Document
    Bapi to create customer master
    BAPI_CUSTOMER_CREATEFROMDATA
    BAPI_CUSTOMER_CREATEFROMDATA1
    Or you can use FM SD_CUSTOMER_MAINTAIN_ALL
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module
    ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access.
    Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects.
    You create business objects and those are then registered in your BOR (Business Object Repository)
    which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.
    In this case u only specify the business object and its method from external system
    in BAPI there is no direct system call. while RFC are direct system call.
    Some BAPIs provide basic functions and can be used for most SAP business object types.
    These BAPIs should be implemented the same for all business object types.
    Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.
    Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values,
    for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved
    and returned to the calling program.
    The instance is identified via its key.
    The BAPI GetDetail() is an instance method.
    BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed
    so that they can be called several times within one transaction.
    For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction,
    the second BAPI call must not affect the consistency of the sales order 2.
    After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type,
    for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type,
    for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database
    or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type.
    The instance to be cancelled remains in the database and an additional instance is created
    and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst!
    ance and the BAPI and Remove<subobject> removes a subobject from an object instance.
    These BAPIs are instance methods.
    Check these Links out
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    http://www.sap-img.com/fu033.htm
    http://www.sap-img.com/abap/ale-bapi.htm
    Please check out this thread..
    Re: bapi
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    Java Connector(JCO) can call not only BAPI's but also the function modules which are remotely enabled..
    BAPI's as i said earlier are remotely enabled function modules..
    Hence, JCO can call also BAPI's(n not only BAPI's as u mentioned).
    Check the following BDC over BAPI
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit
    so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.

  • Whats is table type ? whats the use of it in abap?

    hi,
    i am ahmed abap fresher,
         i want to know what is table type and whats the use of it. at what point/situation we utilize this table type.

    Hi Ahmed ,
    Table is apart of data dictionary.
    Table is a sort of container where we store data.
    For eg. you want to store customer record in the database.Now you will store that customer record against specific fields of the applicable table.
    You can create or see table by means of transaction code se11.
    There are 3 typesof tables available in SAP ABAP:
    1. Transparent table
    2. Pool table
    3. Cluster table.
    Transparent Table:
    A physical table definition in the database for the table definition which is stored in the ABAP Dictionary for transparent tables when the
    table is activated. The table definition is translated from the ABAP
    Dictionary to a definition of the particular database.
    Pooled table:
    Pooled tables can be used to store control data (e.g. screen sequences,
    program parameters or temporary data). Several pooled tables can be
    combined to form a table pool. The table pool corresponds to a physical
    table on the database in which all the records of the allocated pooled
    tables are stored.
    Cluster table:
    Cluster tables contain continuous text, for example, documentation.
    Several cluster tables can be combined to form a table cluster. Several
    logical lines of different tables are combined to form a physical record
    in this table type. This permits object-by-object storage or
    object-by-object access. In order to combine tables in clusters, at
    least parts of the keys must agree. Several cluster tables are stored in
    one corresponding table on the database.
    See the documetation at:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    Reward if useful ...
    Regards ,
    Shankar GJ

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • Whats the use of 'Maximum Councurrency' in File Receiver adapter?

    Hi All,
            Whats the use of 'Maximum Councurrency' in File Receiver adapter?
    Xier

    Hello,
    Refer the  below thread and check it out my reply . I gave for JDBC adapter, but the concept is same for File/JDBC.
    Re: JDBC Adapter - One Connection prior to SP20
    Best regards,
    raj.

  • Why interface property be default final whats the use of that

    can anybody explain me
    when i declared a variable inside the interface its always public static final.
    why its static and final what the use of theat. its set of rule or it has any reason.

    Sir,
    You do not have much choice:
    From the JLS (9.3):
    "Every field declaration in the body of an interface is implicitly public, static, and final. It is permitted to redundantly specify any or all of these modifiers for such fields."
    Note from this though that you do not have to explicitly declare a field in an interface as public / static / final if you dont want to - if you leave it out the field is implicitly declared with these attributes.
    So you could wite:
    public interface SirInterface {
      public int HeIsActuallyPublicStaticFinal = 1;
    }

  • WHATS THE USE OF TABLE STRIP CONTROL AND TABLE VIEW CONTROL

    WHATS THE USE OF TABLE STRIP CONTROL AND TABLE VIEW CONTROL

    Subhash,
    You create and distribute a model in BD64. The details of that are stored in this tables.
    A model gives you the details of the sender / receiving systems and what are the message types that are getting transferred between these systems.
    Regarding the IDOC segments issue, can you explaing how are you triggering the IDOC and which message / idoc type you are dealing with.
    Regards,
    Ravi
    Note :Please mark the helpful answers
    Message was edited by: Ravikumar Allampallam

  • Whats the use of sap queries

    whats the use of sap queries

    Hi,
    http://www.sap-img.com/abap/what-is-sap-queries.htm
    http://www.informit.com/articles/article.asp?p=664660&rl=1
    def sap query
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a5625e09411d2acb90000e829fbfe/content.htm
    In HR
    You can use SAP Query in HR to report on HR data.
    how to create sap query
    http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb4145455611d189710000e8322d00/content.htm
    for maintain SAP query in HR
    http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb42cb455611d189710000e8322d00/content.htm
    http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb455f455611d189710000e8322d00/content.htm
    If you want to create InfoSets for HR, you can use logical databases PNP, PAP, and PCH . The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
       1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
       2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
       3. Choose .
    This takes you to the Infotype Selection for InfoSet  screen. You now have the option of creating field groups and assigning fields as required for non-HR InfoSets. Field groups that correspond to infotypes and already contain fields, however, are always created for HR InfoSets. The field groups are displayed in an overview tree in the top right section of the screen.
    The infotypes that you included in the InfoSet are displayed in an overview tree on the left of the screen. The infotype fields that are already included in field groups are displayed in a different color, and the field group ID is displayed.
    In the standard system, a field group is created automatically for each infotype that you included in the InfoSet (a field group corresponds to an infotype).
    In the standard system, each field group contains the infotype-specific fields. To ensure that working with the InfoSet is as easy as possible, you are advised to restrict your use of fields in each field group to those you really require. This means you should remove fields that are not required.
    An infotype's fields must only be assigned to the pertinent field group. Make sure this assignment is correct. If the assignment is incorrect, the InfoSet could be rendered unusable.
    When an InfoSet is created, the following fields are transferred automatically to the first field group:
    Logical database PNP Personnel number
    Logical database PAP Applicant number
    Logical database PCH Object ID, plan version, and object type
       6. Determine the fields that must be included in the field groups of your InfoSet. If you require further information, see
          Assigning Fields to a Field Group.
    If you want, you can change the default sequence of field groups and fields as required using drag & drop.
       7. To save the InfoSet, choose .
       8. To generate the InfoSet, choose .
          On the Change InfoSet (InfoSet name) screen, you can choose Edit ® Change infotype selection to add more infotypes to the InfoSet, or to remove infotypes from the InfoSet. Remember to regenerate the InfoSet afterwards.
          This screen also enables you to update InfoSets if, for example, the system contains new additional fields for specific key values. To do so, choose InfoSet ® Additional functions ® Update additional HR fields.
       9. Go back to the initial screen for InfoSet maintenance.
      10. Choose User group assignment.
      11. Select a user group, and save your entry.
    Please reward points.

  • Whats the use of assigning price list to site

    hi ,
    Why we assign price list in site (wb01) merchandise category?is that price list the same which i assign in "assign pricing type/reference site to organisational levels" in sales price calculation.explain me whats the use of assigniing the price list in siter(wb01) merchandise category which we will find on the top screen inside the site master
    regards
    krish

    Hi Krish
    Price list are assigned to article through MC at site master, no where else we define price list with article. When you run WPMA to transfer article price to stores, system will look at assigned price list with MC at site master then transfer the price.
    Price list assign at organisational level will help system to find which pricing procedure to be used and which store Net purchase price to be taken for calculation.
    Best Regards
    Swami

  • Whats the use of TC we16

    Hi all
    whats the use of TC we16 ?
    K S GREWAL

    Grewal,
    This is the inbound testing tool for IDoc files. Enter the path and file name for the IDoc file and the File Port set up to bring it in. Make sure it matches the File Port used in the Partner Profile for your Partner and IDoc Message Type.
    So I would recommend to run only in DEV.
    ---Satish

  • Whats the use of doget and dopost

    hi
    whats the use of doget and dopoast when same work can be done by sevice alone?
    Message was edited by:
    pooja_k_online

    Try looking at the Tomcat implementation of HttpServlet.service() method. I have pasted it below, if you look at the service() method all it does is to check for the method and call the appropriate method. It is not recommended to override the service method. It is a good practice to only override the getXXX() methods.
    protected void service(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException
    String method = req.getMethod();
    if(method.equals("GET"))
    long lastModified = getLastModified(req);
    if(lastModified == -1L)
    doGet(req, resp);
    } else
    long ifModifiedSince = req.getDateHeader("If-Modified-Since");
    if(ifModifiedSince < (lastModified / 1000L) * 1000L)
    maybeSetLastModified(resp, lastModified);
    doGet(req, resp);
    } else
    resp.setStatus(304);
    } else
    if(method.equals("HEAD"))
    long lastModified = getLastModified(req);
    maybeSetLastModified(resp, lastModified);
    doHead(req, resp);
    } else
    if(method.equals("POST"))
    doPost(req, resp);
    else
    if(method.equals("PUT"))
    doPut(req, resp);
    else
    if(method.equals("DELETE"))
    doDelete(req, resp);
    else
    if(method.equals("OPTIONS"))
    doOptions(req, resp);
    else
    if(method.equals("TRACE"))
    doTrace(req, resp);
    } else
    String errMsg = lStrings.getString("http.method_not_implemented");
    Object errArgs[] = new Object[1];
    errArgs[0] = method;
    errMsg = MessageFormat.format(errMsg, errArgs);
    resp.sendError(501, errMsg);
    }

  • What the "use JSP presentation" check box does?

    Can someone tell me what the "use JSP presentation" check box does? (can't find any documentation)
    When I set "Implementation type" to "BPM Object Interactive Call' if a check "use JSP presentation" instead of "Use BPM Object Presentation" and I enter a JSP name can I cause the process to start a JSP ?

    Hello,
    The option is intended to use a JSP instead of a form for a BPM Object interactive call. This means that you have to prepare your custom JSP, add a special tag library provided by Fuego and "mark" your html tags deciding which of them will become the attributes for the instance of your BPM Object.
    Whitin the page you can also call some methods of your objects.
    Finally you can post back the data and automatically update your object in the process. There is no much documentation and it's even quite old. Take a look here: [http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html]
    The JSP will be shown as a normal interactive activity popup window. You can customize it as you like, even adding some client side script.
    HTH
    G

  • What is the use of having process profiles in SPP?

    Dear all,
    what is the use of process profile in spp? it says we use it for specifying packaging methods and packaging sizes, but what are they used for?
    can someone throw some light on it please?
    regards,
    binod

    Hi Binod,
    You define a process profile in Customizing for SCM Basis under Planning Service Manager ® Define Process Profile. A process profile includes a method for package creation and the maximum number of planning objects that a package can contain.
    This is one of the steps in creating a Planning Service Manager Jobs.
    If you setup a PSM job and run it then you get a clear idea.
    Please have a look at the below link:-
    http://help.sap.com/saphelp_scm2007/helpdata/en/42/cc2978ebc16bb1e10000000a1553f6/frameset.htm
    Thanks,
    KD

  • What is badi&bapi  whats the use for both

    plz send me reply

    Hi Rajyalakshmi,
    <b>BADI</b>
    Business add-ins are enhancements to the standard version of the system.
    Business Add-In is a new SAP enhancement technique based on ABAP Objects.
    They can be inserted into the SAP system based on specific user requirements.
    Each Business Add-In has:
    • at least one Business Add-In definition
    • a Business Add-In interface
    • a Business Add-In class that implements the interface
    In order to enhance a program, a Business Add-In must first be defined
    Subsequently two classes are automatically generated:
    • An interface with ‘IF_EX_’ inserted between the first and second characters of the BADI name.
    • An adapter class with ‘CL_EX_’ inserted between the first and second characters of the BADI name.
    The Application developer creates an interface for this Add-In.
    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).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the 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. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    Set flag field "Buffer trace"
    Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
    Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
    Push the button "Deactivate Trace".
    Push the button "Display Trace".
    The popup screen "Set Restrictions for Displaying Trace" appears.
    Now, filter the trace on Objects:
    • V_EXT_IMP
    • V_EXT_ACT
    Push button "Multiple selections" button behind field Objects
    Fill: V_EXT_IMP and V_EXT_ACT
    All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
    So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
    3. 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.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    Have a look at http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    <b>BAPI</b>
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    BAPI Links :
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    http://www.sap-img.com/fu033.htm
    http://www.sap-img.com/abap/ale-bapi.htm
    Re: bapi
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

Maybe you are looking for

  • New iCloud with old Apple ID???  How do I create a new one..

    I have a old applet ID [email protected] and a old iCloud I'd [email protected] from my IPAD.. I just got a iPhone 5 and want to setup a new iCloud like [email protected] which is within the same apple ID [email protected] I try to make one which I t

  • Documents needed for ESS/MSS configuration

    Hi, I am an HR-ABAP Consultant and new to ESS/MSS objects. Can anyone provide me some documents related to configuration and development work related to ESS/MSS e.g. configuration of business packages, creation of ivews related to personnel informati

  • Request for Asset

    Hi.. Can somebody tell me what the best report could i request where these values are present 1.) ASSET KEY MAJOR CATEGORY MINOR CATEGORY COST ACCUMULATED DEPRECIATION NET BOOK VALUE 2.) PERIOD (MONTH) DEPRECIATION 3.) INVENTORIABLE EXPENSE (These th

  • Satellite U845W-S400 - how to open-up the laptop to put in a SSD

    Hello everyone, I would like to know how to open-up the laptop to put in a SSD. It has 6 screws on the bottom and I assume some under the keyboard. I do need a guide however to know for sure where they are before I start prying things open and might

  • Remove images from camera album when in a folder

    I created a images folder (in the photos app) and transferred some of my pictures there. How can I remove those pictures from my main camera roll without removing it from the folder? Note: I am using a iPhone 3GS with iOS 5.