2011 Nov 14 11:11 PM
Hello,
I call the following BAPI's to create a QN, specifically type Q5:
BAPI_QUALNOT_CREATE
BAPI_QUALNOT_SAVE
BAPI_TRANSACTION_COMMIT (and wait = X)
The QN gets created successfully. But, because the BAPI does not include the Malfunction Date (QMIH-AUSVN), I resorted to doing a BDC recording on QM02 and plugging in the malfunction date. When I debug through the BDC program, it returns a message "Notification nnnnnn was saved". However, when check the notification in QM02, the malfunction date is not there. When I check QMIH-AUSVN, the date is not updated either. I found that the date gets updated sometimes, and sometimes not.
Does anyone know why this is so?
Does anyone know a better way of programatically updating the Malfunction date in the background?
Kind regards and many thanks,
Huntr
2011 Nov 15 12:06 AM
After creating the QN, you are doing the BDC. There might have some locking issue.
Can you run the BDC in debug mode and check if its successfully saved or nor. In debug mode if there any locking issue you will get the error message. If you did not receive any error message, then put some wait after BAPI transaction commit and check again.
Instead of BDC, can you check the below FM- ISU_SMNOTIF_SETTIME
Thanks
Subhankar
Edited by: Subhankar Garani on Nov 15, 2011 1:25 AM
Hello,
I call the following BAPI's to create a QN, specifically type Q5:
BAPI_QUALNOT_CREATE
BAPI_QUALNOT_SAVE
BAPI_TRANSACTION_COMMIT (and wait = X)
The QN gets created successfully. But, because the BAPI does not include the Malfunction Date (QMIH-AUSVN), I resorted to doing a BDC recording on QM02 and plugging in the malfunction date. When I debug through the BDC program, it returns a message "Notification nnnnnn was saved". However, when check the notification in QM02, the malfunction date is not there. When I check QMIH-AUSVN, the date is not updated either. I found that the date gets updated sometimes, and sometimes not.
Does anyone know why this is so?
Does anyone know a better way of programatically updating the Malfunction date in the background?
Kind regards and many thanks,
Huntr
2011 Nov 15 12:06 AM
After creating the QN, you are doing the BDC. There might have some locking issue.
Can you run the BDC in debug mode and check if its successfully saved or nor. In debug mode if there any locking issue you will get the error message. If you did not receive any error message, then put some wait after BAPI transaction commit and check again.
Instead of BDC, can you check the below FM- ISU_SMNOTIF_SETTIME
Thanks
Subhankar
Edited by: Subhankar Garani on Nov 15, 2011 1:25 AM
2011 Nov 15 3:19 AM
Hi,
Use FM IQS4_CREATE_NOTIFICATION for your purpose.
Pass malfunction date in I_RIQS5-AUSVN.
Thanks,
Vijay
2011 Nov 15 4:43 AM
Thank you Subhankar and Vijay.
I used the fms..
IQS4_GET_NOTIFICATION
IQS4_MODIFY_NOTIFICATION
Kind regards,
Huntr
2012 Feb 03 8:03 AM
HI,
I also have the same problem. Can you elaborate how did you solve the issue?
Have you completely removed the usabge of BAPI and used the 2 FMs mentioned in your post? or how it is?
really appreciate your help.
Tahnks,
Pallavi.
2012 Feb 03 6:14 PM
Hi Pallavi,
I continued to use the BAPI for all of the changes it accepts and used the extra FM for the ones the the BAPI doesn't do. Once the BAPI is successful, I use the fm IQS4_GET_NOTIFICATION to get the data that I want back. Then, I make the changes with the fm IQS4_MODIFY_NOTIFICATION.
I hope this helps you, too.
Huntr
2012 Feb 08 11:22 AM
Hi Huntr
I have called the FMs after the notification is created using BAPI. When I pass the malfunction end date to this FM, it is getting created, but some other fileds(required start date, required end date, plant etc..) which are already created using BAPI are deleted now. Not sure what has happened. Do we need to pass the entire data again to this FM? What data needs to be passed.
Could you please help me out in this regard.
Thanks,
Pallavi.
2012 Feb 08 5:34 PM
Yes, you need to retrieve the entire data for the parameters that you need only. For example, below I need to make changes in the qmel record.
CALL FUNCTION 'IQS4_GET_NOTIFICATION'
EXPORTING
i_qmnum = lv_qualnotnum
IMPORTING
e_viqmel = ls_fviqmel
TABLES
return = lt_return.
MOVE-CORRESPONDING ls_fviqmel TO lw_riqs5_new.
lw_riqs5_new-ausvn = equipmentfailuredate.
CALL FUNCTION 'IQS4_MODIFY_NOTIFICATION'
EXPORTING
i_qmnum = lv_qualnotnum
i_riqs5_new = lw_riqs5_new
i_commit = 'X'
IMPORTING
e_viqmel_old = ls_viqmel_old
e_viqmel_new = ls_viqmel_new
TABLES
return = lt_return.
Good luck,
Huntr