Order of delete in unit of work

Hi,
I'm trying to delete two objects, a beamprocess and a beamprocessType, where the beamprocess has a 1-1 relationship with the beamprocessType. This means of course that the beamprocess must be deleted before the beamprocessType. I illustrate this with a method below, but a short explanation is probably required.
A sequence holds cycles, which holds beamprocesses. These are 1-M private relationships so these objects are all deleted when the sequence is deleted. For some of the beamprocesses I also want to delete the associated beamprocessType. My problem is that when I call commit on the unit of work, TopLink tries to delete the beamprocessType before the associated beamprocess, which is not possible. How can I solve this?
Kind regards,
Katarina
The method:
public void deleteSequence(String name) throws PMException {
  SequenceController sequenceController = (SequenceController) ServiceLocator.getInstance().getService(SequenceController.class);
  Sequence sequence = sequenceController.getSequence(NameFactory.createSequenceName(name));
  PersistenceTransaction tx = PersistenceLayerFactory.getPersistenceLayer().acquireTransaction();
    // Delete all the "beam-out" beamprocess types and settings.
  Cycle[] cycles = sequence.getCycles();
  for (int i = 0; i < sequence.getCycles().length; i++) {
    BeamProcess[] bps = cycles.getBeamProcesses();
for (int j = 0; j < bps.length; j++) {
BeamProcess bp = bps[j];
if (bp.isBeamOut())
tx.deleteObject(bp.getType());
tx.deleteObject(sequence);
tx.commit();

Hi again,
I have now tried to modify my descriptor by adding the contstraint afterwards, but with no success:
      java.util.Map descriptors = project.getDescriptors();
      Descriptor descriptor = (Descriptor) descriptors.get(BeamProcessImpl.class);
      descriptor.addConstraintDependencies(BeamProcessTypeImpl.class);As mentioned in the previous posting, we do not use any mappings that are not specified in the mapping workbench, so TopLink should be able to order them properly. I include below the mapping descriptor for the BeamProcess class, with the hope that this will give you additional information to be able to help me solve this "mystery". I also include the error message.
Kind regards,
Katarina
Descriptor:
          <descriptor>
               <java-class>cern.macsy.core.domainimpl.BeamProcessImpl</java-class>
               <tables>
                    <table>CORE_BEAMPROCESS</table>
               </tables>
               <primary-key-fields>
                    <field>CORE_BEAMPROCESS.OID</field>
               </primary-key-fields>
               <descriptor-type-value>Normal</descriptor-type-value>
               <sequence-number-field>CORE_BEAMPROCESS.OID</sequence-number-field>
               <sequence-number-name>BP_SEQ</sequence-number-name>
               <identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</identity-map-class>
               <remote-identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</remote-identity-map-class>
               <identity-map-size>100</identity-map-size>
               <remote-identity-map-size>100</remote-identity-map-size>
               <should-always-refresh-cache>false</should-always-refresh-cache>
               <should-always-refresh-cache-on-remote>false</should-always-refresh-cache-on-remote>
               <should-only-refresh-cache-if-newer-version>false</should-only-refresh-cache-if-newer-version>
               <should-disable-cache-hits>false</should-disable-cache-hits>
               <should-disable-cache-hits-on-remote>false</should-disable-cache-hits-on-remote>
               <alias>BeamProcessImpl</alias>
               <copy-policy>
                    <descriptor-copy-policy>
                         <type>oracle.toplink.internal.descriptors.CopyPolicy</type>
                    </descriptor-copy-policy>
               </copy-policy>
               <instantiation-policy>
                    <descriptor-instantiation-policy>
                         <type>oracle.toplink.internal.descriptors.InstantiationPolicy</type>
                    </descriptor-instantiation-policy>
               </instantiation-policy>
               <query-manager>
                    <descriptor-query-manager>
                         <existence-check>Check cache</existence-check>
                    </descriptor-query-manager>
               </query-manager>
               <event-manager>
                    <descriptor-event-manager emptyAggregate="true">
                    </descriptor-event-manager>
               </event-manager>
               <mappings>
                    <-snipp->
                    <database-mapping>
                         <attribute-name>oid</attribute-name>
                         <read-only>false</read-only>
                         <field-name>CORE_BEAMPROCESS.OID</field-name>
                         <type>oracle.toplink.mappings.DirectToFieldMapping</type>
                    </database-mapping>
                    <-snipp->
                    <database-mapping>
                         <attribute-name>type</attribute-name>
                         <read-only>false</read-only>
                         <reference-class>cern.macsy.core.domainimpl.BeamProcessTypeImpl</reference-class>
                         <is-private-owned>false</is-private-owned>
                         <uses-batch-reading>false</uses-batch-reading>
                         <indirection-policy>
                              <mapping-indirection-policy>
                                   <type>oracle.toplink.internal.indirection.NoIndirectionPolicy</type>
                              </mapping-indirection-policy>
                         </indirection-policy>
                         <uses-joining>false</uses-joining>
                         <foreign-key-fields>
                              <field>CORE_BEAMPROCESS.BEAMPROCESS_TYPE</field>
                         </foreign-key-fields>
                         <source-to-target-key-field-associations>
                              <association>
                                   <association-key>CORE_BEAMPROCESS.BEAMPROCESS_TYPE</association-key>
                                   <association-value>CORE_BEAMPROCESSTYPE.OID</association-value>
                              </association>
                         </source-to-target-key-field-associations>
                         <type>oracle.toplink.mappings.OneToOneMapping</type>
                    </database-mapping>
               </mappings>
               <type>oracle.toplink.publicinterface.Descriptor</type>
          </descriptor>Error message:
[EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-02292: integrity constraint (MACSYDEV.BEAMPROCESS_BPTYPE) violated - child record found
INTERNAL EXCEPTION: java.sql.SQLException: ORA-02292: integrity constraint (MACSYDEV.BEAMPROCESS_BPTYPE) violated - child record found
ERROR CODE: 2292]

Similar Messages

  • Default unit of work for vehicles on PM work orders

    Hi SAP experts,
    I would like to find out if it is possible to default the unit of work for vehicles on a PM order?
    We currently have two types of work centers, people (H) and vehicles (KM). The problem is that we can only default one unit (H) for the order, which means that we have to manually change it for the vehicles.
    Is there a way in config to overcome this?
    Regards

    Hi Rajesh,
    We are getting the default unit in operation tab and all the config of default values is available but when we execute the F4 option the unit "H" is not appearing where as if we change from HR which is a default unit to H it is getting saved at the operation Tab.
    Hope it is clear now.
    Regards,
    Selva

  • What is luw (logical unit of work)

    pls tell me what is luw (logical unit of work)
    what r the types of luw .
    2 what ispurpose of code inspector and extended program check
    pls expalin the diffrence b/w those two
    3what are the candidate keys in db tables
    4 what is the difference b/w  occurs 1 and occurs 2 clauses
    data : begin of itab occurs 0 .
    data : itab type standard table of structure type initial size 1 with header line
    pls tell diffrence between theese two statements
    5can u pls tell what is the client in sap
    pls tell answers to questions
    pls dont give any websites addresses to see answers
    6 what is the transaction from database point of view
    7 what is the variant in alv reports
    how do we use reuse_alv_grid_variant_get fun module in alvs

    hi,
      this gives complete idea
      SAP LUW
    Since, as a rule, an application program is processed by several work processes in succession, and every change of the work process is linked with an implicit database commit , an application program is not automatically linked with a single database LUW. This applies in particular to dialog-oriented applications, in which one database LUW is assigned to one dialog step.
    To ensure the data consistency of application programs that are executed across different work processes, the application statements are not directly executed in an SAP LUW, rather, are first registered and then executed by a single work process, that is, in a single database LUW.
    Two techniques are available for bundling the change statements in a database LUW:
    Bundling via function modules (update)
    Through the statement CALL FUNCTION...IN UPDATE TASK, an update function module is registered for subsequent execution in an update work process.
    Bundling via function modules (transactional RFC)
    Through the statement CALL FUNCTION... IN BACKGROUND TASK DESTINATION, a remote- compatible function module is registered for subsequent asynchronous execution via the RFC interface (transactional RFC ).
    Bundling via subprograms
    Through the statement PERFORM ... ON COMMIT, a subprogram is registered for subsequent execution in a different work process.
    Statements for SAP LUWs
    A SAP LUW is controlled via the Open SQL statements COMMIT WORK, ROLLBACK WORK and SET UPDATE TASK LOCAL.
    Note
    A function module can be classified either as an update function module or remote-compatible, but not both at the same time. The update helps realize SAP LUWs within an SAP System, while the transactional RFC creates LUWs in distributed systems.
    COMMIT WORK
    Variants:
    1. COMMIT WORK [AND WAIT].
    2. COMMIT CONNECTION con.
    Effect
    Terminates an SAP LUW and stores the changes.
    Variant 1
    COMMIT WORK [AND WAIT].
    Effect
    The statement COMMIT WORK completes the current SAP LUW and opens a new one, storing all change requests for the currenta SAP LUW in the process. In this case, COMMIT WORK performs the following actions:
    It executes all subroutines registered using PERFORM ON COMMIT.
    It triggers an internal event in Object Services that ensures the registration of changes in persistent objects as the last update function module, as well as the subsequent initialization of persistent object attributes.
    It initiates the processing of all registered update function modules in the update work process.
    This executes all high-priority update function modules registered using CALL FUNCTION ... IN UPDATE TASK in the order of their registration and in a common database LUW. If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating). If you specify the addition AND WAIT, however, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
    If all high-priority update function modules are completed successfully, the statement executes the low-priority update function modules together in a common database LUW.
    In parallel, it also executes the individual function modules registered using CALL FUNCTION ... IN BACKGROUND TASK DESTINATION in a separate database LUW for each destination.
    It handles all SAP locks set in the current program according to the value of the formal parameter _SCOPE of the corresponding lock function modules.
    It triggers a database commit that also terminates the current database LUW.
    The completion of statement COMMIT WORK triggers the event TRANSACTION_FINISHED of the system class CL_SYSTEM_TRANSACTION_STATE, where the parameter KIND has the value of the constant CL_SYSTEM_TRANSACTION_STATE=>COMMIT_WORK.
    If the statement COMMIT WORK is executed by calling special programs, be aware of the following:
    In a program executed using batch input, or if you have called the program using the USING addition of the statement CALL TRANSACTION, COMMIT WORK terminates the batch input processing when using the corresponding settings.
    In a program called using CALL DIALOG, COMMIT WORK initiates the processing of subroutines or updated function modules registered using PERFORM ... ON COMMIT and CALL FUNCTION ... IN UPDATE TASK. Therefore, it does not complete the current SAP LUW. The SAP LUW cannot be completed until you execute the COMMIT WORK statement in the calling program.
    You cannot execute the COMMIT WORK statement during the updating procedure or during the execution of subroutines registered using PERFORM ... ON {COMMIT|ROLLBACK}.
    System fields
    sy-subrc Meaning
    0 You have specified the AND WAIT addition, and the updating of the update function modules was successful.
    4 You have specified the AND WAIT addition, and the updating of the update function modules was not successful.
    The COMMIT WORK statement always sets sy-subrc to 0 if the AND WAIT addition is not specified.
    Note
    The COMMIT WORK statement closes all database cursors . Open SQL statements that access a database cursor later ( SELECT loop and FETCH) raise an exception that cannot be handled.
    Variant 2
    COMMIT CONNECTION con.
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Effect
    The COMMIT command is not executed on the standard database, but only on the secondary database connection specified by con. con is the name of the database connection as it was specified in the table DBCON in the column CON_NAME. The database connection con can also be specified dynamically in the form (source_text) - the source_text field contains the name of the database connection. The source_text field must be of the type C or STRING.
    On the specified secondary database connection, the database commit:
    Closes all open database cursors (OPEN CURSOR)
    Releases all database locks
    Note
    Note that the COMMIT CONNECTION DEFAULT statement unlike COMMIT WORK executes a pure database commit on the DEFAULT connection.
    Exceptions
    Non-Catchable Exceptions
    Cause: COMMIT WORK is not possible in a FORM that was called using PERFORM ... ON COMMIT.
    Runtime Error: COMMIT_IN_PERFORM_ON_COMMIT
    Cause: COMMIT WORK is not allowed in the update.
    Runtime Error: COMMIT_IN_POSTING
    ROLLBACK WORK
    Variants:
    1. ROLLBACK WORK.
    2. ROLLBACK CONNECTION con.
    Effect
    Terminates a SAP-LUW without storing the changes.
    Variant 1
    ROLLBACK WORK.
    Effect
    The statement ROLLBACK WORK closes the current SAP-LUW and opens a new one. In doing so, all change requests of the current SAP-LUW are canceled. To do this, ROLLBACK WORK carries out the following actions:
    Executes all subprograms registered with PERFORM ON ROLLBACK.
    Deletes all subprograms registered with PERFORM ON COMMIT.
    Raises an internal exception in the Object Services that makes sure that the attributes of persistent objects are initialised.
    Deletes all update function modules registered with CALL FUNCTION ...IN UPDATE TASK from the VBLOG and deletes all transactional remote Function Calls registered with CALL FUNCTION ... IN BACKGROUND TASK from ARFCSSTATE and from ARFCSDATA.
    Removal of all SAP locks set in the current program in which the formal parameter _SCOPE of the lock function module was set to the value 2.
    Triggers a database rollback, which also ends the current database-LUW.
    After completion of the statement COMMIT WORK, the event TRANSACTION_FINISHED of the system class CL_SYSTEM_TRANSACTION_STATE is raised, in which the parameter KIND has the value of the constant CL_SYSTEM_TRANSACTION_STATE=>ROLLBACK_WORK.
    Variant 2
    ROLLBACK CONNECTION con.
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Effect
    The ROLLBACK-statement is not executed on the standard database but only on the secondary database connection, specified through con. con is the name of the database connection as it was specified in table DBCON in column CON_NAME. The database connection con can also be specified dynamically in the form (source_text), in which the field source_text contains the name of the database connection. The field source_text must be of the type C or STRING.
    Notes
    As all opened database cursors on the respective database connections are closed at ROLLBACK, the attempt to continue a SELECT-loop after a ROLLBACK, leads to a runtime error. Due to the same reason, a FETCH after a ROLLBACK to the then closed cursor, leads to a runtime error. You have to make sure that cursors that are still open, are no longer used after ROLLBACK.
    After execution of the statement ROLLBACK, SY-SUBRC is always equal to 0. It is not necessary to check if SY-SUBRC is unequal to 0 after ROLLBACK.
    ROLLBACK must not be used during update (CALL FUNCTION ... IN UPDATE TASK) or during the execution of FORMs, which were registered with PERFORM ... ON COMMIT resp. PERFORM ...ON ROLLBACK.
    The statement ROLLBACK WORK is implicitly executed if a message of the type A is treated with the addition ERROR_MESSAGE when calling a function module with CALL FUNCTION.
    Exceptions
    Non-Catchable Exceptions
    Cause: ROLLBACK WORK is not allowed within a FORM that is called with PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK.
    Runtime Error: ROLLBACK_IN_PERFORM_ON_COMMIT
    Cause: ROLLBACK WORK is not allowed within an update.
    Runtime Error: ROLLBACK_IN_POSTING
    SET UPDATE TASK LOCAL
    Syntax
    SET UPDATE TASK LOCAL.
    Effect
    This statement specifies that the high-priority update function modules - registered during the current SAP LUW using CALL FUNCTION ... IN UPDATE TASK - are registered in the ABAP memory instead of the VBLOG database table. In addition, it specifies that the current work process and not the update work process run these modules during the current database LUW, when the COMMIT WORK statement is executed. This statement has no effect on low-priority update function modules.
    At the beginning of every SAP LUW, the local update function is deactivated. If you wish to use it, you must reactivate it again before the first update function module is registered.
    System fields
    sy-subrc Meaning
    0 The local update function is activated.
    1 The local update function has not been activated, because the program has already registered at least one update function module for the normal updating procedure in the current SAP-LUW.
    Notes
    The local update function performs a synchronous update according to the COMMIT WORK statement, independent of the addition AND WAIT.
    The occurrence of a database rollback during the local update affects all previous change requests.

  • RE:logical unit of work

    Hi guys,
    What do u mean by logical unit of work...Can anyone explain me with an example.
    Regards,
    Alex.

    hi,
    this gives complete idea
    SAP LUW
    Since, as a rule, an application program is processed by several work processes in succession, and every change of the work process is linked with an implicit database commit , an application program is not automatically linked with a single database LUW. This applies in particular to dialog-oriented applications, in which one database LUW is assigned to one dialog step.
    To ensure the data consistency of application programs that are executed across different work processes, the application statements are not directly executed in an SAP LUW, rather, are first registered and then executed by a single work process, that is, in a single database LUW.
    Two techniques are available for bundling the change statements in a database LUW:
    Bundling via function modules (update)
    Through the statement CALL FUNCTION...IN UPDATE TASK, an update function module is registered for subsequent execution in an update work process.
    Bundling via function modules (transactional RFC)
    Through the statement CALL FUNCTION... IN BACKGROUND TASK DESTINATION, a remote- compatible function module is registered for subsequent asynchronous execution via the RFC interface (transactional RFC ).
    Bundling via subprograms
    Through the statement PERFORM ... ON COMMIT, a subprogram is registered for subsequent execution in a different work process.
    Statements for SAP LUWs
    A SAP LUW is controlled via the Open SQL statements COMMIT WORK, ROLLBACK WORK and SET UPDATE TASK LOCAL.
    Note
    A function module can be classified either as an update function module or remote-compatible, but not both at the same time. The update helps realize SAP LUWs within an SAP System, while the transactional RFC creates LUWs in distributed systems.
    COMMIT WORK
    Variants:
    1. COMMIT WORK [AND WAIT].
    2. COMMIT CONNECTION con.
    Effect
    Terminates an SAP LUW and stores the changes.
    Variant 1
    COMMIT WORK [AND WAIT].
    Effect
    The statement COMMIT WORK completes the current SAP LUW and opens a new one, storing all change requests for the currenta SAP LUW in the process. In this case, COMMIT WORK performs the following actions:
    It executes all subroutines registered using PERFORM ON COMMIT.
    It triggers an internal event in Object Services that ensures the registration of changes in persistent objects as the last update function module, as well as the subsequent initialization of persistent object attributes.
    It initiates the processing of all registered update function modules in the update work process.
    This executes all high-priority update function modules registered using CALL FUNCTION ... IN UPDATE TASK in the order of their registration and in a common database LUW. If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating). If you specify the addition AND WAIT, however, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
    If all high-priority update function modules are completed successfully, the statement executes the low-priority update function modules together in a common database LUW.
    In parallel, it also executes the individual function modules registered using CALL FUNCTION ... IN BACKGROUND TASK DESTINATION in a separate database LUW for each destination.
    It handles all SAP locks set in the current program according to the value of the formal parameter _SCOPE of the corresponding lock function modules.
    It triggers a database commit that also terminates the current database LUW.
    The completion of statement COMMIT WORK triggers the event TRANSACTION_FINISHED of the system class CL_SYSTEM_TRANSACTION_STATE, where the parameter KIND has the value of the constant CL_SYSTEM_TRANSACTION_STATE=>COMMIT_WORK.
    If the statement COMMIT WORK is executed by calling special programs, be aware of the following:
    In a program executed using batch input, or if you have called the program using the USING addition of the statement CALL TRANSACTION, COMMIT WORK terminates the batch input processing when using the corresponding settings.
    In a program called using CALL DIALOG, COMMIT WORK initiates the processing of subroutines or updated function modules registered using PERFORM ... ON COMMIT and CALL FUNCTION ... IN UPDATE TASK. Therefore, it does not complete the current SAP LUW. The SAP LUW cannot be completed until you execute the COMMIT WORK statement in the calling program.
    You cannot execute the COMMIT WORK statement during the updating procedure or during the execution of subroutines registered using PERFORM ... ON {COMMIT|ROLLBACK}.
    System fields
    sy-subrc Meaning
    0 You have specified the AND WAIT addition, and the updating of the update function modules was successful.
    4 You have specified the AND WAIT addition, and the updating of the update function modules was not successful.
    The COMMIT WORK statement always sets sy-subrc to 0 if the AND WAIT addition is not specified.
    Note
    The COMMIT WORK statement closes all database cursors . Open SQL statements that access a database cursor later ( SELECT loop and FETCH) raise an exception that cannot be handled.
    Variant 2
    COMMIT CONNECTION con.
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Effect
    The COMMIT command is not executed on the standard database, but only on the secondary database connection specified by con. con is the name of the database connection as it was specified in the table DBCON in the column CON_NAME. The database connection con can also be specified dynamically in the form (source_text) - the source_text field contains the name of the database connection. The source_text field must be of the type C or STRING.
    On the specified secondary database connection, the database commit:
    Closes all open database cursors (OPEN CURSOR)
    Releases all database locks
    Note
    Note that the COMMIT CONNECTION DEFAULT statement unlike COMMIT WORK executes a pure database commit on the DEFAULT connection.
    Exceptions
    Non-Catchable Exceptions
    Cause: COMMIT WORK is not possible in a FORM that was called using PERFORM ... ON COMMIT.
    Runtime Error: COMMIT_IN_PERFORM_ON_COMMIT
    Cause: COMMIT WORK is not allowed in the update.
    Runtime Error: COMMIT_IN_POSTING
    ROLLBACK WORK
    Variants:
    1. ROLLBACK WORK.
    2. ROLLBACK CONNECTION con.
    Effect
    Terminates a SAP-LUW without storing the changes.
    Variant 1
    ROLLBACK WORK.
    Effect
    The statement ROLLBACK WORK closes the current SAP-LUW and opens a new one. In doing so, all change requests of the current SAP-LUW are canceled. To do this, ROLLBACK WORK carries out the following actions:
    Executes all subprograms registered with PERFORM ON ROLLBACK.
    Deletes all subprograms registered with PERFORM ON COMMIT.
    Raises an internal exception in the Object Services that makes sure that the attributes of persistent objects are initialised.
    Deletes all update function modules registered with CALL FUNCTION ...IN UPDATE TASK from the VBLOG and deletes all transactional remote Function Calls registered with CALL FUNCTION ... IN BACKGROUND TASK from ARFCSSTATE and from ARFCSDATA.
    Removal of all SAP locks set in the current program in which the formal parameter _SCOPE of the lock function module was set to the value 2.
    Triggers a database rollback, which also ends the current database-LUW.
    After completion of the statement COMMIT WORK, the event TRANSACTION_FINISHED of the system class CL_SYSTEM_TRANSACTION_STATE is raised, in which the parameter KIND has the value of the constant CL_SYSTEM_TRANSACTION_STATE=>ROLLBACK_WORK.
    Variant 2
    ROLLBACK CONNECTION con.
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Effect
    The ROLLBACK-statement is not executed on the standard database but only on the secondary database connection, specified through con. con is the name of the database connection as it was specified in table DBCON in column CON_NAME. The database connection con can also be specified dynamically in the form (source_text), in which the field source_text contains the name of the database connection. The field source_text must be of the type C or STRING.
    Notes
    As all opened database cursors on the respective database connections are closed at ROLLBACK, the attempt to continue a SELECT-loop after a ROLLBACK, leads to a runtime error. Due to the same reason, a FETCH after a ROLLBACK to the then closed cursor, leads to a runtime error. You have to make sure that cursors that are still open, are no longer used after ROLLBACK.
    After execution of the statement ROLLBACK, SY-SUBRC is always equal to 0. It is not necessary to check if SY-SUBRC is unequal to 0 after ROLLBACK.
    ROLLBACK must not be used during update (CALL FUNCTION ... IN UPDATE TASK) or during the execution of FORMs, which were registered with PERFORM ... ON COMMIT resp. PERFORM ...ON ROLLBACK.
    The statement ROLLBACK WORK is implicitly executed if a message of the type A is treated with the addition ERROR_MESSAGE when calling a function module with CALL FUNCTION.
    Exceptions
    Non-Catchable Exceptions
    Cause: ROLLBACK WORK is not allowed within a FORM that is called with PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK.
    Runtime Error: ROLLBACK_IN_PERFORM_ON_COMMIT
    Cause: ROLLBACK WORK is not allowed within an update.
    Runtime Error: ROLLBACK_IN_POSTING
    SET UPDATE TASK LOCAL
    Syntax
    SET UPDATE TASK LOCAL.
    Effect
    This statement specifies that the high-priority update function modules - registered during the current SAP LUW using CALL FUNCTION ... IN UPDATE TASK - are registered in the ABAP memory instead of the VBLOG database table. In addition, it specifies that the current work process and not the update work process run these modules during the current database LUW, when the COMMIT WORK statement is executed. This statement has no effect on low-priority update function modules.
    At the beginning of every SAP LUW, the local update function is deactivated. If you wish to use it, you must reactivate it again before the first update function module is registered.
    System fields
    sy-subrc Meaning
    0 The local update function is activated.
    1 The local update function has not been activated, because the program has already registered at least one update function module for the normal updating procedure in the current SAP-LUW.
    Notes
    The local update function performs a synchronous update according to the COMMIT WORK statement, independent of the addition AND WAIT.
    The occurrence of a database rollback during the local update affects all previous change requests.
    Regards
    vasu

  • I try to open I photo and  I get the message, your iPhoto library is damaged...please restore from backup. But i din't made backup copy. How can i delete previous library and work wrom the new one?

    I try to open I photo and  I get the message, your iPhoto library is damaged...please restore from backup. But i din't made backup copy. How can i delete previous library and work wrom the new one?

    Try this (assuming you're using iPhoto 12): make a temporary, duplicate copy of the library and try the three fixes below in order as needed:
      Fix #1
    delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your Home/Library/Preferences folder. 
    delete iPhoto's cache files that are located in your Home/Library/Caches/com.apple.iPhoto folder.
    reboot, launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding the the Option key.  You'll also have to reset the iPhoto's various preferences.
    Fix #2
    Launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library.
    Select options #1, #2 and #6. 
    Fix #3
    Rebuild the library using iPhoto Library Manager as follows:
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Problem controlling the order of deletes

    Hello,
    I built a very simple example that uses two Java classes (Department and Employee) with a one-to-many relationship. The property "name" of class Employee maps to the primary key column of the EMPLOYEE table in the database. Now if I remove all employees from a department and then insert one employee who happens to have the same name as one of ex-employees, the things go wrong:
    [TopLink Info]: DatabaseSession(101)--acquire unit of work: 216
    [TopLink Info]: DatabaseSession(101)--Connection(102)--SELECT NAME FROM MACIEJ.DEPARTMENT WHERE (NAME = 'IT')
    [TopLink Info]: UnitOfWork(216)--begin unit of work commit
    [TopLink Info]: DatabaseSession(101)--Connection(102)--begin transaction
    [TopLink Info]: UnitOfWork(216)--Connection(102)--INSERT INTO MACIEJ.EMPLOYEE (NAME, FIRST_NAME, DEPARTMENT_NAME) VALUES ('Schinzel', 'Dieter', 'IT')
    [TopLink Info]: UnitOfWork(216)--Connection(102)--DELETE FROM MACIEJ.EMPLOYEE WHERE (NAME = 'Marczukajtis')
    [TopLink Info]: UnitOfWork(216)--Connection(102)--DELETE FROM MACIEJ.EMPLOYEE WHERE (NAME = 'Schinzel')
    [TopLink Info]: DatabaseSession(101)--Connection(102)--commit transaction
    [TopLink Info]: UnitOfWork(216)--end unit of work commit
    [TopLink Info]: UnitOfWork(216)--release unit of work
    This happens also when I am using the method setShouldPerformDeletesFirst(true). The deletes are still executed after the insert. The code follows.
    ExpressionBuilder builder = new ExpressionBuilder(Department.class);
    Expression constraint = builder.get("name").equal("IT");
    UnitOfWork uow = this.session.acquireUnitOfWork();
    uow.setShouldPerformDeletesFirst(true);
    Department dep = (Department) uow.readAllObjects(Department.class, constraint).get(0);
    uow.logMessages();
    dep.removeAllEmployees();
    // Employee emp = new Employee();
    Employee emp = (Employee) uow.registerObject(new Employee());
    emp.setName("Schinzel");
    emp.setFirstName("Dieter");
    dep.addEmployee(emp);
    uow.commit();
    Another problem I encountered is that I have to use registerObject() on the new Employee (still if the value of "name" is identical to one of the employee's names that I am removing), because otherwise I am getting this:
    Local Exception Stack:
    Exception [TOPLINK-6004] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.QueryException
    Exception Description: The object [cern.toplink.try1.Employee@ec[ name: Schinzel ; 1st name: Dieter ; dep: IT ]], of class [class cern.toplink.try1.Employee], with identity hashcode (System.identityHashCode()) [236],
    is not from this UnitOfWork object space, but the parent session's. The object was never registered in this UnitOfWork,
    but read from the parent session and related to an object registered in the UnitOfWork. Ensure that you are correctly
    registering your objects. If you are still having problems, you can use the UnitOfWork.validateObjectSpace() method to
    help debug where the error occurred. For more information, see the manual or FAQ.
    I would appreciate any hints how I can force the deletes to happen before the insert.
    Cheers,
    Maciej

    You cannot have two different objects in the same unit of work with different primary keys.
    You must either update the object instead of deleting and inserting it, or split the operation across two units of work.
    The setShouldPerformDeletesFirst only applies to publicly deleted objects, not objects that are deleted through private owned relationships. If you did not mark the relationship as private-owned and deleted the objects through uow.deleteObject then the deletes would be processed first. However you should still try to avoid having two different objects with the same primary key in the same unit of work.

  • Automatic purchase order deletion after SD order is deleted

    Hi forum,
    I managed to get the automatic purchase order creation to work. Now I have a few issues about it.
    - why is the workflow not deleted after the sd order is deleted?
    - why is the purchase requisition not deleted after the sd order is deleted?
    Thank you for help!
    Regards,
    Florian

    Hi
    If you delete the sd order, then automatically purchase requisition will get deleted.
    First you delete the sales order, and do the MRP Run - MD02 and view the requirement at MD04. Automatically requiement will get deleted.
    Reward if it helps
    Regards
    Prasanna R

  • Getting Unit Of Work without JSP context

    We are developing an application using Toplink and ADF Datacontrols. We have timer (which starts right after deploy) which reads data from magnetic card reader and stores them into database (via Toplink). Our main problem is getting Unit Of Work (server session). If user interacts with application via jsp pages, obtaining uow is done from TopLinkDataControl (getAssociatedUnitOfWork()). But timer lives on its own, it has no jsp pages to get context from.
    We know one solution - getting server session from toplink descriptor (absolute path needed) - XMLProjectReader.read("c:\\...\\toplink-deployment-descriptor.xml"). Is there another way to create Unit Of Work for our timer in order to last whole application existence? Thanks.

    I was wrong, when I thought, that XMLProjectReader.read() with absolute path works. Your solution seems to be similar, with the same result. I'll describe my problem more closely:
    - Our web apllication consists of 2 projects - Model and ViewController. Each has set the classpath pointing to classes of the opposite project.
    - The only way, that I know of starting a Clock (from Model, Runnable) without creating JSP page is instatiating it in some servlet's init() method. (Servlet has set 'Load This Servlet When the Web App is Strted" in WEB.XML).
    - When I try in my clock to create UnitOfWork by XMLProjectReader.read("c:\\...\\toplink-deployment-descriptor.xml"), I get this error:
    EXCEPTION [TOPLINK-3007] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.ConversionException
    EXCEPTION DESCRIPTION: The Object [mypackage.MyClass], of class[class java.lang.String] could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate
    API passing in the appropriate class loader as required, or setting it
    on the default ConversionManager/
    INTERNAL EXCEPTION: java.lang.ClassNotFoundException: mypackage.MyClass
    - mypackage.MyClass is one of many classes from Model, mapped in toplink-deployment-descriptor.xml. It is in classpath of ViewController.
    - For the time being, our application runs in JDeveloper, it will be deployed to OracleAS 10g.
    Either somebody please help me how to solve above error or maybe suggest how to start my clock together with application deployment (no jsp context).
    Thanks.

  • Consume JMS Unit-Of-Work message through OSB proxy service

    Hi,
    Anyone know how to consume a JMS Unit-Of-Work (UOW) message using an OSB Proxy Service of JMS type?
    I can submit a unit-of-work JMS message (which consists of multiple constituent messages) using an OSB proxy & business service combination and setting the UOW transport headers appropriately. I can also separately produce and consume Java objects via a JMS queue where the consumption is done via OSB proxy (of java request message type), but these aren't UOW messages.
    Apparently as soon as it is a UOW message then the message consumed is an ObjectMessage ArrayList and one has to use the "Java" request message type for the JMS consumer proxy, but I'm unsure of how to create the concurrent client jar to use it in the same proxy service's JMS transport configuration in order to output the ObjectMessage ArrayList (UOW message). 
    Ideally I'd like to consume a single UOW XML message via an OSB JMS proxy service.
    Any pointers would be appreciated.
    R

    Finally got this working!!
    For posterity: Needed to insert Java Object JMS messages on the OSB JMS producer (Business Service) side with correct UOW jms transport header set in route node. Then consume the Unit-Of-Work message on the other side via jms proxy service with "java" request message type, with appropriate jar containing the Object class as the "Client jar" in the JMS Transport configuration. In the same JMS consumer proxy I had to do a java callout, passing the contents of $body, using java.util.ArrayList and javax.jms.ObjectMessage, as input into a method (.. decodeJavaMessage(ArrayList<ObjectMessage> ...)). In this java callout class you can get to each individual ObjectMessage via typecasting the get() method on the Arraylist to (ObjectMessage) and then just typecast the getObject() on this Objectmessage into your original Java Class (same as what you inserted onto queue originally).
    Hope this saves someone some time in future!

  • Logical unit of work

    Hi all,
    Can help me regarding LUW(logical unit of work) and its importance in r/3 ?
    Thanks and Regards
    Ravi

    Hai Ravi Charan
    There are 3 types of LUW's available in SAP
    1)Database Transaction or DBLUW
    2)SAP      Transaction or SAPLUW
    2)ABAP     Transaction or ABAPLUW
    1) DBLUW : when it is called it locks the rows , Update the rows & commit the rows issued by auto Commit
    2) SAPLUW : collection of Business reports is called SAPLUW and Issuing the Commit
    here UPDATE,INSERT,MODIFY statements are valid
    Commit work is given by Developer Side.
    3) ABAPLUW : What ever Transaction Code we are creating is called ABAPLUW  it is belongs upon Developers
    here 3 types of updates available
    1) Bundled Updates
    2) Un-Bundled Updates
      1) Bundled Updates :
        in Bundled Updates all your updates in a single unit of work present in a PERFORM 'XYZ'
    PERFORM 'XYZ' on Commit.
    here PERFORM-kept in Buffer 'XYZ' this form having all your update statements
    Priarities of execution.
    Perform xy on comit it will execute first
    perform ab on comit it will execute second
    I want to change this execution Order
    Perform xy on comit Level 2 it will execute second
    perform ab on comit Level 1 it will execute First
    because it will depends on Level command
    Using in Function Modules
    Call Function XYZ in Update Task.
    Commit work.
    In this case it stores in a buffer once encounters the commit statement this will executes from the buffer
    so it is an asynchronos method
    2) Un Bundled Updates
    these are two types
    1) Inline Updates
    2) Buffered Inline Updates
    1) Inline Updates : INSERT,UPDATE
    when update statement found in a program then it is called inline update and you should give the 'commit work'after a update statement
    inthe inline update if you not issue a commit work the system will automatically issues the commit work.
    2) Buffered Inline Updates:
    you will buffer all your inline updates and executes after Encounter the 'COMMIT WORK'
    100
       XYZ --> we can not roll back here
    200
       ABC---> if here is using commit
    Thanks & Regards
    Sreenivasulu P

  • Bapi and Logical Unit of Work

    Hi all,
    I am using Bapi to post records in a loop on internal table itab. After posting records, I am again looping at itab and populating those records to my custom table.
    Does this scenario use 2 logical unit of work?
    If yes, then please tell me how do I use one logical unit of work.
    Thanks,
    Ridhima

    Hey,
    You should not post records to the custom table if the BAPI posting has failed.
    In order to maintain data consistency the logic in your program should be as below:
    LOOP AT itab.
    CALL BAPI.
    IF BAPI Call is successful
    Post data to Custom table.
    CALL BAPI_TRANSACTION_COMMIT.
    ELSE.
    CALL BAPI_TRANSACTION_ROLLBACK.
    ENDIF.
    ENDLOOP.
    Talking about LUW's, any program uses 1 SAP LUW and Multiple Database LUWs depending on the number times you COMMIT the data to the database.
    If in your program you were to use only one COMMIT statement or no COMMIT statement at all, your program would use 1 SAP LUW and 1 database LUW.
    -Kiran
    *Please mark useful answers

  • StoredProcedures Logical Unit of Work (Transactionality)

    I haven't experimented yet about the bahaviour when calling multiple storedProcedures in a single XI-JDBC call.
    When I call multiple stored procedures and if the transaction was partially successfull which means One storedProcedure call executed successfully and other failed in this scenario will this call treats as LUW and rolls back all the successful ones on the DB? or will be partial success?
    Since the actual SQL commands are inside the storedprocedure how do we pass the exception/failed signal back to caller?
    This is similar to calling insert/update statements using JDBC adapter I know that in this case each message call treats as LUW which means message will fail/rollback if any one of the statements failed.
    Thanks in advance...
    Laxman Molugu

    Hai Ravi Charan
    There are 3 types of LUW's available in SAP
    1)Database Transaction or DBLUW
    2)SAP      Transaction or SAPLUW
    2)ABAP     Transaction or ABAPLUW
    1) DBLUW : when it is called it locks the rows , Update the rows & commit the rows issued by auto Commit
    2) SAPLUW : collection of Business reports is called SAPLUW and Issuing the Commit
    here UPDATE,INSERT,MODIFY statements are valid
    Commit work is given by Developer Side.
    3) ABAPLUW : What ever Transaction Code we are creating is called ABAPLUW  it is belongs upon Developers
    here 3 types of updates available
    1) Bundled Updates
    2) Un-Bundled Updates
      1) Bundled Updates :
        in Bundled Updates all your updates in a single unit of work present in a PERFORM 'XYZ'
    PERFORM 'XYZ' on Commit.
    here PERFORM-kept in Buffer 'XYZ' this form having all your update statements
    Priarities of execution.
    Perform xy on comit it will execute first
    perform ab on comit it will execute second
    I want to change this execution Order
    Perform xy on comit Level 2 it will execute second
    perform ab on comit Level 1 it will execute First
    because it will depends on Level command
    Using in Function Modules
    Call Function XYZ in Update Task.
    Commit work.
    In this case it stores in a buffer once encounters the commit statement this will executes from the buffer
    so it is an asynchronos method
    2) Un Bundled Updates
    these are two types
    1) Inline Updates
    2) Buffered Inline Updates
    1) Inline Updates : INSERT,UPDATE
    when update statement found in a program then it is called inline update and you should give the 'commit work'after a update statement
    inthe inline update if you not issue a commit work the system will automatically issues the commit work.
    2) Buffered Inline Updates:
    you will buffer all your inline updates and executes after Encounter the 'COMMIT WORK'
    100
       XYZ --> we can not roll back here
    200
       ABC---> if here is using commit
    Thanks & Regards
    Sreenivasulu P

  • Create transfer order for moving storage units

    Hello guys,
    I need to create transfer order for moving storage units, the same with the transactions LT09, I found this FM 'L_TO_CREATE_MOVE_SU' but no work, somebody have an example for this FM, thanks a lot!

    Hello,
    I had the same problem today and I've fixed it by calling the FM in a different task (asychronous) .. this way the fugr/internal variables will be loaded again and you won't get this stupid error anymore. 
    CALL FUNCTION 'L_TO_CREATE_MOVE_SU' STARTING NEW TASK lv_task
    In case you need it syncronous use PERFORMING clause together with WAIT UNITL
    Hope this helps!
    Cristian

  • Set NameFor unit of work & get the Uow from that name

    Hai
    Its possible to give Name (or Id ) For Unit of Work after some time get Back the unit of work from the Name (or Id ) it’s possible
    Eg
    UnitOfWork uow =…….
    uow.setName(“sample”);
    after some time
    get the unit of work from the name (sample)
    Thanks in advance

    Hello Chris,     
    Thanks for the quick response
    In our Application I have the two layers Layer1 & layer2
    In the Layer1 I did the following work
         1) Business validation
    2) Make the call to layer2 (for Insert, update, delete, fetch)
    In layer2 I have TopLink coding (for Insert, update, delete, fetch)
    I want to do Insert, update, delete in single Transaction.
    Each and every operation (Insert, update & delete) is separate call to Layer2 from Layer1
    So I must start the transaction (UOW) in Layer1 to commit and rollback.
    For Eg: To delete the object, I need the UOW in layer2. But the UOW present on layer 1
    unitOfWork.deleteObject(employee);
    According to our Framework specification we don’t want to transfer the unit of work from Layer1 to Layer2.
    So I plan to give the name for UOW & get the UOW from that Name
    Give the solution for this…..
    Thanks in advance

  • Maintenance Order Confirmation in Different units

    Dear all,
    my client needs to have order confirmation in different units. That is they need to enter how much work is finished in km, piece or m3 .
    Can i do that with iw41? i know thats time confirmation but from any similar screen?
    Thanks
    JMq

    John,
    The system is hard-coded to accept UoM of TIME only
    However, it is possible to confirm Km etc with a little manipulation of the system.
    What you need to do is:
    - Create a new UoM in the IMG. This UoM need to be time-based, but call it somthing like Kmt (travel kilometers)
    - Create a new activity type for your Kmt
    - Create a new cost via TCode KP26 for your cost centre and activity type
    - Repeat steps above for other UoM
    - Test in an order
    PeteA

Maybe you are looking for

  • Input not routing through effects when recording

    Hello, I have a strange problem with Logic 8 all of a sudden. I can no longer hear my input during recording. The input is not flowing through the channel strip effects nor is it routing over to out 1-2 during recording. Everything works fine during

  • Cannot set synch configuration in Desktop Manager

    Hello, I'm using a Blackberry Bold 9700 and a Win 7 computer with Outlook 2003. I'd like to sync my BB with my Outlook contacts and calendar, but I'm completely unable to set up my synch configuration in the Desktop Manager.  When I try to do so, a "

  • Finder is very slow

    My macbook pro late 2011 model is newly installed with mountain lion and ever since, every time i open a folder it doesnt load its content properly, some times not at all.. some times it takes 6-7 seconds or even more.. doesnt matter if its a large f

  • Flash button that controls breeze play button

    Is it possible to create a flash button that is scripted to control the play and pause button on the breeze playbar? What I am looking for is a way to have a button that would start a slide again after it has stopped and is waiting for the user to st

  • Logistics Execution -sd

    Dear birds, I am looking for sd LE config template on this  Text Removed   Please help in current proj regards, Lisa Edited by: Lisa Holland BMW on Feb 17, 2012 12:08 PM Edited by: Lakshmipathi on Feb 17, 2012 6:57 PM Dont ask any SAP information to