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 with tables update

Former Member
0 Likes
1,024

Hi all,

IAM USING A PROGRAM TO create reservation using BAPI AND UPDATING A ZTABLE AND END OF THE PROGRAM I CALLING ANOTHER PROGRAM IN WHICH IAM USING THE SAME RECORD I RECENTLY UPDATED.

For some reason sometimed the second program is not executing at times . I CANNOT EVEN DEBUG BECAUSE SOMETIMES ITS EXECUTING AND SOMETIMES NOT.

cAN ANYONE TELL ME WHAT MIGHT THE REASON.

mY guess is that the resb and rkpf or ztable is not getting updated immediately because i am using the same tables and the recently updated record in the second program.

Thanks

Hi all,

IAM USING A PROGRAM TO create reservation using BAPI AND UPDATING A ZTABLE AND END OF THE PROGRAM I CALLING ANOTHER PROGRAM IN WHICH IAM USING THE SAME RECORD I RECENTLY UPDATED.

For some reason sometimed the second program is not executing at times . I CANNOT EVEN DEBUG BECAUSE SOMETIMES ITS EXECUTING AND SOMETIMES NOT.

cAN ANYONE TELL ME WHAT MIGHT THE REASON.

mY guess is that the resb and rkpf or ztable is not getting updated immediately because i am using the same tables and the recently updated record in the second program.

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
976

1) use COMMIT WORK AND WAIT. Before calling second program.

2) Try to read the Z table for the newly entered data. If is is successful then call the second program.

Regards

Kathirvel

Read only

Former Member
0 Likes
976

Lock the Z table before you updated it; then release the lock after the update is complete. Then run the BAPI.

Rob

Can't specify wait

Message was edited by:

Rob Burbank

Read only

0 Likes
976

Hi

iam creating reservation using bapi and then updating a ztable with reservation number and in the next program i calling this reservation number from the ztable that i have updated recently.

how can i lock and unlock the ztable.

can't i use commit and wait after i update the ztable .

iam using

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = space

  • IMPORTING

  • RETURN =

.

as well

Thanks

Read only

0 Likes
976

Then try to lock (and wait) the reservation. Then unlock it. then update the Z table.

On second thought, try that first. (You have to do the commit anyway.)

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
976

Hi ,

can you tell me how to lock and make the reservation wait

Thanks

Read only

0 Likes
976

First, try:


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT = 'X'.

Rob

Read only

0 Likes
976

HI,

I MODIFIED THE CODE BUT I DON'T WHEN THE SECOND PROGRAM EXECUTES .

IT EXECUTES MOST OF THE TIME BUT ONCE IN A WHILE IT DOESN'T .rIGHT NOW ITS EXECUTING BUT IAM NOT SURE.

THIS SHOULD SOLVE THE PROBLEM BUT I ALREADY HAD BAPI TRANSACTION COMMIT BUT INSTEAD OF X I PASSED SPACE DOES THAT MAKES ANY DIFFERENCE.

THANKS

Read only

0 Likes
976

From the documentation of BAPI_TRANSACTION_COMMIT, for the WAIT parameter:

Using the command `COMMIT AND WAIT`

Description

The default value of this parameter is SPACE. If the parameter contains the value SPACE or it does not contain a value at all, then a simple COMMIT WORK is executed.

If the parameter WAIT contains a value other than SPACE, a COMMIT WORK AND WAIT command is executed.

Rob

Message was edited by:

Rob Burbank