The OData Channel provides a generic solution for exposing binary data that is stored in an SAP Business Suite backend system and should be accessible using a media link entry. Here the definition of the DPC method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM in order to retrieve the media. Also, you will find some useful sample of GET_STREAM method implementation.
SAP Attachment: The following ABAP program sample is optimized to Mass extraction of SAP Attachments (GOS) for Sales Documents. SAP Mass Attachments Extraction using ABAP.
SAP GOS : Generic Object Services offer functions for Business Objects through different SAP Applications. All object services are available in a function list (toolbox) in which the following functions are offered.