SAP Mass Attachments Extraction for Sales Documents (ABAP)

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.

The same ABAP Code can be user to mass extract Attachment for

The original post is SAP GOS Attachment Technical

SAP Attachment: Miscellaneous Tips

Search Help for Directory Selection

The method cl_gui_frontend_services=>directory_browse offers to select a folder from presentation server ( local ).

The result SELECTED_FOLDER is the full path for a local directory.

Check if a file exists on presentation Server

The method cl_gui_frontend_services=>file_exist checks if a file exists locally ( on presentation server).

The result is initial if the file dosn’t exist.

SAP Functions Modules Used for Attachment

Here the list of the main SAP Function Modules & Methods used below in order to extract and to download Attachment


This standard Method cl_gui_frontend_services=>directory_browse will retrieve list of local (desktop) folder.

In the most of cases, it is used to select a folder at presentation server as help search for local Directory Search .


This method cl_gui_frontend_services=>file_exist checks if a file exists already .


SO_OBJECT_DOWNLOAD function module will create a file from internal table in SAP to a given pathname.

ABAP Code for SAP Attachment Mass extraction

SAP and SAP logo are registered trademarks of SAP AG. is not associated with SAP AG.

We have made every effort to make sure provide relevant search results, use the content on this site at your own risk.

We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites.