database updates

Upload: marshnil-sonavane-goswami

Post on 04-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 database updates

    1/8

    Sap bc414

  • 8/13/2019 database updates

    2/8

    Database luw Work process can only execute one db luw.

    So work process must always end db luw when itsfinishes the work.

    Implicit db commits :

    1. dialog step completes

    2. rfc

    3. wait

    4. messages like I,W, E.

    Explicit db commit : fm DB_COMMIT or COMMIT

    WORK.

    Implicit rollback : runtime error or messages like A or X.

    Explicit rollback : ROLLBACK WORK.

  • 8/13/2019 database updates

    3/8

    Sap luw

    Logical unit consist of several dialog steps

    whose changes are written to db in single dbluw is called sap luw.

    Can span over several dialog steps and can use

    series of different work processes. All the db changes bundles into one single db

    luw.

    Bundling techniques are : using fm forupdates, using subroutines, using fm in other

    r/3 systems.

  • 8/13/2019 database updates

    4/8

    Using fm for updates Create fm with processing type update module with following

    options

    1. immediate start : v1 functions, can be restart.

    2. immediate start no restart : v1 functions.

    3. delayed start : v2.

    4. collective run.

    Call fm in update task. Fm flagged for executin using a specialupdate work process. Fm parameters are stored as a log entry inVBLOG table.

    If error occurs during update, rollback work executes and fm notcalled again and entry delete from vblog table.

    If the technical error occurs, the update wp triggers a db rollback

    and places the log entry again in table and it sends mail to user andvblog entry can be processed again.

    Update db asynchronously.

  • 8/13/2019 database updates

    5/8

    Using subroutine Perform on commit level idx or rollback.

    This statement registers subroutine to executewhen commit work or rollback work statementreached , and execute in same dialog workprocess and before other registered update fm.

    If this statement occurs in update fm, then it willexecute lastly in update work process.

    They donthave parameter interface, data can be

    pass by abap memory or global variables. Anddata inconsistency.

    Better performance then update fm.

  • 8/13/2019 database updates

    6/8

    Remote fm Call function fm in background task destination dest,

    parameter_list as separate unit.

    Register fm to execute till commit work statementreaches in tables ARFCSSTATE AND ARFCSDATA.

    If destination not found then executable RSARFCSE isstarted in background. This attempts to start fm

    registered for an SAP LUW in their destination 30times, if still not found, this is noted in tableARFCSDATA as CPICERR Entry. This entry get deletefrom ARFCSSTATE after 8 days.

    Using SEPARATE UNIT, the fm is executed in a separate

    context, using separate transaction id, in which theglobal data of function group not influenced byprevious calls.

  • 8/13/2019 database updates

    7/8

    Sap locks Span over several dialog steps

    Lock objects.

  • 8/13/2019 database updates

    8/8

    Update techniques Asynchronous update

    Updating asynchronously in steps :

    synchronous update local update.

    Asynchronous update : dialog work process dont wait for update workprocess to finish.

    Updating asynchronously in steps : vblog entry can be divided into primaryv1 and secondary v2 steps.

    V1 and v2 are process in separate db luws. Lock entry remove once v1 processed, there is no locking for v2 updates.

    V1 : time critical, lock critical.

    Synchronous update : commit work and wait, perform on commit.

    Local update : update program is process by same work process that

    processed the request, dialog user has to wait till update to finish, disadv :parallel nature, adv : reduce amount of access to db.

    SET UPDATE TAST LOCAL.

    Local update switch reset after each commit or rollback work, andtherefore it should be set at beginning of SAP LUW.