Home > ABAP > Simplified PM Service Notification

Simplified PM Service Notification

January 23rd, 2009

I have been searching for BAPI for creating a PM service notification. I found several Function Modules: First I found BAPI_SERVICENOTIFICAT_CREATE and second I found BAPI_SERVNOT_CREATE.

I tried to create notification using BAPI_SERVICENOTIFICAT_CREATE but it keeps giving this error: EIS499E499 Non-specifiable notification in function module. When I try to use BAPI_SERVICENOTIFICAT_GETLIST
to get an example data for existing service notification, I can’t use the function module since all the example data doesn’t contain any customer number while the function module set customer number as an obligatory parameter.

Create PM Notification
Create PM Notification screenshot

Then it leaves me to the second choice, BAPI_SERVNOT_CREATE. When I tried to create service notification using this function, it keeps giving this error: ‘Notification Type M1 is not defined’. Now I need to know how to populate the data in the function module. Maybe I populated them wrong, so I run this function BAPI_SERVNOT_GET_DETAIL filling service notification number that has been created manually. It still giving the same error ‘Notification Type M1 is not defined’. Then I almost gave up.

People are suggesting me to use BAPI_ALM_NOTIF_CREATE, but unfortunately we don’t have that function in our system. We’re using SAP R/3 4.6C. Once again I was stuck.

Then I chat with my friend and got the idea to search any function module which contains “*NOT*CREATE”…. And voila! My eyes were stuck to ALM_PM_MAINTNOT_CREATE! Why? First, because it contains “PM” which means it must be for the PM module. Secondly, it contains “MAINTNOT” which stands for MAINTENANCE NOTIFICATION. Perfect! It was just what I was looking for all this time.

Now (as I promised), I’m going to share you the simplest example code to make this function module work. You can customize it depends your own needs. Here it is:

data: notifheader like bapi2080_nothdri,
notifheader_export like bapi2080_nothdre,
LONGTEXTS like BAPI2080_NOTFULLTXTI occurs 0 with header line,
RETURN like BAPIRET2 occurs 0 with header line.

clear notifheader.
notifheader-EQUIPMENT = ‘F2-INV-TOY-001-004′.
notifheader-SHORT_TEXT = ‘Ext. perbaikan D 1382EZ pake alm’.
notifheader-PRIORITY = ‘1′.
notifheader-PLANPLANT = ‘1000′.
notifheader-PLANGROUP = ‘100′.
notifheader-REPORTEDBY = ‘VERA’.
notifheader-NOTIF_DATE = sy-datum.
notifheader-NOTIFTIME = sy-uzeit.

refresh longtexts.
longtexts-OBJTYPE = ‘QMEL’.
longtexts-FORMAT_COL = ‘U1′.
longtexts-TEXT_LINE = ‘line 1′.
append longtexts.
longtexts-TEXT_LINE = ‘line 2′.
append longtexts.
longtexts-TEXT_LINE = ‘line 3′.
append longtexts.

EXTERNAL_NUMBER = external_number
notif_type = ‘M1′
notifheader = notifheader
NOTIFHEADER_EXPORT = notifheader_export
LONGTEXTS = longtexts
RETURN = return.

if sy-subrc eq 0.
refresh return.
number = notifheader_export-NOTIF_NO
NOTIFHEADER = notifheader_export
RETURN = return.

* WAIT =

vera ABAP , ,

  1. No comments yet.
  1. No trackbacks yet.