Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue in Data Base Update/Commit Work

former_member198402
Participant
0 Likes
935

Hi Experts,

I am using FM : OIGI_DEL_CONF_CREATE ,After this i am calling BAPI_TRANSACTION_COMMIT(With wait up to 2 sec).

Following issues are there..

1>Doc getting posted successfully and i am getting this document No, but still it is not getting update in MSEG/MKPF (which i need for further processing) Table so i have to wait or /perform some nested select query over this table until it gets updated.

2>why the commit work not work in this special case(is there any 1st label & 2 and label update for which commit not work?),

I am posting in mass using this FM.

Please suggest me..

Warm Regards,
Santosh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
726

Hi,

If you need to call update BAPI twice where the 2nd call depends on  result of the first one or want immediate update. You have two options :

Option 1 -  Use local update - Since the update happens in the same work process, result will always be synchronous and document will be posted in MSEG table.  You need to set local update, everytime as it gets reset after every commit or rollback.

     SET UPDATE TASK LOCAL.

     CALL FUNCTION 'OIGI_DEL_CONF_CREATE'

      Check the return parameter

      CALL 'BAPI_TRANSACTION_COMMIT'.

    Check for the existence of the record in MSEG.

   Option2 -  CALL FUNCTION ''OIGI_DEL_CONF_CREATE'

                         CALL 'BAPI_TRANSACTION_COMMIT' with wait 'X'

                         RFC_CONNECTION_CLOSE. 

Regards,

DPM

3 REPLIES 3
Read only

Former Member
0 Likes
727

Hi,

If you need to call update BAPI twice where the 2nd call depends on  result of the first one or want immediate update. You have two options :

Option 1 -  Use local update - Since the update happens in the same work process, result will always be synchronous and document will be posted in MSEG table.  You need to set local update, everytime as it gets reset after every commit or rollback.

     SET UPDATE TASK LOCAL.

     CALL FUNCTION 'OIGI_DEL_CONF_CREATE'

      Check the return parameter

      CALL 'BAPI_TRANSACTION_COMMIT'.

    Check for the existence of the record in MSEG.

   Option2 -  CALL FUNCTION ''OIGI_DEL_CONF_CREATE'

                         CALL 'BAPI_TRANSACTION_COMMIT' with wait 'X'

                         RFC_CONNECTION_CLOSE. 

Regards,

DPM

Read only

0 Likes
726

Hi Mallick,

Could you please throw some light on Option 2 ? what exactly it does in current scenario?

Regards,

Santosh

Read only

0 Likes
726

Hi,

The second option also ensures that the first update finishes before the program proceeds with the next step. 

1st step  - You need to call  FM 'OIGI_DEL_CONF_CREATE' . If it is an RFC enable FM, then

   CALL FUNCTION 'OIGI_DEL_CONF_CREATE' DESTINATION 'NONE'.

2nd step - Commit the changes within the session

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

           DESTINATION 'NONE'

          EXPORTING wait = 'X'.

3rd step - Explicitly close the session so that all the commits in the remote session gets executed.

          CALL FUNCTION 'RFC_CONNECTION_CLOSE'

               EXPORTING destination = 'NONE'

             EXCEPTIONS OTHERS = 0.

For better understanding, google on 'Fighting problems of asynchronous processing in ABAP'.

Regards,

DPM