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

Using BAPI_TRANSACTION_COMMIT, but updates are not committed

Former Member
0 Likes
4,859

Hi all,

I have to perform a simple update on many objects in Real Estate Flexible (buildings)

I select the buildings that require changes using the standard logical DB, then i perform the updates, using the appropriate (I hope!) BAPI; the structure edifw contains the updated general building data (checked with debugger):


      CALL FUNCTION 'BAPI_RE_BU_CHANGE'
        EXPORTING
          COMPCODE                   = BUILDING-BUKRS
          BUSINESSENTITYNUMBER       = BUILDING-SWENR
          BUILDINGNUMBER             = BUILDING-SGENR
          BUILDING                   = edifw
*   BUILDING_X                 =
*   OBJECT_ADDRESS             =
*   OBJECT_ADDRESS_X           =
*   COSETTLE_PARAM             =
*   COSETTLE_PARAM_X           =
*   TRANS                      =
         TEST_RUN                   = P_TEST
        TABLES
*   TERM_ORG_ASSIGNMENT        =
*   MEASUREMENT                =
*   PARTNER                    =
*   OPTION_RATE                =
*   COSETTLE_RULE              =
*   CHARACT                    =
*   OBJ_ASSIGN                 =
*   RESUBM_RULE                =
*   RESUBM_DATE                =
*   ARCH_REL                   =
*   ARCH_RELMS                 =
*   STATUS                     =
*   EXTENSION_IN               =
          RETURN                     = bapir
*   INFRASTRUCTURE             =
                .

The parameter P_TEST is set to space.

The BAPI returns a 'S' message (update was performed.

Next I call the COMMIT function:


    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
          WAIT          = 'X'
   IMPORTING
     RETURN        = bapiret
            .

The commit BAPI is performed correctly, then the program exits.

The building data appears unchanged. Anyone can suggest why?

I have also tried to execute the two transactions using the test sequence function of SE37.

The result is the same.

Thanks,

Massimo

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,080

Hi,

You need to pass the chnage indicator of the building in the BAPI parameters. I am suspecting that you need to pass the

Change indicator = U in the BUILDING_X = X in the BAPI parameters. Check and let me know.

6 REPLIES 6
Read only

Former Member
0 Likes
2,081

Hi,

You need to pass the chnage indicator of the building in the BAPI parameters. I am suspecting that you need to pass the

Change indicator = U in the BUILDING_X = X in the BAPI parameters. Check and let me know.

Read only

0 Likes
2,080

Wonderful, it was that the problem, I have misunderstood the documentation.

Thanks.

Massimo

Read only

jayesh_gupta
Active Participant
0 Likes
2,080

Hi,

In the function module 'BAPI_TRANSACTION_COMMIT', pass parameter WAIT = space.

If you refer the F1 help on the ABAP statement COMMIT WORK AND WAIT, you will find that WAIT flag need not be marked in your case.

Regards,

Jayesh

Edited by: Jayesh Gupta on Apr 20, 2010 10:37 AM

Read only

Former Member
0 Likes
2,080

Hello Jayesh,

I read your comment on not setting the wait parameter = 'X'. How do I know when I absolutely need to set it?

We are experiencing slowness since I have a BAPI in which calls the BAPI_TRANSACTION_COMMITT 15 times and I have set the wait = 'X' for each one CALL.

I am trying to figure out what will happen if I change all the wait = ' ' .

Thanks in-advance..

I looked at the help file and it didn't really say anything.

Mark Carns

Read only

0 Likes
2,080

You can check note 192235 for an explanation. The WAIT parameter ensure that the COMMIT returns only after all the updates are performed. I think that if your function updates sequentially many different objects, you can leave the parameter as space.

Bye

Massimo

Read only

Former Member
0 Likes
2,080

Thanks Massimo. I will review the note.