‎2009 Nov 27 10:17 AM
Hi everybody.
Im using the bapi BAPI_ALM_NOTIF_CREATE to create a notification in SAP. After the process I only get a temporary notification number. After commit, could I get the real notification number in some way?
Regards and thank you so much
‎2009 Nov 27 10:37 AM
Hello,
You need to follow the sequence of BAPIS as below:
CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
EXPORTING
notif_type = c_type
notifheader = x_header
IMPORTING
notifheader_export = x_imp_header " Notif Number
TABLES
notitem = t_notitem
notifcaus = t_notifcaus
longtexts = t_longtexts
return = t_return_create.
SORT t_return_create BY type.
* If the error is returned, the same is sent back to MES
READ TABLE t_return_create INTO x_return_create WITH KEY type = c_error. " c_error = 'E'
IF sy-subrc EQ 0.
x_return_mes-type = x_return_create-type.
x_return_mes-message = x_return_create-message. " Notification could not be created.
APPEND x_return_mes TO t_return_mes.
CLEAR x_return_mes.
ELSE.
* Changing the Status to In-Progress
CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'
EXPORTING
number = x_imp_header-notif_no.
* Save the Notification. Else the nitification number is seen but not in the transaction.
CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
EXPORTING
number = x_imp_header-notif_no
IMPORTING
notifheader = x_imp_header.
* Commit to Database
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Afte this you will get the actual number.
Hope this helps.
~Pranu
‎2009 Nov 27 10:28 AM
Hi,
do you have a look into export parameter: NOTIFHEADER_EXPORT?
Regards, Dieter
‎2009 Nov 27 10:37 AM
Hello,
You need to follow the sequence of BAPIS as below:
CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
EXPORTING
notif_type = c_type
notifheader = x_header
IMPORTING
notifheader_export = x_imp_header " Notif Number
TABLES
notitem = t_notitem
notifcaus = t_notifcaus
longtexts = t_longtexts
return = t_return_create.
SORT t_return_create BY type.
* If the error is returned, the same is sent back to MES
READ TABLE t_return_create INTO x_return_create WITH KEY type = c_error. " c_error = 'E'
IF sy-subrc EQ 0.
x_return_mes-type = x_return_create-type.
x_return_mes-message = x_return_create-message. " Notification could not be created.
APPEND x_return_mes TO t_return_mes.
CLEAR x_return_mes.
ELSE.
* Changing the Status to In-Progress
CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'
EXPORTING
number = x_imp_header-notif_no.
* Save the Notification. Else the nitification number is seen but not in the transaction.
CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
EXPORTING
number = x_imp_header-notif_no
IMPORTING
notifheader = x_imp_header.
* Commit to Database
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Afte this you will get the actual number.
Hope this helps.
~Pranu
‎2009 Nov 27 10:50 AM
As per my understanding temporary notification number and real notification number will be same .
And also notification number is avaliable in various paramaters of BAPI_ALM_NOTIF_CREATE. PLease check
‎2009 Nov 27 1:49 PM