Ansicht
Dokumentation

CPF_BF0_FORM - Define Formulas for Flexible Billing Document Posting

CPF_BF0_FORM - Define Formulas for Flexible Billing Document Posting

Addresses (Business Address Services)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Create and maintain the rules used by the CPF implementation of flexible billing document posting to determine the following:

  • Baseline document date and document reference
  • Accounting document type (that is, journal entry type)
  • Negative posting indicator
  • Blocking of automatic posting of billing documents to financial accounting

In this configuration step, you can implement flexible billing document posting through the Configurable Parameters and Formulas (CPF) framework. You simply create one or more formulas that facilitate flexible billing document posting by evaluating parameters according to rules you specify in a decision table. In this context, a CPF formula consists of the combination of relevant parameters and a decision table.

You create and maintain your formulas by moving through the dialog structure from top to bottom. The following is a description of each step.

1.,,Define Formulas

In this first step, you create a formula by providing a unique formula identifier (ID) and a corresponding description, then saving. Each formula can contain three decision tables (one decision table for each task). To continue after creating at least one formula, select the formula and double-click the next node in the dialog structure. Note that on each screen, you can only delete entries if no settings exist on a lower structure level that are dependent on that entry.

2.,,Assign Formula Parameters

In this step you select the input parameters that you want the formula to be able to evaluate using the decision table that you specify in the final step. The result parameters BASEDOCASSGNRESULT, DOCUMENTTYPERESULT, NEGPOSTINGRESULT, and POSTINGBLOCKRESULTare included by default.

  • BASEDOCASSGNRESULTrepresents the result of the usage task SET_BASEDOC_ASSGNMTfor determining the baseline document date and document reference. This includes both the Base Document Indicator (sub parameter BASEDOCASGNMTIND) and the Base Date Value indicator (sub parameter BASELINEDATEIND).
  • DOCUMENTTYPERESULTrepresents the result of the usage task SET_DOCUMENT_TYPEfor determining the journal entry type.
  • NEGPOSTINGRESULTrepresents the result of the usage task SET_NEG_POSTINGfor determining the negative posting indicator.
  • POSTINGBLOCKRESULTrepresents the result of the usage task BLOCK_AUTO_POSTINGfor determining whether to block the automatic posting of billing documents to financial accounting.

To view and add additional input parameters from the parameter catalog, create new entries and select the input help. (You can add custom fields to the parameter catalog in the previous configuration step Define Parameter Catalog Entries for Flexible Billing Document Posting.) Save your changes after adding the parameters of your choice.

3.,,Formula Tasks

The formula configurations for different usage tasks are maintained as follows:

  • For configuring the formula for the baseline document date and document reference, choose the usage task SET_BASEDOC_ASSGNMT.
  • For configuring the formula for the accounting document type (that is, the journal entry type), choose the usage task SET_DOCUMENT_TYPE.
  • For configuring the formula for the negative posting indicator, choose the usage task SET_NEG_POSTING.
  • For configuring the formula for the blocking of automatic posting of billing documents, choose the usage task BLOCK_AUTO_POSTING.

4.,,Assign Parameter Priority

Assign each parameter that you want to use in the decision table to a priority level. A value of 1 is the highest priority, a value of 2 is the second highest, and so on. The parameter priorities determine the order of the decision table columns, which in turn dictates the priority that the system assigns to them when it evaluates the rules in the decision table.

Note: Parameter PRECEDINGBILLINGTYPEmust be used only with SET_DOCUMENT_TYPEusage task. The system will throw a warning, if PRECEDINGBILLINGTYPE parameter is included in the parameter list for usage tasks SET_BASEDOC_ASSGNMT/ SET_NEG_POSTING.

5.,,Define Decision Table

In the final step, you create your decision table by creating one row per rule that you want the system to evaluate based on the parameter values. Through the parameters, the system compares the header fields of the billing document that is being created to the values you have maintained in the decision table. For each parameter, you can specify an operator as follows:

  • Operator = (Equal to): If this operator is set, the system considers the corresponding parameter as a hit if the parameter value provided by the billing document field is equal to the value you have specified in the corresponding column of the decision table. If every parameter in a row provides a hit, the rule represented by the row is applied and resulting parameters are assigned according to how they are specified in that row.

  • „No Operator (Do not consider): If the operator cell is left empty (‘blank/space’), the corresponding parameter is ignored during the evaluation of that row, that is, the parameter cell is treated as a wildcard. This setting is useful when you want to treat a parameter for which ‘blank/space’ is a valid value as a wildcard.

Note: Parameter PRECEDINGBILLINGTYPEis relevant only for SET_DOCUMENT_TYPEusage task. The system will throw an error, if value for PRECEDINGBILLINGTYPEparameter is maintained for usage tasks SET_BASEDOC_ASSGNMT/ SET_NEG_POSTING.

After you have entered the rows representing the rules that you want to evaluate, the system automatically orders them based on the priority that you have assigned to each parameter in the previous step. To achieve the final order, the system sorts the rows as follows:

  1. First, the rows are sorted according to the parameter with the highest priority (that is, the parameter in the left-most column). Rows in which a specific value (as opposed to a wildcard) is filled for this parameter rise to the top.
  2. After this initial sort, the same principle is applied for the parameter with the second highest priority (second column from the left) to establish the relative order of the rows within the overarching order established by the previous sort.
  3. This process is repeated for each subsequent parameter to establish the final order of the rows, which ultimately dictates the sequence in which the system processes the rules that you have specified.

The system then sequentially processes the rules by comparing the supplied input parameters against the conditions defined in the rules, starting with the first row, and ending with the first hit. If there is no hit, processing ends at the last row without any rule being applied.

All cells are evaluated by checking the column value against the corresponding parameter value. For each cell, a Boolean result is returned. If all cells in a row are evaluated as true, the evaluation stops, and the system returns the result parameter for the usage task in context as specified for the current row. Otherwise, processing continues with the next table row until either a matching set of conditions is found, or the end of the table is reached.

For example, while configuring the usage task SET_BASEDOC_ASSGNMT, you could fill a row in a such a way that for any billing document of type G2 (using operator =) that originates from Company Code 0001 (using operator =), the system assigns Base Document and Base Date Value accordingly. The next row, however, assigns documents of billing type G2 (operator =) of any Company Code (Operator '') to no indicator set. If no rule is satisfied and the end of the table is reached, nothing will be set.

For more information about creating decision tables, search for Using Configurable Parameters and Formulas (CPF)to Implement Flexible Billing Document Postingin the relevant version of SAP S/4HANA Cloud on SAP Help Portal.

  • Use the correct combination of SAP defined parameters (BILLINGDOCUMENTTYPE, COMPANYCODE, SALESORGANIZATION, SDDOCUMENTCATEGORY, PRECEDINGBILLINGTYPE, DESTINATIONCOUNTRY).
  • If you want to use custom fields that you have added to the billing document header through extensibility as parameters in your formula, you need to enable these fields as parameters in the previous configuration step Define Parameter Catalog Entries for Flexible Billing Document Posting.

A simple example formula containing an example decision table is provided.

  1. After configuring the formula, perform the configuration step Define Custom Routines for Flexible Billing Document Postingto create a routine number. Then assign the routine number to your CPF implementation by the entering the formula ID as the enhancement ID.
  2. Perform the configuration step Assign Custom Routines to Tax Departure Countries/Regionsand enter the routine number to specify which billing document type you want to map to your CPF implementation.
  3. When a billing document is posted, the system then calls the CPF implementation. The result parameters (BASEDOCASSGNRESULT, DOCUMENTTYPERESULT, NEGPOSTINGRESULT, POSTINGBLOCKRESULT) are influenced only if the configured formula matches the context of the posting.
  4. For more information about flexible billing document posting, search for Flexible Billing Document Postingin the relevant version of SAP S/4HANA Cloud on SAP Help Portal.






CL_GUI_FRONTEND_SERVICES - Frontend Services   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 11996 Date: 20240523 Time: 181058     sap01-206 ( 219 ms )