Ansicht
Dokumentation

FINOC_RULE_SOI_ENH - Identify Sales Orders and Assign New Profit Center

FINOC_RULE_SOI_ENH - Identify Sales Orders and Assign New Profit Center

Fill RESBD Structure from EBP Component Structure   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) FINOC_RULE_SOI_ENH is used to customize rules to process sales order items.

You can use this BAdI to implement your own logic to identify sales order items for an organizational change and to assign a new profit center. The BAdI is called for sales order items assigned to a product. However, the BAdI isn't called if a sales order item is assigned to a controlling (CO) object, such as a billing item or a WBS element. It’s called when new sales order items are created, updated, or when an organizational change is activated.

The following parameters are transferred to the default implementation class CL_FINOC_RULE_SOI_ENH of the BAdI FINOC_RULE_SOI_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 sales order item data with additional fields that aren't included in the standard CDS view FINOC_RULE_SOI_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 sales order items must be the same. The standard CDS view FINOC_RULE_SOI_DEFAULT derives the profit center of a product, to which the sales order item is assigned. If the derived profit center and the profit center for the sales order item are identical, the CDS view FINOC_RULE_SOI_DEFAULT considers the same profit center valid for the assigned sales order item.

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 sales order items. You can create a customized CDS view, based on the standard CDS view FINOC_RULE_SOI_DEFAULT or based on the CDS view FINOC_RULE_SOI_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 sales order items, 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 sales document item derives its profit center from the material. In this case, the profit center derivation source type is set to MA and the source material is referenced. If the sales order item doesn’t derive the profit center from any other object, the profit center derivation source type is set

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

Example 2

Class CL_FINOC_RULE_SOI_ENH_EXAMPLE is an example implementation.

In this example, the name of the customized CDS view FINOC_RULE_SOI_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 CDS view FINOC_RULE_SOI_BASE with table MARA. It has one additional column (MTART) in comparison to the standard CDS view and this column is used in a customized logic to derive profit centers of sales order items, which are assigned to products. The content of the CDS view FINOC_RULE_SOI_EXAMPLE in the CT_CDS_RESULT parameter is overwritten in the CHANGE_CDS_RESULT method.

The profit center for sales order items is updated to 9090 whenever the Plant is 1010 (Walldorf) and MTART(material type) is FERT(finished product).






Fill RESBD Structure from EBP Component Structure   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 6494 Date: 20240523 Time: 220638     sap01-206 ( 110 ms )