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: 

Creation of Maintenance Notification

Former Member
0 Kudos
641

Hello All,

I am trying to use BAPI "BAPI_ALM_NOTIF_CREATE" to create Maintenance Notification.  I am working on SAP ECC 6.0 Version.  When I try to create the same using IW21 transaction, by just passing Notificaiton type, Equiment Number and short text, I am able to create the notification.
If I try to pass the same value to BAPI, I am not getting the notification created, but also it is not giving back any message to return table.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
317
Hi Arivazhagan Sivasamy,

After using BAPI_ALM_NOTIF_GET_DETAIL and i passed the data in this bapi but still i'm not getting notification number.

12 REPLIES 12

arivazhagan_sivasamy
Active Contributor
0 Kudos
317

Hi ashok,

Please check your notification number in export parameter NOTIFHEADER_EXPORT.

If everything is correct, you may not get the return table.

Use BAPI_TRANSACTION_COMMIT and check the value of notif number.

Arivazhagan S

0 Kudos
317
Hi Arivazhagan Sivasamy,

I was passing sufficient data to bapi it was returning notification number "%0000000001".

and i entered the same data in iw21 i got notification number so i'm clear that data is correct,but i'm not sure that  why i'm getting this temparary number?

0 Kudos
317

Hi Ashok

Please call BAPI_ALM_NOTIF_SAVE and BAPI_TRANSACTION_COMMIT after the BAPI call. NOTIF_SAVE will return you the number

Nabheet


0 Kudos
317

hi first use BAPI

BAPI_ALM_NOTIF_GET_DETAIL  and pass already created notification number to it.

it will give all the details of that notifications it will also help you to understand what parameters are to be passed to BAPI_ALM_NOTIF_CREATE . pass same parameters and check if it is creating notifications. i did same thing in my sytem and got details of notification number using it.

Former Member
0 Kudos
317
Hi nabheet madan,

Ok i will use BAPI_ALM_NOTIF_SAVE and BAPI_TRANSACTION_COMMIT after the BAPI call,But input for   BAPI_ALM_NOTIF_SAVE is notification number how can i give that?

0 Kudos
317

You pass the importing notifheader_export-notif_no to the save BAPI

Nabheet


0 Kudos
317

when i pass the export parameter of Bapi_create to  import of bapi_save it will shortdump due to type conflict error.so i need to enter only  notification number to bapi_save

0 Kudos
317

Ashok do one thing check sample code in FM EM_NTF_ORD_CREATE it is calling all three and adapt accordingly

Nabheet

0 Kudos
317

Hi Ashok,

You may given

CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
   EXPORTING
     NUMBER              = OUT-NOTIF_NO
*   TOGETHER_WITH_ORDER = ' '
   IMPORTING
     NOTIFHEADER         = OUTPUT-
NOTIF_NO.

    NOTIFHEADER         = OUTPUT


You have to give OUTPUT NOT OUTPUT-NOTIF_NO.


Please check.


Arivazhagan S


Former Member
0 Kudos
318
Hi Arivazhagan Sivasamy,

After using BAPI_ALM_NOTIF_GET_DETAIL and i passed the data in this bapi but still i'm not getting notification number.

0 Kudos
317

Hi Ashok,

Write a code like below and you will get required output..

DATA: HEAD TYPE BAPI2080_NOTHDRI,
       OUT TYPE BAPI2080_NOTHDRE,
       OUTPUT TYPE BAPI2080_NOTHDRE.


HEAD-SHORT_TEXT = 'Testing'.
HEAD-FUNCT_LOC = 'test'.
HEAD-REPORTEDBY = 'user'.


CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
   EXPORTING
*   EXTERNAL_NUMBER               =
     NOTIF_TYPE                    = 'Z1'
     NOTIFHEADER                   = HEAD
*   TASK_DETERMINATION            = ' '
*   SENDER                        =
*   ORDERID                       =
*   IV_DONT_CHK_MANDATORY_PARTNER =
   IMPORTING
     NOTIFHEADER_EXPORT            = OUT.


CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
   EXPORTING
     NUMBER              = OUT-NOTIF_NO
*   TOGETHER_WITH_ORDER = ' '
   IMPORTING
     NOTIFHEADER         = OUTPUT.

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT          = 'X'
* IMPORTING
*   RETURN        =
           .

WRITE OUTPUT-NOTIF_NO.


Arivazhagan S

0 Kudos
317
Hi Arivazhagan Sivasamy,

Thans For solving the problum.