‎2007 Dec 19 6:59 PM
Hi,
We are using the BAPI BAPI_ALM_NOTIF_CREATE to create a plant maintenance notification. I have populated it with the following data :
maintenance notification type
equipment number in header
functional location in header
coding group in header
coding in header
I am using a wrapper bapi to house this one and am also calling a BAPI_TRANSACTION_COMMIT after this bapi is called .
However my problem is when the BAPI runs. The result has notification number which starts with a '%'. When i go into IW23 to check if a notification was created , none exists !
I used the same data and ran transaction IW21 directly, and the notification was successfully created. That means the data im using is correct and sufficient.
So why is it not being created properly with the BAPI ?
Any and all help will be greatly appreciated.
Thanks,
Amit
‎2007 Dec 19 7:32 PM
HI Amit,
Can you show your code?
Did you try passing an external number for the notification?
Regards,
Ravi Kanth Talagana
‎2007 Dec 19 7:46 PM
Hi Ravi,
Thank you for your reply . I am not using external number . Heres the code im using :
FUNCTION Z_MMT_WRAPPER_BAPI_PM.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(NOTIFICATION_TYPE) TYPE QMART
*" VALUE(SHORT_TEXT) TYPE QMTXT OPTIONAL
*" VALUE(EQUIPMENT) TYPE EQUNR
*" VALUE(FUNCTIONAL_LOC) TYPE TPLNR
*" VALUE(CODING_GROUP) TYPE QMGRP OPTIONAL
*" VALUE(CODING) TYPE QMCOD OPTIONAL
*" EXPORTING
*" VALUE(BAPIOUTPUT) TYPE BAPI2080_NOTHDRE
*" TABLES
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
*"----
data : notifheader like BAPI2080_NOTHDRI,
notifexport like BAPI2080_NOTHDRE,
returntab type table of bapiret2,
return_commit type bapiret2.
notifheader-equipment = equipment.
notifheader-funct_loc = functional_loc.
notifheader-short_text = short_text.
notifheader-code_group = coding_group.
notifheader-coding = coding.
CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
EXPORTING
EXTERNAL_NUMBER =
NOTIF_TYPE = notification_type
NOTIFHEADER = notifheader
TASK_DETERMINATION = ' '
SENDER =
ORDERID =
IMPORTING
NOTIFHEADER_EXPORT = notifexport
TABLES
NOTITEM =
NOTIFCAUS =
NOTIFACTV =
NOTIFTASK =
NOTIFPARTNR =
LONGTEXTS =
KEY_RELATIONSHIPS =
RETURN = return
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN = return_commit
.
bapioutput = notifexport.
ENDFUNCTION.
Im still getting the same output which goes something like this (this is the output notification header ) :
NOTIF_NO %00000000002
PLANPLANT 1000
LOC_ACC 000000002215
EQUIPMENT 10000000
ASSEMBLY
BREAKDOWN
STRMLFNDATE 19.12.2007
ENDMLFNDATE
STRMLFNTIME 19:49:21
ENDMLFNTIME 00:00:00
DOWNTIME 0,000000000000000E+00
UNIT
ISOCODE_UNIT
PLANGROUP 10
MNTPLAN
MNTCALL_NO 0
MAINTITEM
NOTIF_TYPE M2
SHORT_TEXT TESTING AGAIN
PRIOTYPE PM
PRIORITY
CREATED_BY
CREATED_ON
CHANGED_BY
CHANGED_ON
NOTIFTIME 19:49:21
NOTIF_DATE 19.12.2007
I do not understand why the notification number is starting with a %, and also it doesnt exist in the system !
Thanks
Amit
‎2007 Dec 19 10:10 PM
Hi Amit
in BAPI_TRANSACTION_COMMIT, try putting WAIT = 'X' and see
Cheers
~Arun
‎2007 Dec 19 11:25 PM
HI Amit,
Did you check if the notif got created wuth a number 00000000002?
Regards,
Ravi Kanth Talagana
‎2007 Dec 20 4:23 PM
Hi Ravi, thank you for your reply.
Apparently, the BAPI_ALM_NOTIF_CREATE cannot be used on its own. it will generate only a temperory number which then has to be fed to BAPI_ALM_NOTIF_SAVE. This will actually post the data to the tables.
Thanks,
Amit
‎2007 Dec 27 9:04 PM
Even if I fill the required components of BAPI2080_NOTHDRI
-BREAKDOWN = 'X'
-STRMLFNDATE = '20071212'
-STRMLFNTIME = '123005'
and
-ENDMLFNDATE = '20071212'
-ENDMLFNTIME = '133005'
, BADI does not calculate DOWNTIME.
DOWNTIME returns 0.
why does it work like that?
‎2010 Feb 04 5:45 AM
Hi Experts,
got the same problem. The notification is created successful but the downtime is 0. Why? In IW21 the downtime is calculated automaticlly?
Regards Henryk
‎2010 Nov 03 3:43 PM
This BAPI does not calculate the downtime. Try to implement a user exit QQMA0025 / EXIT_SAPLIQS0_017with the code:
IF c_viqmel-msaus = 'X'
c_viqmel-auszt = ( c_viqmel-ausbs - c_viqmel-ausvn ) * 24 * 60 * 60.
c_viqmel-auszt = c_viqmel-auszt + ( c_viqmel-auztb - c_viqmel-auztv ).
IF c_viqmel-auszt < 0 .
CLEAR c_viqmel-auszt.
ENDIF.
ENDIF.
Edited by: Wojciech Rutkowski on Nov 3, 2010 4:46 PM
‎2013 Jul 02 2:57 PM