When is it necessary to declare a transaction?

I am struggling to understand when it is necessary to declare my own transaction to ensure the data is properly updated.
For example, in the following code, which is part of a java bean in the EJB project, KeyFacade is a stateless session bean tied to the entity "Key". it is a standard EJB created with the netBeans 5.5 wizard. I have changed no defaults. Do I need to declare a transaction, commit the transaction and close it when I use the "KeyFacade.edit(key);" in order to ensure the database is updated? Or is it automatically done because the .edit() method uses the entityManager and the persistence is container managed? Would it make a difference if this bean was part of a WAR project?
    public BigInteger getNextKey(String tableName){
        KeyFacadeLocal KeyFacade = this.lookupKeyFacade();
        Key key = KeyFacade.findByTablename(tableName);
        long nextKey = key.getKeyvalue();
        BigInteger BINextKey =BigInteger.valueOf((int)nextKey);
        //  now update the table by incrementing the key value by 1
        long incrementKey = nextKey + 1;
        key.setKeyvalue(incrementKey);
        KeyFacade.edit(key);
        return BINextKey;
    }

It depends where the method is defined. If it's defined as a business method of an EJB 3.0
Session Bean, then the default is container-managed transactions with a transaction attribute
of Required. That means if there is an existing transaction that is propagated into the business
method invocation , the work performed within the method occurs within the incoming transaction.
If there is no transaction propagated into the business method, the EJB container will automatically
start a new one and commit it after the business method completes. This container-managed
transaction demarcation behavior has nothing to do with what code is in the business method.
You can change the transaction behavior of the EJB by using the @TransactionManagement
and @TransactionAttribute annotations at either the class or bean level, as well as within ejb-jar.xml.
The web tier doesn't have any notion of container-managed transactions. To start a global
transaction from code running in the web tier, you would need to acquire the UserTransaction
object and explicitly start and commit the transaction.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Do I need to declare a transaction in this case?

    I am struggling to understand when it is necessary to declare my own transaction to ensure the data is properly updated.
    For example, in the following code, which is part of a java bean in the EJB project, KeyFacade is a stateless session bean tied to the entity "Key". it is a standard EJB created with the netBeans 5.5 wizard. I have changed no defaults.
    Do I need to declare a transaction, commit the transaction and close it when I use the "KeyFacade.edit(key);" in order to ensure the database is updated? Or is it automatically done because the .edit() method uses the entityManager and the persistence is container managed?
    Would it make a difference if this bean was part of a WAR project?
        public BigInteger getNextKey(String tableName){
            KeyFacadeLocal KeyFacade = this.lookupKeyFacade();
            Key key = KeyFacade.findByTablename(tableName);
            long nextKey = key.getKeyvalue();
            BigInteger BINextKey =BigInteger.valueOf((int)nextKey);
            //  now update the table by incrementing the key value by 1
            long incrementKey = nextKey + 1;
            key.setKeyvalue(incrementKey);
            KeyFacade.edit(key);
            return BINextKey;
        }

    808239 wrote:
    I have a Map<Integer, List<T>> data, and all the lists are initialized using Collections.synchronizedList().Seems like overkill to me. Your Map also looks like a Multimap, of which there are several existing implementations.
    When I do the traversal, I want to traverse ALL lists in the map at the same timeI suspect not. What you want to do is to traverse each one in sequence.
    so I have to sync all lists as shown in the API doc as follows: ...Seems like overkill to me, and will probably result in a very slow Map (not that there's any problem with that if it's the right thing to do; in this case, I suspect it isn't).
    Is this approach ok?What are you trying to achieve? If you need full consistency for your iterators (ie, a snapshot of the entire Map at the time the iterator is created), you have a two choices (assuming you don't want to deal with update journals):
    1. Lock the Map.
    2. Clone the Map (and your clone() method should be synchronized).
    Of the two, the second seems best to me, but neither is all that wonderful.
    However, if all you need is weak consistency - that is to say, what you return reflects the state of the Map when Iterator.next() is called - all you really need to do is make sure that your Lists are synchronized when you do the read.
    Since the List updates are the responsibility of your Map (I'm still presuming this is some sort of Multimap implementation), there's no real need to synchronize them; just synchronize the Map's own update methods.
    I'd also suggest that you make sure your getValue() method hands back an [url http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#unmodifiableList%28java.util.List%29]unmodifiable List to clients; otherwise they could start adding or removing values themselves.
    HIH
    Winston

  • Is commit necessary to end autonomous transaction?

    CREATE OR REPLACE TRIGGER TRIG_EMP
    AFTER UPDATE
    ON EMP
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    CNT NUMBER := 0 ;
    BEGIN
    --PROCE_TRIG_TEST_EMP;
    SELECT COUNT(*)
    INTO CNT
    FROM EMP;
    UPDATE EMP_bkp
    SET COMM=999
    WHERE ENAME ='SMITH';
    -- COMMIT;
    DBMS_OUTPUT.put_line('TRIG_EMP CALLED.. DONE: '||CNT);
    END;
    Error: "autonomous transaction detected "
    if i open update n block commit code then error.
    if i block both update n commit code then without commit code is running fine.
    My Ques: If commit is necessary to end autonomous transaction then when i m blocking update n commit lines then too running without above error?
    plz clear my concept..
    pc

    PC wrote:
    thanks ..I will take care of it i.e. "IM".
    In above code when I am blocking both "update & commit code lines" then there is no error raised by program.
    I am using commit when I need that my "update transaction must be commit",if I am only taking "count of table emp" then no need of commit...
    Like this I am not getting any exception..!Doing anything on the same table that caused the trigger to fire can lead to you getting a mutating table error, so care should be taken in that respect.
    I got your point that I must commit and I will use it but here if I am using autonomous transaction without commit then I must get error but I am not facing ..plz guide me againThe point of an autonomous transaction is to effectively make Oracle spawn off a seperate transaction. Usually we consider that we have just a single transaction per session at any one time, but there are times, like when we need to log errors or audit something, that we want to ensure something get's written to a table, even if the transaction we are in needs to be rolled back or is about to raise an exception. In such cases we use an autonomous transaction to spawn the seperate transaction to perform that task. Good design would have that autonmous transaction as a seperate procedure to be called (rather than in the trigger itself) to keep it completely seperate from the current transaction, and thus when that seperate procedure finishes, any changes it has made must be committed or rolled back because the autonomous transaction that has been spawned is about to finish. Of course, if that procedure doesn't actually do any work on the database that requires committing or rolling back, then it's not necessary to issue one, but then there would be no need for an autonomous transaction in the first place.
    So, with your trigger (let's ignore that fact that making the trigger autonomous is p!ss poor design), if you only do the count and don't do the update statement, then there is nothing to be committed, so there's no need for a commit statement, even if the trigger is defined as an autonomous transaction. But, if you include the update statement, then that spawned transaction must be committed before the trigger ends, so that the transaction is completed and control can return to the calling transaction. So, making your trigger autonomous doesn't mean that it must commit by itself... but making it autonomous and including something that needs committing, does mean it must commit.

  • When we have to go for session method, when we have to go for call transact

    when we have to go for session method, when we have to go for call transaction method if i have a 3000 records in flat file. which is better? why

    Data Transfer
    During the process of data transfer, data is transferred into the SAP R/3 System. This transfer is from an external system to SAP R/3 system. Whenever you transfer data from an external system into an R/3 System, you can use data transfer because it is installed and regularly transfers data from an external system into an R/3 System.
    As discussed, with the help of BDC, you can transfer the required data from a non-SAP system to an SAP system. For this kind of data transfer you are required to write an ABAP program. This ABAP program would help to export the concerned data to a sequential dataset file. The data in this file has to be stored. This should be stored in a format, which is acceptable to SAP batch input program. But, to transfer data from a SAP system to another SAP system, you can take the aid of RFC or CPI-C.
    SAP application supports the data transfer of numerous SAP business objects. The said data transfer program specifies the data format definition, which is necessary to import the data into the R/3 System. There are three methods available for transferring data:
    Direct Input:
    In this method the SAP function modules execute the consistency checks. However, there are other means of checking with the help of screens. The Direct Input Method has considerable performance advantages.
    Call Transaction:
    In this method you can check the data consistency with the help of screen logic.
    Batch Input Session:
    In this method data consistency is checked with the help of screen logic.
    Direct Input Method
    Among the methods of data transfer through BDC, direct input method is the one that is used, especially in case of transferring large amount of data. In order to enhance the batch input procedure, the system offers you with the direct input technique.
    There is a distinction between the batch input technique and this technique. Unlike batch input technique, this technique does not create sessions. Instead, it stores the data directly. Moreover, it does not process screens. The data has to be entered directly into the corresponding database tables. The system calls a number of function modules which execute necessary checks, if any required. In the case of errors, the direct input technique has a facility to restart the entire mechanism. However, if you want to restart the entire mechanism in case you faced an error, then direct input programs must be executed in the background only. One has to use program RBMVSHOW or Transaction BMV0 to maintain and start these programs.
    Call Transaction Method
    Call Transaction method is another method used for Data Transfer. In this type of method your program will use the ABAP statement CALL TRANSACTION USING in order to run a SAP transaction. In this type external data need not be deposited in a session for being processed later on. Instead, the entire batch input process takes place inline in your program.
    Here, the data transfer program must convert the data that has to be transferred into the SAP system. This is as per requirement by the SAP data structure or the transaction which is using it. It is to be remembered that a conversion of the data types may be necessary at different times during the process.
    Suppose there is a data type mismatch then you have to convert the data types to type C. In this regard the data transfer program should be capable of exporting the data in SAP format to the sequential file. At the time of uploading the data into the SAP system, the BDC program reads the data from the abovementioned sequential file.
    Batch Input Session Method
    This is the third method for data transfer. If you use the batch input method to transfer data, then you should remember that an ABAP program has to read the external data which is to be entered in the R/3 System. Subsequently, it stores the concerned data a "batch input session." The batch Input session records the actions which are required in the process of transferring data into the system. This can be done by using normal SAP transactions.
    As soon as the program generates the said session, you will be able to run the session in order to execute the SAP transactions in it. Moreover, you can start the session, and at the same time, can monitor a session with the help of batch input management function. For this you have to choose:
    System à Services à Batch input. Moreover, you can have the session run in the background processing.
    Writing a Data Transfer Program
    If you want to write a data transfer program, you have to follow the steps mentioned below.
    Firstly, you will analyze the structure of the existing data. Subsequently, your job is to specify the conversions, which are essential to fill the SAP data structures.
    Secondly, you have to generate the SAP data structure. In case the program is written in ABAP, you will require only the required tables in the concerned program with the help of TABLES statement.
    Thirdly, you will have to initialize the SAP data structure.
    Fourthly, fill the structure with data, performing any conversions and error checking that are required.
    Finally, you will write the sequential file. In the SAP system this sequential file is typically required for making the data available to the batch input program.
    Batch Input Method
    Batch input method is a type of data transfer method. It is used for bulk data transfer; it is one of the primary ways by which data can transferred into the R/3 System. This method is not for near real-time data transfers.
    There are various typical uses of batch input. One of the ways includes the one-time import of data. This import of data is from a legacy system into a newly installed R/3 System. In addition to it, another typical use is for periodic (i.e. hourly, daily..., and so on) transfers of data. These transfers are from external systems or legacy systems which are still in use into R/3 system where all enterprise data is consolidated.
    The R/3 applications deliver different programs for batch input, which are ready to be used. However, in some cases a customer has to write his or her own batch input program. This is required in order to convert the concerned data from a legacy System or from a proprietary format into an R/3 data format.
    The process flows for a batch input are discussed below.
    Data Transfer Decision-Making: It is with a decision to transfer data from an external source into R/3 that the process of batch input begins. It is probable that the external source may be a legacy system that is being replaced. A one-time bulk data transfer is foreseen in this regard. Alternatively, the external source may be an external system that is to remain in use. In this case, a regularly recurring bulk data transfer is foreseen.
    Setting up Batch-Input for Data Transfers: If R/3 standard one-time or regular data transfers are required, then by means of customizing settings in the R/3 Customizing System in SAP ASAP set up will occur. You must set up custom batch input procedures by hand, which means the system administrator must schedule the data conversion program that creates the batch input session. The system administrator and the batch input programmer must determine the following: how frequently data is made available from the external system, how frequently the conversion program should run, and whether the conversion program runs in R/3 (ABAP program) or in a host system (external program).
    Processing Batch Input Sessions: When a batch input session is processed, then the actual transfer of data into R/3 takes place. Little attention is required in processing of batch input sessions by the system administrator. Usually, the starting of batch input sessions is automated by the system administrator. If necessary, the administrators can also start batch input session explicitly from transaction SM35.
    Checking Batch Input Sessions: For a system administrator the routine activity is to check daily or more frequently in transaction SM35 whether all batch input sessions have been completed successfully. It is the schedule for running batch input sessions on which the schedule for checking sessions depends upon. For doing this check the R/3 System provides easy-to-use batch input management tools.
    Analyzing Errors: It is the duty of the system administrator to analyze the problem if one or more transactions in a session end in errors. Usually, the assistance of the affected data entry specialist or department for this analysis will be needed by the system administrator. In the situation where the problem was caused by incorrect data conversion or incorrect generation of the batch input session then the programmer who wrote the data conversion program may also need to be involved.
    Error Handling in Batch Input Method
    It is found that most problems usually fall into one of the following two categories discussed below.
    In this case either required data is missing from the batch-input session or invalid data has been included in the session. Errors in the data conversion program or the presence of unexpected types of data or incorrect data in the legacy database are the possible external causes of this type of problem. Within R/3, the causes for this type of problem include incorrect or incomplete customizing in an application. For example, a legacy data type may not have been foreseen in the check table entries made in application customizing.
    This case mainly includes technical/programming problems. The data is entered by a batch input session by running R/3 transactions non-interactively. Therefore, a typical technical or programming problem is the incorrect identification of one of the data fields in a transaction. Thus, the conversion program may not fill a required data field or may have provided invalid values.
    Conclusion
    I have gone through the details of batch data communication and various methods used to transfer data. One can make use of BDC to transfer data from a SAP to SAP system. In addition, it can transfer data from a non SAP system to SAP system too. I have discussed the various methods of BDC and the error handling in the respective methods.
    Thanks,
    Shankar

  • When do I need to declare multiple usages of the same component

    I have a noddy WD4A component with a main view containing only ViewContainerUI elements. Each container has a sub-view embedded implementing some functionality I am playing with. One of these views implements a select option by using the WDR_SELECT_OPTIONS component. I have got this working. Then I decide to make a copy of the view in order to test some modifications. I embed this in a new ViewContainerUI element on the main view.
    So now I have 2 sub views implementing the same select option. When I run it, the 2nd select option appears in the first view as a duplicate. The only way I can fix this is by declaring a second usage (of WDR_SELECT_OPTIONS) in the component and using this in the copied view.
    So now I have 2 WDR_SELECT_OPTIONS component usages declared (with different names) so that my 2 views can coexist on the screen. Is this really necessary? Had it been the same view implementing both select options fair enough - but these are 2 different views.
    If the views were not displayed at the same time, could I have declared and used just 1 component usage?
    Peter

    I have still not succeeded in dynamically creating a 2nd select Option and getting it to display in a View Container (called VC_SOD). The code compiles and runs but the select option does not display. This is hopefully something I will never need to do in reality. Just an exercise.
    The code that is commented out is the original standard technique of using a select_option usage. There is probably more then 1 fundamental mistake in the code
    method WDDOMODIFYVIEW .
      DATA: LT_RANGE_TABLE TYPE REF TO DATA,
            RT_RANGE_TABLE TYPE REF TO DATA,
            READ_ONLY TYPE ABAP_BOOL,
            TYPENAME TYPE STRING.
      DATA: LR_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER,
            L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
    create the used component
      L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
    Here we copy the usage just for the hell of it.
      DATA lr_component_usage type ref to if_wd_component_usage.
      L_REF_CMP_USAGE = L_REF_CMP_USAGE->CREATE_COMP_USAGE_OF_SAME_TYPE( name = 'SELECT_OPTIONS2' ).
      IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
        L_REF_CMP_USAGE->CREATE_COMPONENT( ).
      ENDIF.
    *call the interface controller method init_selection_screen to get the helper class
    WD_THIS->M_WD_SOD = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
      data L_INTF_CONTROLLER type ref to IWCI_WDR_SELECT_OPTIONS.
      L_INTF_CONTROLLER ?= L_REF_CMP_USAGE->GET_INTERFACE_CONTROLLER( ).
    data lo_view_controller type ref to if_wd_view_controller.
    data lo_view_usage TYPE REF TO if_wd_rr_view_usage.
    data lo_view_cnt_assignment TYPE REF TO if_wd_rr_view_cnt_assignment.
    data lo_view type ref to if_wd_view.
    lo_view_controller = wd_this->wd_get_api( ).
    lo_view_usage = view->get_view_usage( ).
    try and see what is going on
    data lo_view_container_assignments type WDRR_VCA_OBJECTS.
    lo_view_container_assignments = lo_view_usage->GET_VIEW_CNT_ASSIGNMENTS( ).
    lo_view_cnt_assignment = lo_view_usage->create_view_cnt_assignment( name = 'VC_SOD' assigned_container = 'VC_SOD' ).
    try and see what is going on
    lo_view_container_assignments = lo_view_usage->GET_VIEW_CNT_ASSIGNMENTS( ).
    init the select screen
    WD_THIS->M_HANDLER = WD_THIS->M_WD_SOD->INIT_SELECTION_SCREEN( ).
      WD_THIS->M_HANDLER = L_INTF_CONTROLLER->INIT_SELECTION_SCREEN( ).
      WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
                                  I_DISPLAY_BTN_CANCEL  = ABAP_FALSE
                                  I_DISPLAY_BTN_CHECK   = ABAP_FALSE
                                  I_DISPLAY_BTN_RESET   = ABAP_FALSE
                                  I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
    create a range table that consists of this new data element
      LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE( I_TYPENAME = 'S_CARR_ID' ).
    add a new field to the selection
      WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'S_CARR_ID' IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY ).
    endmethod.

  • Slow record insertion when using millions of queries in one transaction

    For test purposes, we play a table creation scenario (no indexes) under multiple conditions : we insert records in bulk mode or one by one, with or without transactions, etc.
    In general, the record insertion is ok, but not when we try to insert 1 million record one by one (sending 1 million INSERT commands) in a single transaction: in this case, the insertion is quick enough for the first 100000 records approximatively, but then, it becomes extremely slow, so that it would take several days to complete. This doe not happen whithout the transaction.
    We were not able to find the database parameters to change to gain a better performance : rollback? transactions? undo? what else?
    Does anybody have an idea of teh parameters to modify?
    Thank-you in advance.

    >
    For test purposes, we play a table creation scenario (no indexes) under multiple conditions : we insert records in bulk mode or one by one, with or without transactions, etc.
    In general, the record insertion is ok, but not when we try to insert 1 million record one by one (sending 1 million INSERT commands) in a single transaction: in this case, the insertion is quick enough for the first 100000 records approximatively, but then, it becomes extremely slow, so that it would take several days to complete. This doe not happen whithout the transaction.
    >
    Hi
    How are you inserting the one million records when you do one at a time? If it's within a loop, you are probably doing a COMMIT as well within the loop. This will cause log file sync waits as LGWR will be too busy writing the redo entries. This will slow down the insert process as well as the performance of database. This is an expected bahaviour. Commit causes checkpoint to triiger which in turn will make log writer write the redo entries in the online redo logs. This is a serial process.
    You can do the following methods to insert bulk records
    a) INSERT /*+ APPEND */ into table select * from stage;
    This will cause direct path load to happen bypassing buffer cache and reducing the redo to a great extent. However if you have foreign keys enabled in the table, it will silently ignore the direct path directive and do the conventional load.
    b) Forall....SELECT ...BULK COLLECT..... This will be a good method when you do from PL/SQL
    c) When you do within a loop
        Declare
        v_commit_cnt Number := 0;
       Begin
        For i in (select col1, col2, col3 from billion_record_table)
        Loop
         v_commit_cnt := v_commit_cnt + 1;
         Insert into target values (i.col1, i.col2, i.col3);
         If (v_commit_cnt >= 50000) Then
          commit;
          v_commit_cnt := 0;
         End If;
       End Loop;
       COMMIT;
    End;
    /4) If the target table is a staging table, you can do a CTAS (Create table as SELECT)
    and many more options if you plan well in advance.

  • PLS-00386 when fetching into a previously declared type.

    I received error PLS-00386 when trying to fetch a cursor into a variable based on an object:
    SQL >-- Create type based on scott.emp
    SQL >CREATE OR REPLACE TYPE t_emp AS OBJECT
    2 (
    3 empno NUMBER(4),
    4 ename VARCHAR2(10),
    5 job VARCHAR2(9),
    6 mgr NUMBER(4),
    7 hiredate DATE,
    8 sal NUMBER(7, 2),
    9 comm NUMBER(7, 2),
    10 deptno NUMBER(2)
    11 );
    12 /
    Type created.
    SQL >
    SQL >show error
    No errors.
    SQL >
    SQL >-- Create a function that fetches records into t_emp:
    SQL >
    SQL >CREATE OR REPLACE FUNCTION emp_fn RETURN NUMBER IS
    2 l_emp t_emp;
    3 CURSOR c1 IS
    4 SELECT * FROM emp;
    5 BEGIN
    6 OPEN c1;
    7 LOOP
    8 FETCH c1
    9 INTO l_emp;
    10 EXIT WHEN c1%NOTFOUND;
    11 END LOOP;
    12 RETURN 0;
    13 END;
    14 /
    Warning: Function created with compilation errors.
    SQL >
    SQL >show error
    Errors for FUNCTION EMP_FN:
    LINE/COL ERROR
    8/5 PL/SQL: SQL Statement ignored
    9/12 PLS-00386: type mismatch found at 'L_EMP' between FETCH cursor
    and INTO variables
    SQL >
    Now when I declare the type exactly the same way inside the function, the function compiles and executes correctly:
    SQL >@test_emp2
    SQL >CREATE OR REPLACE FUNCTION emp_fn RETURN NUMBER IS
    2
    3 TYPE t_emp_rec IS RECORD(
    4 empno NUMBER(4)
    5 ,ename VARCHAR2(10)
    6 ,job VARCHAR2(9)
    7 ,mgr NUMBER(4)
    8 ,hiredate DATE
    9 ,sal NUMBER(7, 2)
    10 ,comm NUMBER(7, 2)
    11 ,deptno NUMBER(2));
    12
    13 l_emp t_emp_rec;
    14
    15 CURSOR c1 IS
    16 SELECT * FROM emp;
    17 BEGIN
    18 OPEN c1;
    19 LOOP
    20 FETCH c1
    21 INTO l_emp;
    22 EXIT WHEN c1%NOTFOUND;
    23 dbms_output.put_line( l_emp.empno);
    24 END LOOP;
    25 RETURN 0;
    26 END;
    27 /
    Function created.
    SQL >
    SQL >show error
    No errors.
    SQL >
    SQL >select emp_fn from dual;
    EMP_FN
    0
    1 row selected.
    Why can does the first function not compile and return PLS-00386?
    Thanks,
    Christoph

    Hi, Christoph,
    Christoph wrote:
    ... BTW: What do you do to format the code nicely like you did?This site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • When do we go for a Call Transaction or Session Method in BDC

    Hi All,
    Please let me know the scenario when we will go in for
             1. Call Transaction
              2.Session Method.
    What is the main difference between Call Transaction and Session Method
    Regards

    hi,
    Use the CALL TRANSACTION USING statement
    Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
    Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
    The most important features of CALL TRANSACTION USING are:
    Synchronous processing
    Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
    You can update the database both synchronously and asynchronously
    The program specifies the update type
    Separate LUW (logical units of work) for the transaction
    The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
    No batch input processing log
    Create a session on the batch input queue.
    Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
    Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
    Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
    The most important aspects of the session interface are:
    Asynchronous processing
    Transfers data for multiple transactions
    Synchronous database update
    During processing, no transaction is started until the previous transaction has been written to the database.
    A batch input processing log is generated for each session
    Sessions cannot be generated in parallel
    The batch input program must not open a session until it has closed the preceding session.
    <b>Hope this is helpful, DO reward.</b>

  • When am creating the material using the transaction MM01 getting the error

    Hi all,
      Could you please help me to solve this issue, When I am creating the material using the transaction MM01, am receiving the error message "Express document "Update was terminated" received from author "XXXXXXXX", I checked the in SM13 found error message showing in Z_LGPLA_BIN_POSTING.
    Regards,
    Muralikrsihna.

    ST22 Error is : SAPSQL_ARRAY_INSERT_DUPREC, below is full error message
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "Z_LGPLA_BIN_POSTING" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    Regards,
    Muralikrishna

  • Layout changes when see preview in SP01 through Call transaction

    Hi Gurus,
    I have to show Spool preview from my program  I am doing this by call transaction SP01 with spool no.  and mode E.
    But the preview which comes is very simple, It does not have graphics and other formatting.
    If i check the spool directly from SP01 , its coming fine.
    Please help me on this Issue.
    Regrads,
    Sowmen Das

    I guess you mean CALL TRANSACTION 'SP01' USING lt_bdcdata MODE 'E' (so that to remain on the last screen of the BDC data).
    Probably SP01 identifies that it is called using CALL TRANSACTION and reacts differently. One possibility is that it tests SY-BINPT which is 'X' when CALL TRANSACTION is used (opposed to space when SP01 is called directly). You may use CALL TRANSACTION ... OPTIONS FROM xx, where xx-nobinpt should be initialized to 'X' (don't forget to set xx-dismode to 'E' also), so that SY-BINPT won't change.
    Note: why don't you use the print preview as we do usually? (TDPREVIEW output option)

  • ABAP Run time error when display the Customs Export declarations

    Hi,
    I'm receiving ABAP Run time error when display the Customs Exp. Declarations Under SAP Customs Processing -> Customs Processing - Import / Export -> Monitoring.
    Error messaging point to Function Module - /SAPSLL/CUHD_LOAD_SELECTION.
    While debugging we found that Primary Key of the below structures are not the same
    lt_corpar                              type      /sapsll/corpar_t
    lt_corpar_ht       type      /sapsll/corpar_k02_ht
    Does anyone has the SAP Notes or solution to this issue other than changing the structures manually. I'm not sure about the impact if i change manually
    Error message short details
    Termination occurred in the ABAP program "/SAPSLL/SAPLCUHD_SELECTION" - in
         "/SAPSLL/CUHD_LOAD_SELECTION".
        The main program was "/SAPSLL/CULO_DISPLAY_CUS_EXP ".
        In the source code you have the termination point in line 144
        of the (Include) program "/SAPSLL/LCUHD_SELECTIONU01".
    We are on GTS Release 8.0 and Support Package SAPK-80014INSAPSLL (Support pack level 14).
    Regards,
    Pradeep Maddi

    Hi,
    I have implemented SAP Note 1531799, but it hasn't resolved the current issue.
    For Our GTS instance, there are 2 Feeder Systems (ECC) attached, but document transfer in one of the system has not been activated. Both having the same partner functions ( We copied the sandbox into 2 different instances for different business Testings and now these 2 instances attached to GTS for testing). These feeder systems have different Logical system names and Logical system groups.
    Recently i have implemented SAP Corrections manually for one the issue, Please see below thread for the detail information
    Proforma Invoice not transferred to GTS
    After implementing the corrections, i have created Pro-forma invoice in ECC system. When i tried to display, i'm facing the ABAP Dump issues.
    Error details
    Runtime Errors         ITAB_DUPLICATE_KEY
    ABAP Program           /SAPSLL/SAPLCUHD_SELECTION
    Application Component  SLL-LEG
    You tried to insert an entry into table  "\FUNCTION=/SAPSLL/CUHD_LOAD_SELECTION\DATA=LT_CORPAR_HT". However, updating the unique table key "PRIMARY_KEY" resulted in a duplicate entry. The key concerned may be either the primary key or a secondary key.
    Regards,
    Pradeep

  • How do you lose a pre-order when I have a receipt for the transaction?!?!?

    I have a receipt for 9/15 in the store for an iphone 6 pre-order.  Now yesterday when I call to check my status no one has any record of this transaction.   The only explanation I'm getting is it was a system glitch and I have to order again.  I waited a month already!?!?  Can someone at Verizon not find a solution to this and get me a phone even if I'm upgraded to one better.  This is either Apple or Verizon's system failures not mine. 

    The store never shows it existed.  Theie only solution was to re-order, or yesterday they had a 128GB.  All they would do was waive the $30 upgrade/activation fee.  They would not negotiate or give me the 128GB in place of my 64GB.  I placed a new order yesterday still unsatisfied with the result, mainly because I refuse to delay a successful order any longer.
    I spoke with support last night after I was still mad about the whole situation.  My order confirmation number, which they finally ended up finding in a seperate system shows under a different account.  They "supposedly" verified with fraud that it wasn't fraudulently altered.  Apparently once they are submitted they can't be changed?  She ended up calling the store manager who seemed more interested in refunding fraudulent charges than finding out the process, IT system problems that happened.  I visited the store today after the rep spoke with him last night.  He still downplayed the issue but did offer to put me on an esclation list and work with me on the price.  Surprisingly the 128GB phone isn't there today.  This is obviously an validation problem between Apple and Verizon.  The store manager says that the confirmation number is Apple generated when the submission takes place.  I am in the process of contacting Apple too to assist in resolving this so I have a phone ASAP, not another 2 weeks.

  • About 3 payment of 6.99 on credit card when i look at my account last transaction on my account was in October

    Trying to find out abouit 3 payments taken on my credit card bill in december for 6.99 the dates are 15th,19th and 22nd .
    when i look at my itunes account it showed no transaction since October .
    thank you

    There is no one from Apple here.
    Contact iTunes support:
    http://www.apple.com/support/itunes/

  • When a user use "rm -rf" to transaction /checkpoint file , how to recovery?

    Hi
    I have some question.
    TimesTen DataStore been started, and Transaction Log / Checkpoint file to rm file when a user accidentally,
    Data for the current memory is there a way to recover?
    Thank you
    GooGyum

    First, I would say though that this is probably not considered supported way to recover from such a drastic delete, but you can give this a try, they can test it out first.
    If the data store is still loaded in memory,
    and say the dsn is for purpose of example, "rmdsn"
    and then like your user I rm rmdsn.ds*;
    ttIsql rmdsn
    call ttckpt();
    call ttckpt();
    I think if they had just deleted the checkpoint files this would work,
    if I though also rm rmdsn.log* (delete the log files)
    You would get an error like this when you try call ttckpt();
    722: Log flusher reports error 893 (TT0893: Cannot open log file /var//DemoDataStore/rmdsn.log0. OS-detected error: No such file or directory
    If I just created rmdsn.log0 in that directory, and then did ttckpt(); and had the files.
    Its possible though you might have lost some transactions that were in the deleted log files and if you had replication or xla, that not having those log files might effect those aspects as well. Note, I didn't test out the delete with those features in use above.
    Jim

  • Time out when run execute report on Webgui or transaction iView

    Dear All,
    We found the error as bellow when we execute report that load huge size of data so it would like many time to get it.
    500 Connection timed out
    Error: -5
    Version: 7000
    Component: ICM
    Date/Time: Thu Mar 6 19:33:49 2008 
    Module: icxxthr_mt.c
    Line: 2698
    Server: irpc16_QAS_50
    Error Tag: {-}
    Detail: Connection to partner timed out after 60s
    Anyone please tell us about the way to edit timeout of webgui or iView.
    Thank you very much,
    Anek.

    Dear Krishna
    It's helpful.
    Goto rz10 transcation
    Choose: Instance profile
    Select: extended maintaince
    Click: change
    Set value for parameter 'icm/keep_alive_timeout'
    If there is not parameter 'icm/keep_alive_timeout', create it.
    Save it.
    Restart SAP.
    Please tell me how to give point for you.
    Thank you for ur reply,
    Anek.

Maybe you are looking for