SAP PS_BAPI_PREPARE Function Module for NOTRANSL: Vorarbeiten für das BAPI, Aufruf der BAdIs
PS_BAPI_PREPARE is a standard ps bapi prepare SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Vorarbeiten für das BAPI, Aufruf der BAdIs 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 ps bapi prepare FM, simply by entering the name PS_BAPI_PREPARE into the relevant SAP transaction such as SE37 or SE38.
Function Group: PS_BAPI
Program Name: SAPLPS_BAPI
Main Program: SAPLPS_BAPI
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PS_BAPI_PREPARE 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 'PS_BAPI_PREPARE'"NOTRANSL: Vorarbeiten für das BAPI, Aufruf der BAdIs.
EXPORTING
* I_NUMBER = "Network Number
* I_PROJECT_DEFINITION_DELETE = "Project Definition
I_METHOD = "
* I_NETWORK_CREATE = "Data Structure: Create Network Header
* I_NETWORK_CHANGE = "Change Data Structure of Network Header
* I_UPDATE_NETWORK = "Change Update Structure of Network Header
* I_NETWORK_DELETE = "Network Number
* I_PROJECT_NAME = "Project Definition
* I_PROJECT_DEFINITION_CREATE = "Data Structure: Create Project Definition
* I_PROJECT_DEFINITION_CHANGE = "Data Structure: Change Project Definition
* I_UPDATE_PROJECT_DEFINITION = "Update Structure: Change Project Definition
IMPORTING
E_NUMBER = "Network Number
E_PROJECT_NAME = "Project Definition
TABLES
* IT_ACTIVITY_CREATE = "
* IT_WBS_ELEMENT_CHANGE = "Data Structure: Change WBS Element
* IT_UPDATE_WBS_ELEMENT = "Update Structure: Change WBS Element
* IT_WBS_ELEMENT_DELETE = "WBS Element List for the BAPI Processing
* EXTENSIONIN = "Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
* EXTENSIONOUT = "Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
* IT_ACTIVITY_CHANGE = "
* IT_UPDATE_ACTIVITY = "
* IT_ACTIVITY_DELETE = "Activity List for the BAPI Processing
* IT_ACT_ELEMENT_CREATE = "Data Structure: Create Activity Element
* IT_ACT_ELEMENT_CHANGE = "Data Structure: Change Activity Element
* IT_UPDATE_ACT_ELEMENT = "Update: Change Activity Element
* IT_ACT_ELEMENT_DELETE = "Activity List for the BAPI Processing
* IT_WBS_ELEMENT_CREATE = "Data Structure: Create WBS Element
EXCEPTIONS
PRECOMMIT_ALREADY_CALLED = 1 INIT_MISSING = 2 NETWORK_READ_ERROR = 3 ONE_PROJECT_VIOLATION = 4 BADI_ERROR = 5 PROJECT_READ_ERROR = 6 CANT_CREATE_DATES = 7
IMPORTING Parameters details for PS_BAPI_PREPARE
I_NUMBER - Network Number
Data type: BAPI_NETWORK_LIST-NETWORKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PROJECT_DEFINITION_DELETE - Project Definition
Data type: BAPI_BUS2001_NEW-PROJECT_DEFINITIONOptional: Yes
Call by Reference: No ( called with pass by value option)
I_METHOD -
Data type: FLG_MODEOptional: No
Call by Reference: No ( called with pass by value option)
I_NETWORK_CREATE - Data Structure: Create Network Header
Data type: BAPI_BUS2002_NEWOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NETWORK_CHANGE - Change Data Structure of Network Header
Data type: BAPI_BUS2002_CHGOptional: Yes
Call by Reference: No ( called with pass by value option)
I_UPDATE_NETWORK - Change Update Structure of Network Header
Data type: BAPI_BUS2002_UPDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NETWORK_DELETE - Network Number
Data type: BAPI_NETWORK_LIST-NETWORKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PROJECT_NAME - Project Definition
Data type: BAPI_BUS2001_NEW-PROJECT_DEFINITIONOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PROJECT_DEFINITION_CREATE - Data Structure: Create Project Definition
Data type: BAPI_BUS2001_NEWOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PROJECT_DEFINITION_CHANGE - Data Structure: Change Project Definition
Data type: BAPI_BUS2001_CHGOptional: Yes
Call by Reference: No ( called with pass by value option)
I_UPDATE_PROJECT_DEFINITION - Update Structure: Change Project Definition
Data type: BAPI_BUS2001_UPDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for PS_BAPI_PREPARE
E_NUMBER - Network Number
Data type: BAPI_NETWORK_LIST-NETWORKOptional: No
Call by Reference: No ( called with pass by value option)
E_PROJECT_NAME - Project Definition
Data type: BAPI_BUS2001_NEW-PROJECT_DEFINITIONOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for PS_BAPI_PREPARE
IT_ACTIVITY_CREATE -
Data type: BAPI_BUS2002_ACT_NEWOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_WBS_ELEMENT_CHANGE - Data Structure: Change WBS Element
Data type: BAPI_BUS2054_CHGOptional: Yes
Call by Reference: Yes
IT_UPDATE_WBS_ELEMENT - Update Structure: Change WBS Element
Data type: BAPI_BUS2054_UPDOptional: Yes
Call by Reference: Yes
IT_WBS_ELEMENT_DELETE - WBS Element List for the BAPI Processing
Data type: BAPI_WBS_LISTOptional: Yes
Call by Reference: Yes
EXTENSIONIN - Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
Data type: BAPIPAREXOptional: Yes
Call by Reference: No ( called with pass by value option)
EXTENSIONOUT - Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
Data type: BAPIPAREXOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ACTIVITY_CHANGE -
Data type: BAPI_BUS2002_ACT_CHGOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_UPDATE_ACTIVITY -
Data type: BAPI_BUS2002_ACT_UPDOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ACTIVITY_DELETE - Activity List for the BAPI Processing
Data type: BAPI_ACTIVITY_LISTOptional: Yes
Call by Reference: Yes
IT_ACT_ELEMENT_CREATE - Data Structure: Create Activity Element
Data type: BAPI_BUS2002_ACTELEM_NEWOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ACT_ELEMENT_CHANGE - Data Structure: Change Activity Element
Data type: BAPI_BUS2002_ACTELEM_CHGOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_UPDATE_ACT_ELEMENT - Update: Change Activity Element
Data type: BAPI_BUS2002_ACTELEM_UPDOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_ACT_ELEMENT_DELETE - Activity List for the BAPI Processing
Data type: BAPI_ACTELEMENT_LISTOptional: Yes
Call by Reference: Yes
IT_WBS_ELEMENT_CREATE - Data Structure: Create WBS Element
Data type: BAPI_BUS2054_NEWOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
PRECOMMIT_ALREADY_CALLED -
Data type:Optional: No
Call by Reference: Yes
INIT_MISSING -
Data type:Optional: No
Call by Reference: Yes
NETWORK_READ_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ONE_PROJECT_VIOLATION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BADI_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PROJECT_READ_ERROR -
Data type:Optional: No
Call by Reference: Yes
CANT_CREATE_DATES -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for PS_BAPI_PREPARE 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_e_number | TYPE BAPI_NETWORK_LIST-NETWORK, " | |||
| lv_i_number | TYPE BAPI_NETWORK_LIST-NETWORK, " | |||
| lt_it_activity_create | TYPE STANDARD TABLE OF BAPI_BUS2002_ACT_NEW, " | |||
| lv_precommit_already_called | TYPE BAPI_BUS2002_ACT_NEW, " | |||
| lt_it_wbs_element_change | TYPE STANDARD TABLE OF BAPI_BUS2054_CHG, " | |||
| lv_i_project_definition_delete | TYPE BAPI_BUS2001_NEW-PROJECT_DEFINITION, " | |||
| lv_i_method | TYPE FLG_MODE, " | |||
| lt_it_update_wbs_element | TYPE STANDARD TABLE OF BAPI_BUS2054_UPD, " | |||
| lt_it_wbs_element_delete | TYPE STANDARD TABLE OF BAPI_WBS_LIST, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lv_init_missing | TYPE BAPIPAREX, " | |||
| lv_e_project_name | TYPE BAPI_BUS2001_NEW-PROJECT_DEFINITION, " | |||
| lv_i_network_create | TYPE BAPI_BUS2002_NEW, " | |||
| lt_it_activity_change | TYPE STANDARD TABLE OF BAPI_BUS2002_ACT_CHG, " | |||
| lv_i_network_change | TYPE BAPI_BUS2002_CHG, " | |||
| lt_it_update_activity | TYPE STANDARD TABLE OF BAPI_BUS2002_ACT_UPD, " | |||
| lv_network_read_error | TYPE BAPI_BUS2002_ACT_UPD, " | |||
| lv_i_update_network | TYPE BAPI_BUS2002_UPD, " | |||
| lt_it_activity_delete | TYPE STANDARD TABLE OF BAPI_ACTIVITY_LIST, " | |||
| lv_one_project_violation | TYPE BAPI_ACTIVITY_LIST, " | |||
| lv_badi_error | TYPE BAPI_ACTIVITY_LIST, " | |||
| lv_i_network_delete | TYPE BAPI_NETWORK_LIST-NETWORK, " | |||
| lt_it_act_element_create | TYPE STANDARD TABLE OF BAPI_BUS2002_ACTELEM_NEW, " | |||
| lv_i_project_name | TYPE BAPI_BUS2001_NEW-PROJECT_DEFINITION, " | |||
| lv_project_read_error | TYPE BAPI_BUS2001_NEW, " | |||
| lt_it_act_element_change | TYPE STANDARD TABLE OF BAPI_BUS2002_ACTELEM_CHG, " | |||
| lv_cant_create_dates | TYPE BAPI_BUS2002_ACTELEM_CHG, " | |||
| lt_it_update_act_element | TYPE STANDARD TABLE OF BAPI_BUS2002_ACTELEM_UPD, " | |||
| lv_i_project_definition_create | TYPE BAPI_BUS2001_NEW, " | |||
| lt_it_act_element_delete | TYPE STANDARD TABLE OF BAPI_ACTELEMENT_LIST, " | |||
| lv_i_project_definition_change | TYPE BAPI_BUS2001_CHG, " | |||
| lt_it_wbs_element_create | TYPE STANDARD TABLE OF BAPI_BUS2054_NEW, " | |||
| lv_i_update_project_definition | TYPE BAPI_BUS2001_UPD. " |
|   CALL FUNCTION 'PS_BAPI_PREPARE' "NOTRANSL: Vorarbeiten für das BAPI, Aufruf der BAdIs |
| EXPORTING | ||
| I_NUMBER | = lv_i_number | |
| I_PROJECT_DEFINITION_DELETE | = lv_i_project_definition_delete | |
| I_METHOD | = lv_i_method | |
| I_NETWORK_CREATE | = lv_i_network_create | |
| I_NETWORK_CHANGE | = lv_i_network_change | |
| I_UPDATE_NETWORK | = lv_i_update_network | |
| I_NETWORK_DELETE | = lv_i_network_delete | |
| I_PROJECT_NAME | = lv_i_project_name | |
| I_PROJECT_DEFINITION_CREATE | = lv_i_project_definition_create | |
| I_PROJECT_DEFINITION_CHANGE | = lv_i_project_definition_change | |
| I_UPDATE_PROJECT_DEFINITION | = lv_i_update_project_definition | |
| IMPORTING | ||
| E_NUMBER | = lv_e_number | |
| E_PROJECT_NAME | = lv_e_project_name | |
| TABLES | ||
| IT_ACTIVITY_CREATE | = lt_it_activity_create | |
| IT_WBS_ELEMENT_CHANGE | = lt_it_wbs_element_change | |
| IT_UPDATE_WBS_ELEMENT | = lt_it_update_wbs_element | |
| IT_WBS_ELEMENT_DELETE | = lt_it_wbs_element_delete | |
| EXTENSIONIN | = lt_extensionin | |
| EXTENSIONOUT | = lt_extensionout | |
| IT_ACTIVITY_CHANGE | = lt_it_activity_change | |
| IT_UPDATE_ACTIVITY | = lt_it_update_activity | |
| IT_ACTIVITY_DELETE | = lt_it_activity_delete | |
| IT_ACT_ELEMENT_CREATE | = lt_it_act_element_create | |
| IT_ACT_ELEMENT_CHANGE | = lt_it_act_element_change | |
| IT_UPDATE_ACT_ELEMENT | = lt_it_update_act_element | |
| IT_ACT_ELEMENT_DELETE | = lt_it_act_element_delete | |
| IT_WBS_ELEMENT_CREATE | = lt_it_wbs_element_create | |
| EXCEPTIONS | ||
| PRECOMMIT_ALREADY_CALLED = 1 | ||
| INIT_MISSING = 2 | ||
| NETWORK_READ_ERROR = 3 | ||
| ONE_PROJECT_VIOLATION = 4 | ||
| BADI_ERROR = 5 | ||
| PROJECT_READ_ERROR = 6 | ||
| CANT_CREATE_DATES = 7 | ||
| . " PS_BAPI_PREPARE | ||
ABAP code using 7.40 inline data declarations to call FM PS_BAPI_PREPARE
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 NETWORK FROM BAPI_NETWORK_LIST INTO @DATA(ld_e_number). | ||||
| "SELECT single NETWORK FROM BAPI_NETWORK_LIST INTO @DATA(ld_i_number). | ||||
| "SELECT single PROJECT_DEFINITION FROM BAPI_BUS2001_NEW INTO @DATA(ld_i_project_definition_delete). | ||||
| "SELECT single PROJECT_DEFINITION FROM BAPI_BUS2001_NEW INTO @DATA(ld_e_project_name). | ||||
| "SELECT single NETWORK FROM BAPI_NETWORK_LIST INTO @DATA(ld_i_network_delete). | ||||
| "SELECT single PROJECT_DEFINITION FROM BAPI_BUS2001_NEW INTO @DATA(ld_i_project_name). | ||||
Search for further information about these or an SAP related objects