Get GOS attachment list for notification via BAPI

SimonFreeman picture SimonFreeman · Jun 24, 2016 · Viewed 7.7k times · Source

I need to find a BAPI (or a chain of BAPIs?) to read the Notification Attachment List (GOS) using as input the Notification number.

enter image description here

I've tried many BAPIs, but the only functional result was via SO_OBJECT_READ FM to which I passed Object ID (which I obtained from SOOD table).

enter image description here

Problem is that I'm unable to retrieve the attachment object list belonging to the notification. Any idea or suggestion?

Answer

Suncatcher picture Suncatcher · Jun 24, 2016

Try to use BDS_GOS_CONNECTIONS_GET function module to retrieve attachment list for notification. Specify parameters like this:

CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
  IMPORTING
   logical_system  = <system name> * << optional parameter       
   classname       = BPR_NOTIF     * << object type for notifications     
   objkey          = 1014866112016 * << your notification number + year        
   client          = XXX
  TABLES
   gos_connections = lt_attachments
.

The attachments links can be found in SRGBTBREL table and FM OBJKEY parameter corresponds to INSTID_A field of this table.