Application Development and Automation 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: 
Read only

Malfunction date in Quality Notification

Former Member
0 Likes
2,467

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

1 ACCEPTED SOLUTION
Read only

Subhankar
Active Contributor
0 Likes
1,823

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

7 REPLIES 7
Read only

Subhankar
Active Contributor
0 Likes
1,824

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

Read only

Former Member
0 Likes
1,823

Hi,

Use FM IQS4_CREATE_NOTIFICATION for your purpose.

Pass malfunction date in I_RIQS5-AUSVN.

Thanks,

Vijay

Read only

0 Likes
1,823

Thank you Subhankar and Vijay.

I used the fms..

IQS4_GET_NOTIFICATION

IQS4_MODIFY_NOTIFICATION

Kind regards,

Huntr

Read only

0 Likes
1,823

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.

Read only

0 Likes
1,823

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

Read only

0 Likes
1,823

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.

Read only

0 Likes
1,823

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