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: 

Error while using BAPI- BAPI_ALM_NOTIF_CREATE

0 Kudos

While using the BAPI- BAPI_ALM_NOTIF_CREATE I am getting the error "An error occurred whilst processing the notification". Error num:277 ID : IM

2 REPLIES 2

joltdx
Active Contributor
0 Kudos

Hi!

Sorry about that, but we need more information to help you. Did you check the contents of the return table from the BAPI? It usually contains information that would help you, or help us help you.

It might also help for you to provide the code you use, formatted using the CODE button.

0 Kudos

getting the values as below in return table.

function zrfc_notification.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(ASSET_ID) TYPE TPLNR
*" VALUE(FAULT_TYPE) TYPE QMGRP
*" VALUE(FAULT_DESC) TYPE QMCOD
*" VALUE(REPORTED_DT) TYPE QMDAT
*" VALUE(REPORTEDBY) TYPE QMNAM
*" VALUE(NOTE) TYPE QMTXT
*" EXPORTING
*" VALUE(E_MESSAGE) TYPE CHAR300
*"----------------------------------------------------------------------

data:lv_objectkey type bapi1003_key-object,
lv_objecttable type bapi1003_key-objecttable,
lv_classnum type bapi1003_key-classnum,
lv_classtype type bapi1003_key-classtype.

data:li_char_values type table of bapi1003_alloc_values_char,
li_num_values type table of bapi1003_alloc_values_num,
li_curr_values type table of bapi1003_alloc_values_curr,
li_return type table of bapiret2,
li_return_read type table of bapiret2,
li_line type table of tline,
li_creretun type standard table of bapiret2,
li_savretun type standard table of bapiret2.

data:lwa_char_values type bapi1003_alloc_values_char,
lwa_num_values type bapi1003_alloc_values_num,
lwa_return type bapiret2,
lwa_head type thead,
lwa_line type tline,
lwa_notif_head type bapi2080_nothdri,
lwa_notynohe type bapi2080_nothdre,
lwa_notysave type bapi2080_nothdre,
lwa_comretun type bapiret2.

data:lv_tabix type sy-tabix,
lv_datum type cawn-atwrt,
lv_datum_float type cawn-atflv,
lv_msg_notif type string,
lv_notification type qmnum,
lv_condition type char200.

clear lwa_notif_head.
lwa_notif_head-funct_loc = asset_id.
lwa_notif_head-code_group = fault_type.
lwa_notif_head-coding = fault_desc.
lwa_notif_head-notif_date = reported_dt.
lwa_notif_head-reportedby = reportedby.
lwa_notif_head-short_text = note.

call function 'BAPI_ALM_NOTIF_CREATE'
exporting
* EXTERNAL_NUMBER =
notif_type = 'M1'
notifheader = lwa_notif_head
* TASK_DETERMINATION = ' '
* SENDER =
* ORDERID =
* IV_DONT_CHK_MANDATORY_PARTNER =
* NOTIFCATION_COPY =
* DOCUMENT_ASSIGN_COPY = ' '
* MAINTACTYTYPE =
importing
notifheader_export = lwa_notynohe
* MAINTACTYTYPE_EXPORT =
tables
* NOTITEM =
* NOTIFCAUS =
* NOTIFACTV =
* NOTIFTASK =
* NOTIFPARTNR =
* LONGTEXTS =
* KEY_RELATIONSHIPS =
return = li_creretun
* EXTENSIONIN =
* EXTENSIONOUT =
.
if sy-subrc = 0 and lwa_notynohe-notif_no is not initial.
call function 'BAPI_ALM_NOTIF_SAVE'
exporting
number = lwa_notynohe-notif_no
importing
notifheader = lwa_notysave
tables
return = li_savretun.
if sy-subrc = 0 and li_savretun is initial.
call function 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
importing
return = lwa_comretun.

if sy-subrc = 0 and lwa_comretun is initial.
lv_notification = lwa_notysave-notif_no.
elseif lwa_comretun is not initial.
lv_msg_notif = 'Notification not commited'.
endif.
elseif li_savretun is not initial.
lv_msg_notif = 'Notification not Saved'.
endif.
elseif li_creretun is not initial.
lv_msg_notif = 'Notification not created,incorrect input values'.
endif.
if lv_msg_notif is not initial.
concatenate 'Data updated successfully for pole:' asset_id 'and' lv_msg_notif into e_message separated by space.
else.
concatenate 'Data updated successfully for pole:' asset_id 'Notification created:' lv_notification into e_message separated by space.
endif.
endfunction.