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: 

problem cause creation using BAPI_ALM_NOTIF_DATA_MODIFY BAPI

hady_ibrahim
Participant
0 Kudos
1,020

Dear experts.

this program is used to change on service notification "IW52"

I want to create Cause ,add equipment .

my below code result is

1    I    IM    280    Error in processing notification , item 0000



DATA : IT_NOTIFHEADER TYPE  TABLE OF BAPI2080_NOTHDRI WITH HEADER LINE ,
        WA_NOTIFHEADER TYPE  BAPI2080_NOTHDRI,
        IT_NOTIFHEADER_X TYPE  TABLE OF BAPI2080_NOTHDRI_X WITH HEADER LINE ,
        WA_NOTIFHEADER_X TYPE  BAPI2080_NOTHDRI_X,
       it_cause TYPE STANDARD TABLE OF BAPI2080_NOTCAUSI,
       wa_cause type BAPI2080_NOTCAUSI,
        it_causex type STANDARD TABLE OF BAPI2080_NOTCAUSI_X,
         wa_causex type  BAPI2080_NOTCAUSI_X,
        IT_notifitem TYPE STANDARD  TABLE OF BAPI2080_NOTITEMI WITH HEADER LINE,
        WA_notifitem like BAPI2080_NOTITEMI occurs 0 with header line,
        IT_notifitemX TYPE STANDARD  TABLE OF BAPI2080_NOTITEMI_X WITH HEADER LINE,
       WA_notifitemX like BAPI2080_NOTITEMI_X occurs 0 with header line,
       IT_notifitem_x like BAPI2080_NOTITEMI_X occurs 0 with header line,
        IT_RETURN TYPE STANDARD  TABLE OF BAPIRET2,
        IT_RETURN2 TYPE STANDARD  TABLE OF BAPIRET2.


IT_notifitem-REFOBJECTKEY = 'QM000300002691'.
IT_notifitem-ITEM_KEY = '0001'.
IT_notifitem-D_CODEGRP = 'GR'.
IT_notifitem-D_CODE = '9013'.
IT_notifitem-DESCRIPT  = '9013'.
APPEND WA_notifitem TO IT_notifitem.

*IT_notifitemX-REFOBJECTKEY = 'X'.
IT_notifitemX-ITEM_KEY = 'X'.
IT_notifitemX-D_CODEGRP = 'X'.
IT_notifitemX-D_CODE = 'X'..
IT_notifitemX-DESCRIPT = 'X'..
APPEND WA_notifitemX TO IT_notifitemX.


WA_NOTIFHEADER-REFOBJECTTYPE ='QMEL'.
WA_NOTIFHEADER-REFOBJECTKEY = 'QM000300002691'.

WA_NOTIFHEADER-EQUIPMENT = '000000000010008568'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '808081'.
APPEND WA_NOTIFHEADER TO IT_NOTIFHEADER.

wa_cause-REFOBJECTKEY = 'QM000300002691'.
wa_cause-CAUSE_CODEGRP = 'GR'.
wa_cause-CAUSE_CODE = '9013'.
wa_cause-CAUSE_KEY = '0001'.
wa_cause-ITEM_SORT_NO = '0001'.
APPEND wa_cause TO IT_cause.


wa_causex-CAUSE_CODEGRP = 'X'.
wa_causex-CAUSE_CODE = 'X'.
wa_causex-CAUSE_KEY = 'X'.
wa_causex-ITEM_SORT_NO = 'X'.
APPEND  wa_causex TO  IT_causex.



WA_NOTIFHEADER_X-REFOBJECTTYPE ='X'.
WA_NOTIFHEADER_X-REFOBJECTKEY = 'X'.
WA_NOTIFHEADER_X-EQUIPMENT = 'X'.
WA_NOTIFHEADER_X-MATERIAL = 'X'.
WA_NOTIFHEADER_X-SERIALNO = 'X'.
APPEND WA_NOTIFHEADER_X TO IT_NOTIFHEADER_X.

DATA : NOT TYPE QMNUM VALUE 300002691.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
   EXPORTING
     input  = NOT
   IMPORTING
     OUTPUT = NOT.



CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
   EXPORTING
     NUMBER                   = NOT
    NOTIFHEADER              = IT_NOTIFHEADER
    NOTIFHEADER_X            = IT_NOTIFHEADER_X
*      RETURN                   = IT_RETURN
* IMPORTING
*   NOTIFHEADER_EXPORT       =
  TABLES
    NOTIFITEM                = IT_notifitem
   NOTIFITEM_X              = IT_notifitemX
    NOTIFCAUS                = IT_cause
    NOTIFCAUS_X              = IT_causex
* *   NOTIFACTV                =
* *   NOTIFACTV_X              =
* *   NOTIFTASK                =
* *   NOTIFTASK_X              =
* *   NOTIFPARTNR              =
* *   NOTIFPARTNR_X            =
RETURN                   = IT_RETURN
           .
BREAK-POINT.

CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
   EXPORTING
     number = NOT    "ß-------- SN No.
   TABLES
     return = IT_RETURN2.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
   EXPORTING
     wait = 'X'.

could you help me?

thanks

3 REPLIES 3

jogeswararao_kavala
Active Contributor
0 Kudos
243

Hello Haddy,


This is not program error, This is functional error. This indicates that the Notification 300002691 does not have  Item (Object part/damage) details. Cause entry is possible only when details in Object part & Damage tab are available.



KJogeswaraRao


0 Kudos
243

Dear Jogeswara ,

thanks for your help. i already created an Item (Object part/damage) as displayed image but the same problem still exist and why BAPI doesnt add equipment ,material and serial for notification?

any suggested solution?




0 Kudos
243

You may test outside the program through IW52 with the same data. You should face the same error. Now you need to investigate this with functional experts which is the other reason throwing this error. Once it is confirmed that it is Functional error as I was suspecting, and unable to trace the reason, then you may start a discussion in space EAM.