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

Calling BAPI in sequence

Former Member
0 Likes
2,233

Greetings,

I m calling FIVE FM namely,

BAPI_ALM_ORDER_MAINTAIN

BAPI_TRANSACTION_COMMIT,

BAPI_ALM_NOTIF_DATA_ADD,

BAPI_ALM_NOTIF_SAVE,

BAPI_TRANSACTION_COMMIT

in the sequence written above.But i am not able to add data

to a created notification (created through BAPI_ALM_ORDER_MAINTAIN ),IF i process it in the above sequence.If i do the notification addition separetly,its working.

Do anyone have an idea to do this in a single function module.?

Helpful answers will be rewarded.

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,839

Hello

And how are you using BAPI_TRANSACTION_COMMIT ?

Give code pls ...

10 REPLIES 10
Read only

Former Member
0 Likes
1,840

Hello

And how are you using BAPI_TRANSACTION_COMMIT ?

Give code pls ...

Read only

Former Member
0 Likes
1,839

Hi Jigneesh,

Try to use Wait Statement after every Bapi commit, I think this logic works sometimes.

Thanks

Sudharshan

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,839

You have to wait parameter in the BAPI_TRANSACTION_COMMIT. And there can be some more delay due to Database Commit and buffering, so you may have to wait until the data is accessible. (Try a select/wait until read or an Enqueue wait on the order)

Regards

Read only

0 Likes
1,839

hi,

i have passed the parameter for wait also.still its not getting

updated.

Read only

0 Likes
1,839

Try to open the order (IW32 or the like) after the commit wait, there may be a delay as i wrote. So try something like:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
          wait   = 'X'
     IMPORTING
          return = bapiret2.
IF bapiret2-type EQ 'E'.
  " help
ENDIF.
DO.
  SELECT COUNT(*) FROM aufk BYPASSING BUFFER
    WHERE aufnr = returned_order.
  IF sy-subrc EQ 0.
    EXIT.
  ELSE.
    WAIT UP TO 1 SECONDS.
  ENDIF.
ENDDO.

Regards

Read only

0 Likes
1,839

Hi Raymond,

i tried with similar code lines.But it didnt work.

My assumption is that there is some problem with lock mechanism.Is there any way to handle this.?

I searched and found one sap note for the bapi...still its not working.

Waiting for you reply.

Edited by: Jinesh Kumar C on Aug 12, 2008 4:02 PM

Read only

0 Likes
1,839

Which message do you get : order not found, or order locked ?

Regards

Read only

0 Likes
1,839

hi,

i didnt get any messages.

Read only

0 Likes
1,839

Look at OSS [Note 1058895 - Lock error when you change or delete notifications|https://service.sap.com/sap/support/notes/1058895] of 05.30.2007

Regards

Read only

Former Member
0 Likes
1,839

This message was moderated.