05-13-2011 11:50 AM
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
05-13-2011 11:53 AM
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 .
05-13-2011 12:15 PM
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