Ansicht
Dokumentation
DMF_BADI_PURCH_ORDR - BAdI: Read Purchase Order
ABAP Short Reference ABAP Short ReferenceThis documentation is copyright by SAP AG.
This Business Add-In (BAdI) is used in the Logistics Basic Data ( LO-MD) component in the area Logistics Merchandise Lifecycle Optimization. You use this BAdI to retrieve the database entries needed for processing purchase orders.
This BAdI reads all data from the database for DRFOUT initial, change, and manual modes for purchase orders (depending on the method implemented). This BAdI must be implemented to allow output of the S4/HANA or SAP Fashion Management Solution (FMS) season fields on a purchase order. On HANA-based systems, the BAdI allows for better performance and is recommended for implementation.
This BAdI uses the following methods:
- READ_PURCH_ORDR_DATA
- Use this method to customize reading the purchase order data from the database for initial and manual modes only. This method uses the following parameters:
- Importing
- IT_PURCH_ORDR_OBJ
- Purchase Orders that are relevant for lookup.
- IT_PURCH_ORGS
- Purchase Organizations that are currently configured to run with Purchase Orders. This table is optional.
- IT_MATERIALS
- Material Numbers (MATNR) that are currently configured in manual mode to run with Purchase Orders. This table is optional.
- IT_PLANTS
- Plants (locations) that are currently configured in manual mode to run with Purchase Orders. This table is optional.
- IT_PO_DOC_NUMS
- Purchase order numbers that are currently configured in manual mode to run with Purchase Orders. This table is optional.
- IT_VENDORS
- Vendors that are currently configured in manual mode to run with Purchase Orders. This table is optional.
- IT_SUPPLYING_PLANTS
- Supplying plants (locations) that are currently configured in manual mode to run with Purchase Orders. This table is optional.
- IV_PO_START_DATE
- The start date for looking for purchase orders (as compared to EKKO-AEDAT). This is calculated based on the past period in days configuration for purchase orders.
- Changing
- CT_PURCH_ORDR
- DMF Purchase Order raw data.
- CT_PURCH_ORDR_CONF
- DMF Purchase Order Confirmation raw data.
- CT_PURCH_ORDR_GDR
- DMF Purchase Order Goods Receipts raw data.
- CTS_KEY_DISKZ
- Replenishment Relevance Indicator lookup data.
- CTS_LOC_VLFKZ
- DMF Location and Plant Category lookup data.
- READ_PURCH_ORDR_CHANGED_DATA
- Use this method to customize reading the purchase order data from the database for change mode only. This method uses the following parameters:
- Importing
- IV_LAST_EXECUTED_ON_TSTMP
- Last executed on timestamp – when DRFOUT for Purchase Orders was last run successfully for your target system.
- IT_PURCH_ORGS
- Purchase Organizations that are currently configured to run with Purchase Orders. This table is optional.
- Changing
- CT_PURCH_ORDR
- DMF Purchase Order raw data.
- CT_PURCH_ORDR_CONF
- DMF Purchase Order Confirmation raw data.
- CT_PURCH_ORDR_GDR
- DMF Purchase Order Goods Receipts raw data.
- CTS_KEY_DISKZ
- Replenishment Relevance Indicator lookup data.
- CTS_LOC_VLFKZ
- DMF Location and Plant Category lookup data.
For more information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element Definitions tab in the BAdI Builder (transaction SE18).
You can find example implementations in the BAdI Builder on the Enhancement Spot Elements Definitions tab in the Implementation Example Classes section.
The following example implementation class is available:
- CL_EX_PURCH_ORDR
The example implementation has two methods:
To customize the BAdI for initial and manual modes, implement the READ_PURCH_ORDR_DATAmethod. The example method will work for all systems.
1.,,Copy the example method to your BAdI Implementation method.
2. ,,Uncomment the entire method.
3.,,Adjust the code that matches the snippet below for season fields to be read (if needed).
4. ,,Save.
5.,,Activate.
To customize the BAdI for change mode, implement the READ_PURCH_ORDR_CHANGED_DATAmethod as follows, depending on your system:
- On HANA-based systems, the example method allows for better performance and is recommended for implementation. On S4/HANA systems, the CL_DMF_PURCH_ORDR_DB READ_CHANGED_DATAmethod has the higher performing code, and this BAdI method is only necessary to access the season fields. To customize the BAdI for HANA systems:
1. ,,Copy the example method to your BAdI Implementation method.
2. ,,Uncomment the entire method.
3. ,,Adjust the code that matches the snippet below for season fields to be read (if needed).
4. ,,Save.
5. ,,Activate.
- On non-HANA systems, the CDPOStable is a cluster table which does not allow joins and will result in a syntax error. The example method cannot be used. To customize the BAdI for non-HANA systems:
1. ,,Copy the standard code in CL_DMF_PURCH_ORDR_DB READ_CHANGED_DATAmethod (only the code in the ELSE … ENDIF portion) to your BAdI Implementation method.
2.,,Adjust the code that matches the snippet below for season fields to be read (if needed).
3.,,Save.
4.,,Activate.
- On EhP7 systems, there is no performance improvement available. The BAdI method is only necessary to access the season fields. To customize the BAdI for EhP7 systems:
1. ,,Copy the example method to your BAdI Implementation method.
2. ,,Uncomment the entire method.
3. ,,Adjust the code that matches the snippet below for season fields to be read (if needed).
4. ,,Save.
5. ,,Activate.
Season Fields
The following code snippet can be used to enable the season fields in your implementation by removing the comment character (") from the lines that start with li~fsh_:
"***********************************************************************
"* Purchase Order, items and schedule lines *
"***********************************************************************
…
"Season fields available in FMS or S4HANA only |
"Implement BAdI if season fields are needed |
"li~fsh_season as season_id, |
"li~fsh_season_year as season_yr, |
"li~fsh_collection as ext_collect_id, |
"li~fsh_theme as ext_theme_id, |
PERFORM Short Reference SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
This documentation is copyright by SAP AG.
Length: 11001 Date: 20240523 Time: 160025 sap01-206 ( 108 ms )