SAP EMMA_BAPIRETURN_GET2 Function Module for
EMMA_BAPIRETURN_GET2 is a standard emma bapireturn get2 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 emma bapireturn get2 FM, simply by entering the name EMMA_BAPIRETURN_GET2 into the relevant SAP transaction such as SE37 or SE38.
Function Group: EMMA_API
Program Name: SAPLEMMA_API
Main Program: SAPLEMMA_API
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function EMMA_BAPIRETURN_GET2 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 'EMMA_BAPIRETURN_GET2'".
EXPORTING
TYPE = "Message Type
* PARAMETER = ' ' "Parameter Name
* ROW = 0 "Row Number
* FIELD = ' ' "Field Name
* CL = 'EMMA' "Message Class (Message ID)
NUMBER = "Message Number
* PAR1 = ' ' "Variable 1
* PAR2 = ' ' "Variable 2
* PAR3 = ' ' "Variable 3
* PAR4 = ' ' "Variable 4
* LOG_NO = "Application Log ID
* LOG_MSG_NO = "Current Number in Application Log
IMPORTING
RETURN = "BAPI Return Parameter(s)
IMPORTING Parameters details for EMMA_BAPIRETURN_GET2
TYPE - Message Type
Data type: BAPIRETURN-TYPEOptional: No
Call by Reference: Yes
PARAMETER - Parameter Name
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
ROW - Row Number
Data type: BAPIRET2-ROWOptional: Yes
Call by Reference: Yes
FIELD - Field Name
Data type: BAPIRET2-FIELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
CL - Message Class (Message ID)
Data type: SY-MSGIDDefault: 'EMMA'
Optional: Yes
Call by Reference: Yes
NUMBER - Message Number
Data type: SY-MSGNOOptional: No
Call by Reference: Yes
PAR1 - Variable 1
Data type: ANYDefault: SPACE
Optional: Yes
Call by Reference: Yes
PAR2 - Variable 2
Data type: ANYDefault: SPACE
Optional: Yes
Call by Reference: Yes
PAR3 - Variable 3
Data type: ANYDefault: SPACE
Optional: Yes
Call by Reference: Yes
PAR4 - Variable 4
Data type: ANYDefault: SPACE
Optional: Yes
Call by Reference: Yes
LOG_NO - Application Log ID
Data type: BAPIRETURN-LOG_NOOptional: Yes
Call by Reference: Yes
LOG_MSG_NO - Current Number in Application Log
Data type: BAPIRETURN-LOG_MSG_NOOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for EMMA_BAPIRETURN_GET2
RETURN - BAPI Return Parameter(s)
Data type: BAPIRET2Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for EMMA_BAPIRETURN_GET2 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: | ||||
| lv_type | TYPE BAPIRETURN-TYPE, " | |||
| lv_return | TYPE BAPIRET2, " | |||
| lv_parameter | TYPE C, " SPACE | |||
| lv_row | TYPE BAPIRET2-ROW, " 0 | |||
| lv_field | TYPE BAPIRET2-FIELD, " SPACE | |||
| lv_cl | TYPE SY-MSGID, " 'EMMA' | |||
| lv_number | TYPE SY-MSGNO, " | |||
| lv_par1 | TYPE ANY, " SPACE | |||
| lv_par2 | TYPE ANY, " SPACE | |||
| lv_par3 | TYPE ANY, " SPACE | |||
| lv_par4 | TYPE ANY, " SPACE | |||
| lv_log_no | TYPE BAPIRETURN-LOG_NO, " | |||
| lv_log_msg_no | TYPE BAPIRETURN-LOG_MSG_NO. " |
|   CALL FUNCTION 'EMMA_BAPIRETURN_GET2' " |
| EXPORTING | ||
| TYPE | = lv_type | |
| PARAMETER | = lv_parameter | |
| ROW | = lv_row | |
| FIELD | = lv_field | |
| CL | = lv_cl | |
| NUMBER | = lv_number | |
| PAR1 | = lv_par1 | |
| PAR2 | = lv_par2 | |
| PAR3 | = lv_par3 | |
| PAR4 | = lv_par4 | |
| LOG_NO | = lv_log_no | |
| LOG_MSG_NO | = lv_log_msg_no | |
| IMPORTING | ||
| RETURN | = lv_return | |
| . " EMMA_BAPIRETURN_GET2 | ||
ABAP code using 7.40 inline data declarations to call FM EMMA_BAPIRETURN_GET2
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.| "SELECT single TYPE FROM BAPIRETURN INTO @DATA(ld_type). | ||||
| DATA(ld_parameter) | = ' '. | |||
| "SELECT single ROW FROM BAPIRET2 INTO @DATA(ld_row). | ||||
| "SELECT single FIELD FROM BAPIRET2 INTO @DATA(ld_field). | ||||
| DATA(ld_field) | = ' '. | |||
| "SELECT single MSGID FROM SY INTO @DATA(ld_cl). | ||||
| DATA(ld_cl) | = 'EMMA'. | |||
| "SELECT single MSGNO FROM SY INTO @DATA(ld_number). | ||||
| DATA(ld_par1) | = ' '. | |||
| DATA(ld_par2) | = ' '. | |||
| DATA(ld_par3) | = ' '. | |||
| DATA(ld_par4) | = ' '. | |||
| "SELECT single LOG_NO FROM BAPIRETURN INTO @DATA(ld_log_no). | ||||
| "SELECT single LOG_MSG_NO FROM BAPIRETURN INTO @DATA(ld_log_msg_no). | ||||
Search for further information about these or an SAP related objects