Application Development 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: 

Last function module (BAPI_TRANSACTION_COMMIT) is not working in USER-EXIT

Former Member
0 Kudos

DATA: I_BAPI2080_NOTHDRI TYPE STANDARD TABLE OF BAPI2080_NOTHDRI WITH HEADER LINE.

DATA: I_BAPIRET2 TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.

DATA: I_BAPI2080_NOTHDRE TYPE STANDARD TABLE OF BAPI2080_NOTHDRE WITH HEADER LINE.

DATA : RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'

EXPORTING

  • EXTERNAL_NUMBER =

NOTIF_TYPE = 'M2'

NOTIFHEADER = I_BAPI2080_NOTHDRI

  • TASK_DETERMINATION = ' '

  • SENDER =

  • ORDERID =

IMPORTING

NOTIFHEADER_EXPORT = I_BAPI2080_NOTHDRE

TABLES

  • NOTITEM =

  • NOTIFCAUS =

  • NOTIFACTV =

  • NOTIFTASK =

  • NOTIFPARTNR =

  • LONGTEXTS = I_BAPI2080_NOTFULLTXTI

  • KEY_RELATIONSHIPS =

RETURN = I_BAPIRET2.

CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'

EXPORTING

NUMBER = I_BAPI2080_NOTHDRE-NOTIF_NO

  • IMPORTING

  • NOTIFHEADER =

  • TABLES

  • RETURN =

.

LOOP AT RETURN WHERE TYPE = 'E'.

EXIT.

ENDLOOP.

IF SY-SUBRC EQ 0.

WRITE: / 'BAPI call failed - debug and fix!'.

ELSE.

CLEAR RETURN.

REFRESH RETURN.

  • COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

RETURN = RETURN.

WRITE: / 'Notification Number', I_BAPI2080_NOTHDRE-NOTIF_NO.

ENDIF.

CAN ANYONE HELD ME OUT .

EVERY SUGGESTION WILL BE APPRECIATED.

REGARDS

VICKY

Moderator message: please do not post in all upper case, remember you were this close to user ID deletion already.

Edited by: Thomas Zloch on May 13, 2011 12:59 PM

2 REPLIES 2

Former Member
0 Kudos

Hi,

u cant use bapi_transaction_commit in user exit. Since the user exit might be in the middle something. There can be lot of code to be followed after that .u cant commit .

0 Kudos

To the moderator,

Thanks for reminding me, next time i'll keep this thing in my mind.

To mohammad.

Thanks for your valueable comment.

Regards

Vicky