SAP BP_CREATE_MAIL Function Module for
BP_CREATE_MAIL is a standard bp create mail 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 bp create mail FM, simply by entering the name BP_CREATE_MAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: BPFC
Program Name: SAPLBPFC
Main Program: SAPLBPFC
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BP_CREATE_MAIL 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 'BP_CREATE_MAIL'".
EXPORTING
I_HI_OBJNR = "Hierarchy object number
* I_GJAHR = '0000' "
* I_GEBER = ' ' "Budget element object fund
* I_FAREA = ' ' "Functional Area
* I_TMP_OBJNR = ' ' "Budget element object fund
* I_OBJNR_XX = ' ' "
* I_POSIT_XX = ' ' "
* I_FAREA_XX = ' ' "Functional Area
* I_APPLIK = 'P' "Application
* I_MSGNR = ' ' "
* I_MSGV1 = ' ' "
* I_MSGV2 = ' ' "
* I_MSGV3 = ' ' "
* I_MSGV4 = ' ' "
I_OBJNR = "Budget element object number
I_POSIT = "Budget element object item
EXCEPTIONS
NOT_CREATED = 1
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLBPFC_001 User Exist: Define Mail Recipients
EXIT_SAPLBPFC_002 User-Exit: Specification of the Action for the Availability Control
EXIT_SAPLBPFC_003 User Exit: Substitution of Functional Area's Commitment/Actual to Be Chkd
IMPORTING Parameters details for BP_CREATE_MAIL
I_HI_OBJNR - Hierarchy object number
Data type: BPHI-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
I_GJAHR -
Data type: BPJA-GJAHRDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GEBER - Budget element object fund
Data type: BPJA-GEBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FAREA - Functional Area
Data type: BPJA-FAREADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TMP_OBJNR - Budget element object fund
Data type: ONR00-OBJNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_OBJNR_XX -
Data type: BPIJ-CO_OBJNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_POSIT_XX -
Data type: BPIJ-POSITDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FAREA_XX - Functional Area
Data type: BPIJ-FAREADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_APPLIK - Application
Data type: TBPFC-APPLIKDefault: 'P'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSGNR -
Data type: T100-MSGNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSGV1 -
Data type: MESG-MSGV1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSGV2 -
Data type: MESG-MSGV2Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSGV3 -
Data type: MESG-MSGV3Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSGV4 -
Data type: MESG-MSGV4Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_OBJNR - Budget element object number
Data type: BPIJ-CO_OBJNROptional: No
Call by Reference: No ( called with pass by value option)
I_POSIT - Budget element object item
Data type: BPIJ-POSITOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_CREATED - Mail was not created due to lack of addressee
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BP_CREATE_MAIL 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_i_hi_objnr | TYPE BPHI-OBJNR, " | |||
| lv_not_created | TYPE BPHI, " | |||
| lv_i_gjahr | TYPE BPJA-GJAHR, " '0000' | |||
| lv_i_geber | TYPE BPJA-GEBER, " SPACE | |||
| lv_i_farea | TYPE BPJA-FAREA, " SPACE | |||
| lv_i_tmp_objnr | TYPE ONR00-OBJNR, " SPACE | |||
| lv_i_objnr_xx | TYPE BPIJ-CO_OBJNR, " SPACE | |||
| lv_i_posit_xx | TYPE BPIJ-POSIT, " SPACE | |||
| lv_i_farea_xx | TYPE BPIJ-FAREA, " SPACE | |||
| lv_i_applik | TYPE TBPFC-APPLIK, " 'P' | |||
| lv_i_msgnr | TYPE T100-MSGNR, " SPACE | |||
| lv_i_msgv1 | TYPE MESG-MSGV1, " SPACE | |||
| lv_i_msgv2 | TYPE MESG-MSGV2, " SPACE | |||
| lv_i_msgv3 | TYPE MESG-MSGV3, " SPACE | |||
| lv_i_msgv4 | TYPE MESG-MSGV4, " SPACE | |||
| lv_i_objnr | TYPE BPIJ-CO_OBJNR, " | |||
| lv_i_posit | TYPE BPIJ-POSIT. " |
|   CALL FUNCTION 'BP_CREATE_MAIL' " |
| EXPORTING | ||
| I_HI_OBJNR | = lv_i_hi_objnr | |
| I_GJAHR | = lv_i_gjahr | |
| I_GEBER | = lv_i_geber | |
| I_FAREA | = lv_i_farea | |
| I_TMP_OBJNR | = lv_i_tmp_objnr | |
| I_OBJNR_XX | = lv_i_objnr_xx | |
| I_POSIT_XX | = lv_i_posit_xx | |
| I_FAREA_XX | = lv_i_farea_xx | |
| I_APPLIK | = lv_i_applik | |
| I_MSGNR | = lv_i_msgnr | |
| I_MSGV1 | = lv_i_msgv1 | |
| I_MSGV2 | = lv_i_msgv2 | |
| I_MSGV3 | = lv_i_msgv3 | |
| I_MSGV4 | = lv_i_msgv4 | |
| I_OBJNR | = lv_i_objnr | |
| I_POSIT | = lv_i_posit | |
| EXCEPTIONS | ||
| NOT_CREATED = 1 | ||
| . " BP_CREATE_MAIL | ||
ABAP code using 7.40 inline data declarations to call FM BP_CREATE_MAIL
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 OBJNR FROM BPHI INTO @DATA(ld_i_hi_objnr). | ||||
| "SELECT single GJAHR FROM BPJA INTO @DATA(ld_i_gjahr). | ||||
| DATA(ld_i_gjahr) | = '0000'. | |||
| "SELECT single GEBER FROM BPJA INTO @DATA(ld_i_geber). | ||||
| DATA(ld_i_geber) | = ' '. | |||
| "SELECT single FAREA FROM BPJA INTO @DATA(ld_i_farea). | ||||
| DATA(ld_i_farea) | = ' '. | |||
| "SELECT single OBJNR FROM ONR00 INTO @DATA(ld_i_tmp_objnr). | ||||
| DATA(ld_i_tmp_objnr) | = ' '. | |||
| "SELECT single CO_OBJNR FROM BPIJ INTO @DATA(ld_i_objnr_xx). | ||||
| DATA(ld_i_objnr_xx) | = ' '. | |||
| "SELECT single POSIT FROM BPIJ INTO @DATA(ld_i_posit_xx). | ||||
| DATA(ld_i_posit_xx) | = ' '. | |||
| "SELECT single FAREA FROM BPIJ INTO @DATA(ld_i_farea_xx). | ||||
| DATA(ld_i_farea_xx) | = ' '. | |||
| "SELECT single APPLIK FROM TBPFC INTO @DATA(ld_i_applik). | ||||
| DATA(ld_i_applik) | = 'P'. | |||
| "SELECT single MSGNR FROM T100 INTO @DATA(ld_i_msgnr). | ||||
| DATA(ld_i_msgnr) | = ' '. | |||
| "SELECT single MSGV1 FROM MESG INTO @DATA(ld_i_msgv1). | ||||
| DATA(ld_i_msgv1) | = ' '. | |||
| "SELECT single MSGV2 FROM MESG INTO @DATA(ld_i_msgv2). | ||||
| DATA(ld_i_msgv2) | = ' '. | |||
| "SELECT single MSGV3 FROM MESG INTO @DATA(ld_i_msgv3). | ||||
| DATA(ld_i_msgv3) | = ' '. | |||
| "SELECT single MSGV4 FROM MESG INTO @DATA(ld_i_msgv4). | ||||
| DATA(ld_i_msgv4) | = ' '. | |||
| "SELECT single CO_OBJNR FROM BPIJ INTO @DATA(ld_i_objnr). | ||||
| "SELECT single POSIT FROM BPIJ INTO @DATA(ld_i_posit). | ||||
Search for further information about these or an SAP related objects