Search code examples
abapsap-erp

Get Quality Notification SAP - BAPI_QUALNOT_GETDETAIL


So I've been given the task of trying to extract quality notification data from ECC. The path that I've chosen is to find a BAPI that can extract the data into tables and wrote a FM using SE37.

After a bit of Googling around I've found a BAPI called "BAPI_QUALNOT_GETDETAIL". The problem that I'm facing at the moment is to get the data to populate into the export tables of the BAPI.

Notification in QMEL Table

As seen from the above screenshot the details are available in the QMEL table.

Following is the method that I've implemented the BAPI;

CALL FUNCTION 'BAPI_QUALNOT_GETDETAIL' "QM Notification: Read Detail Data
  EXPORTING
    number =         '200360210'           " bapi2078_nothdre-notif_no  Message Number
  IMPORTING
    notifheader_export =    bapi2078_nothdre_t    " bapi2078_nothdre  BAPI Quality Notification Header
    notifhdtext =      bapi2078_nothdtxte_t      " bapi2078_nothdtxte  Text Fields for Notification Header
 TABLES
   notlongtxt =               bapi2078_notfulltxti_t " bapi2078_notfulltxti  Notification Long Text
*   notitem =                   " bapi2078_notiteme  Work Table for Notification Item
*   notifcaus =                 " bapi2078_notcause  Notification Cause
*   notifactv =                 " bapi2078_notactve  Work Structure Activities
*   notiftask =                 " bapi2078_nottaske  Work table for tasks
*   notifpartnr =               " bapi2078_notpartnre  Partner(s) for Display
*   return =                    " bapiret2      Return Parameter(s)
    .  "  BAPI_QUALNOT_GETDETAIL

Is there a mistake in the way that I'm calling the BAPI since I'm not able to get the data.


Solution

  • You have to provide the key exactly as it is handled internally. Very likely, there will be a conversion routine like ALPHA in place that suppresses leading zeroes when displaying the number and adds them when entering the number. You can switch this routine off in transaction SE16N to check. However, this is only a convenience implementation for the user - the developer always has to provide the complete value, including leading zeroes if it's a character-based key field (not for numeric types like INT4, though).