SAP MSAM_GET_ATTACH_HEADERS Function Module for MSAM get the attachment header details
MSAM_GET_ATTACH_HEADERS is a standard msam get attach headers SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for MSAM get the attachment header details processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for msam get attach headers FM, simply by entering the name MSAM_GET_ATTACH_HEADERS into the relevant SAP transaction such as SE37 or SE38.
Function Group: MSAM_MO_ATTACHMENT
Program Name: SAPLMSAM_MO_ATTACHMENT
Main Program: SAPLMSAM_MO_ATTACHMENT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MSAM_GET_ATTACH_HEADERS pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'MSAM_GET_ATTACH_HEADERS'"MSAM get the attachment header details.
EXPORTING
OBJECT_KEY = "Object key
OBJECT_TYPE = "Object Type
* NO_DOCS = "Number of Documents from History
* NO_DAYS = "Number of Days from History
* DOC_SIZE = "Maximum Attachment Size in KBs
TABLES
ATTACHMENT = "MSAM Attachment header
* RETURN = "Return Parameter
IMPORTING Parameters details for MSAM_GET_ATTACH_HEADERS
OBJECT_KEY - Object key
Data type: CHAR32Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_TYPE - Object Type
Data type: CHAR32Optional: No
Call by Reference: No ( called with pass by value option)
NO_DOCS - Number of Documents from History
Data type: ALM_ME_HISTORY_NUMOptional: Yes
Call by Reference: Yes
NO_DAYS - Number of Days from History
Data type: ALM_ME_HISTORY_DAYSOptional: Yes
Call by Reference: Yes
DOC_SIZE - Maximum Attachment Size in KBs
Data type: MSAM_MAX_ATTACHMENT_SIZEOptional: Yes
Call by Reference: Yes
TABLES Parameters details for MSAM_GET_ATTACH_HEADERS
ATTACHMENT - MSAM Attachment header
Data type: MSAM10_ATTACH_HEADEROptional: No
Call by Reference: Yes
RETURN - Return Parameter
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for MSAM_GET_ATTACH_HEADERS Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_attachment | TYPE STANDARD TABLE OF MSAM10_ATTACH_HEADER, " | |||
| lv_object_key | TYPE CHAR32, " | |||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_object_type | TYPE CHAR32, " | |||
| lv_no_docs | TYPE ALM_ME_HISTORY_NUM, " | |||
| lv_no_days | TYPE ALM_ME_HISTORY_DAYS, " | |||
| lv_doc_size | TYPE MSAM_MAX_ATTACHMENT_SIZE. " |
|   CALL FUNCTION 'MSAM_GET_ATTACH_HEADERS' "MSAM get the attachment header details |
| EXPORTING | ||
| OBJECT_KEY | = lv_object_key | |
| OBJECT_TYPE | = lv_object_type | |
| NO_DOCS | = lv_no_docs | |
| NO_DAYS | = lv_no_days | |
| DOC_SIZE | = lv_doc_size | |
| TABLES | ||
| ATTACHMENT | = lt_attachment | |
| RETURN | = lt_return | |
| . " MSAM_GET_ATTACH_HEADERS | ||
ABAP code using 7.40 inline data declarations to call FM MSAM_GET_ATTACH_HEADERS
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.Search for further information about these or an SAP related objects