cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ALM_NOTIF_SAVE to rollback or not

former_member214137
Participant
0 Kudos

Hi Everyone,

When you use BAPI_ALM_NOTIF_SAVE and it returns errors do you need to use BAPI_TRANSACTION_ROLLBACK?

The documentation in SE37 implies that you need to run BAPI_TRANSACTION_COMMIT regardless of the result otherwise further changes are not possible. Does this mean that BAPI_ALM_NOTIF_SAVE effectively do a rollback internally?

regards

Julian

Accepted Solutions (0)

Answers (1)

Answers (1)

peter_atkin
Active Contributor
0 Kudos

Julian,

I have used this in the past:


lv_subrc = 0.
  loop at yt_return into ls_return.
    if ls_return-type = 'A' or       "abort
       ls_return-type = 'X' or       "dump
       ls_return-type = 'E'.         "Error
      lv_subrc = 4.
      exit.
    endif.
  endloop.

  IF lv_subrc EQ 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ENDIF.

PeteA

former_member214137
Participant
0 Kudos

Hi Pete,

Thanks for your response. Generally I would do the same as you suggest.

My question was meant to be more about ( perhaps I was not explicit enough, my bad ), the nature of the BAPI BAPI_ALM_NOTIF_SAVE and its behaviour regarding the need for a commit regardless of results otherwise further changes are not possible as per the bapi documentation and that there is no mention of rollback.

If the save fails does the bapi clean itself up so there is no need to rollback?

cheers

Julian

peter_atkin
Active Contributor
0 Kudos

Julian

Not sure on that one..

Get your ABAPers to check BAPI_ALM_NOTIF_SAVE to see what it does when something fails (i.e. an error, not warning message..)

PeteA