Ansicht
Dokumentation

FINOC_RULE_ORD_ENH - Identify Orders and Assign New Profit Center

FINOC_RULE_ORD_ENH - Identify Orders and Assign New Profit Center

General Data in Customer Master   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) FINOC_RULE_ORD_ENH is used to customize rules to process orders.

You can use this BAdI to implement your own logic to identify orders, such as production orders or internal orders for an organizational change, and to assign a new profit center to these orders. Sales orders and purchase orders aren't considered in this BAdI.

The BAdI is called for orders assigned to a product. It’s called when new orders are created, updated, or when an organizational change is activated.

The following parameters are transferred to the default implementation class CL_FINOC_RULE_ORD_ENH of the BAdI FINOC_RULE_ORD_ENH and can be changed:

  • CV_CDS_VIEW is passed to the CHANGE_CDS_NAME method:
This method passes the name of the customized CDS view, which contains the order data with additional fields that aren't included in the standard CDS view FINOC_RULE_ORD_DEFAULT. These fields might be required in method CHANGE_CDS_RESULT when your company-specific rules are applied.
  • CT_CDS_RESULT is passed to the CHANGE_CDS_RESULT method:
This method passes the table of data selected from the CDS view name, which is passed to the CV_CDS_VIEW parameter.

In the standard CDS view, the profit centers for products and their assigned orders must be the same. The standard CDS view FINOC_RULE_ORD_DEFAULT derives the profit center of a product, to which the order is assigned. If the derived profit center and the profit center for the order are identical, the CDS view FINOC_RULE_ORD_DEFAULT considers the same profit center valid for the assigned order.

By default, the standard CDS view name is passed to the corresponding method (CHANGE_CDS_NAME). So, if no additional logic is needed, no action is required.

However, it's also possible to use this BAdI to implement new logic for all assigned orders. You can create a customized CDS view, based on the standard CDS view FINOC_RULE_ORD_DEFAULTor the CDS view FINOC_RULE_ORD_BASE, where you can include additional fields and assign the new profit center. The default CDS view selects data from the base CDS view.

The name of this customized CDS view is passed to the CV_CDS_VIEW parameter in the CHANGE_CDS_NAME method. In the CHANGE_CDS_RESULT method, you can implement new logic and overwrite existing data.

Regardless of the CDS view name in the CV_CDS_VIEW parameter and whether it is the standard CDS view or a customized one, you can implement some logic in the CHANGE_CDS_RESULT method to overwrite the existing data.

Note: You can define your logic in the methods or in the CDS views. To optimize performance, define your logic in the CDS views.

You have variety of possibilities to filter records in the CDS view for orders, which shouldn't be transferred or to enrich them for further calculation.

Restrictions

  • You cannot pass an empty string or name of a non-existent CDS view to CV_CDS_VIEW parameter.
  • If you create a customized CDS view, it must contain all the fields from the standard CDS view with identical names and data types. You can add additional fields.
  • The changed data in CT_CDS_RESULT method is examined with consistency checks.

Example 1

It is also important to set the profit center derivation source types and the source fields correctly. By default, the order derives its profit center from the material. In this case, the profit center derivation source type is set to MAand the source material is referenced. If the order doesn’t derive the profit center from any other object, the profit center derivation source type is set

Field Name Technical Name Product None
Profit Center Source PRCTR_DRVTN_SOURCE MA blank
Source Material SRCE_MATNR set blank
Source Plant SRCE_WERKS set blank

Example 2

Class CL_FINOC_RULE_ORD_ENH_EXAMPLE is an example implementation.

In this example, the name of the customized CDS view FINOC_RULE_ORD_EXAMPLE is passed to the CV_CDS_VIEW parameter in the CHANGE_CDS_NAME method.

This customized CDS view is the result of joining the standard CDS view FINOC_RULE_ORD_DEFAULT with table AUFK. It has one additional column (AUART) in comparison to the standard CDS view and this column is used in a customized logic to derive profit centers for orders, which are assigned to products. The content of the CDS view FINOC_RULE_ORD_EXAMPLE in the CT_CDS_RESULT parameter is overwritten in the CHANGE_CDS_RESULT method.

The profit center for orders is updated to A-0420-000 or A-0421-000 whenever the order type (AUART) is ZI20 or ZI21 respectively.






General Data in Customer Master   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 5857 Date: 20240523 Time: 204014     sap01-206 ( 93 ms )