Sunteți pe pagina 1din 7

1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

Welcome to the new version of SAP Community Wiki: Learn What's New? and what has changed.
Dashboard / … / Demand Management PP-MP-DEM

[TEST CASE] PIR Maintenance via BAPI


Created by Nancy Guo, last modified on Jan 05, 2016

Purpose
The purpose of this page is to explain how to maintain PIR by BAPI by test cases.

Overview
Via these BAPIs, one can generate PIRs out of external data and use them this way within the SAP-System. The BAPIs
are a shell around the function module REQUIREMENTS_MAINTAIN. There are four function modules, where just the
first three can be edited within the transaction BAPI.
1. BAPI_REQUIREMENTS_CREATE: create planned independent requirement
2. BAPI_REQUIREMENTS_CHANGE: change planned independent requirement
3. BAPI_REQUIREMENTS_GETDETAIL: display details about planned independent requirement
4. BAPI_REQUIREMENTS_SIMULATE: test by simulation, if change/create PIR would be possible

<BAPI_REQUIREMENTS_CREATE>

Import parameters:
REQUIREMENTS_ITEM:
You use this parameter to define the item for which the planned independent requirements are created.
For more information on the individual parameter fields, see the data element documentation in the ABAP Dictionary.
The following fields are required:
MATERIAL
PLANT
VERSION
If you wish to create independent requirements for a requirements plan, specify the requirements plan in the
REQ_NUMBER field.
You use the REQU_TYPE field to define the requirements type. Note the following:
If the field is blank, the requirements type is derived from the planning strategy in the material master.
If an invalid requirements type is transferred, the system issues an error message depending on the Customizing setting
(transaction OMPJ).
If no requirements type can be determined, the system issues an error message.
This occurs if the requirements type is not transferred or derived from the planning strategy in the material master.
The MRP_AREA field should only be filled if the MRP areas are active. In this case, you can create planned independent
requirements for an MRP area. Note the following:
The MRP area must be assigned to the material (field MATERIAL) in its material master.
The planned independent requirements are created automatically for the plant MRP area when MRP areas are blank.
REQUIREMENT_PARAM:
As a rule, this parameter is not evaluated and should not be used.
DO_COMMIT:
You use this parameter to define whether the command COMMIT WORK is entered within the method.
Value range
X: A COMMIT WORK is entered

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 1/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

Initial: No COMMIT WORK is entered


HINT: You can set this parameter as blank, but call the BAPI BAPI_TRANSACTION_COMMIT afterwards.
UPDATE_MODE:
You use this parameter to determine whether the BAPI is executed in the simulation mode.
Value range
X: The planned independent requirements that have been created are posted
Initial: No database changes are carried out (Simulation)
REFER_TYPE:
For information on the reference type, see the documentation of this parameter in SE37.
PROFILID:
You use this parameter to define the planning profile for which configuration data should be created.
Multiple planning profiles can be created for one material.
If the parameter contains the initial value, the system selects the planning profile for which the update of the Sales
Information System is activated.

Tables:
REQUIREMENTS_SCHEDULE_IN:
You use this parameter to define schedule lines that are to be created.
For more information on the individual parameter fields, see the data element documentation in the ABAP Dictionary.
The following fields are required:
DATE_TYPE
REQ_DATE
REQ_QTY
Value range
You can use the following values for the period indicator DATE_TYPE:
1: Day
2: Week
3: Month
4: Posting period (if defined in material master)
5: Planning calendar (if defined in material master)

REQUIREMENTS_CHAR_IN:
This parameter is used to create configuration supporting points for planned independent requirements. See the detailed
documentation of this parameter in SE37.
RETURN:
This parameter contains messages about errors that have occurred.

Example to execute the BAPI:

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 2/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

Result:

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 3/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

<BAPI_REQUIREMENTS_CHANGE>

Import parameters:
DELETE_OLD:
You use this parameter to determine whether exising schedule lines are deleted.
Value range
X: All existing schedule lines are deleted and the transferred schedule lines are entered.
Initial: Existing schedule lines are not deleted.
Newly transferred schedule lines for existing requirement dates overwrite the existing schedule lines.
Default
X: All existing schedule lines are deleted and the transferred schedule lines are entered.
NO_WITHDR
You can use this parameter to define whether the transferred planned quantity is reduced by the withdrawal quantity of
the same period.
Value range
X: The schedule lines are created with the transferred planned quantity.
Initial: The transferred planned quantities are reduced by the existing withdrawal quantity.
Default
Initial: The transferred planned quantities are reduced by the existing withdrawal quantity.

Example to execute the BAPI:


MD63 screen before executing the BAPI:

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 4/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

BAPI input:

Result:

MD63 after BAPI execution:

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 5/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

<BAPI_REQUIREMENTS_GETDETAIL>

Import, export and table parameters are similar to previous 2 BAPIs.

Example to execute the BAPI:

Result:

<BAPI_REQUIREMENTS_SIMULATE>

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 6/7
1/13/2020 [TEST CASE] PIR Maintenance via BAPI - ERP Manufacturing (PP) - Community Wiki

It is only for simulation purpose. The import and export parameters are similar to BAPI_REQUIREMENTS_CREATE and
BAPI_REQUIREMENTS_CHANGE

Related Content
Related Documents
Related SAP Notes/KBAs

825202 - BAPI_REQUIREMENTS_CREATE w/ configuration data (consulting)


793258 - Withdrawal qty during transfer to demand mgt (consulting)
103822 - Automatically splitting dates with zero quantities
528481 - COMMIT WORK in FUNCTION BAPI_REQUIREMENTS_CHANGE
1253634 - BAPI_REQUIREMENTS_CHANGE: Incorrect error message 6P510
1114262 - BAPI_REQUIREMENTS_CHANGE deletes too many independent reqs
115927 - BAPI_REQUIREMENTS_CREATE, BAPI_REQUIREMENTS_CHANGE: Incorrect error message in return table
2001802 - WBS element is cleared after executing BAPI_REQUIREMENTS_CHANGE

No labels

Privacy Terms of Use Legal Disclosure Copyright


Trademark Cookie Preferences

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D+PIR+Maintenance+via+BAPI 7/7

S-ar putea să vă placă și