Financial Management Blog Posts by Members
Dive into a treasure trove of SAP financial management wisdom shared by a vibrant community of bloggers. Submit a blog post of your own to share knowledge.
cancel
Showing results for 
Search instead for 
Did you mean: 
GOWRESHANHARAN
Explorer
5,871

Introduction:

This blog will guide you to updating the reference field of the payment document, even if a single payment is not activated and multiple invoices have a single payment document. Using Substitution we can update the reference fields.

Substitution:

Substitution rules are stored in the Rule Manager. When data is entered in the system, it is substituted by the Integration Manager. Substitution occurs before the data is added to the FI-SL summary tables.

In FI-SL substitution, the values entered into the SAP system are validated against a prerequisite defined by the user. When the prerequisite is met, the system replaces the values entered with substitute values, and the substitute values are transferred into the FI-SL application component.

A substitution process can contain up to 999 steps. Before posting, therefore, you can substitute the values using any number of Boolean statements.

A substitution step contains the following statements:

Prerequisite statement

The prerequisite statement establishes which conditions must be fulfilled before the substitution can be performed. If the prerequisite statement is false, the transaction is continued without substitution. If the prerequisite statement is true, the transaction is continued with the substituted values.

Substitution value(s)

The substitution value is a numerical value or a string of letters that replace the value entered. A single substitution process can replace more than one value.

Substitution exit

You can specify that substitution is to be performed through a substitution exit. The substitution exit number directs the system to an ABAP program defined by the user. Substitution exits enable you to define more complex substitutions and replace more than one value in a substitution. For more information, see User Exits in Validations/Substitutions/Rules .

When you define substitutions, you use the same syntax that you use with validations. The prerequisite statement used in a substitution can consist of a simple statement or a complex combination of statements composed of logical statements, rules, and sets.

1.png

Application Areas:

The application area specifies the general application area where the validation, substitution, or rule occurs (for example, GL for FI-SL postings).

Application Areas Used in Validations/Substitutions/Rules

Application area

Validations

Substitutions

Rules

AM Asset Management

X

X

X

CO Controlling

X

X

X

CS Consolidation

X

 

X

FI Financial Accounting

X

X

X

GL Special Purpose Ledger

X

X

X

GR Report Writer

  

X

GS Ledger Selection

  

X

GU Rollups

  

X

KC Enterprise Controlling: SAP -EIS

X

X

X

LC Legal Consolidation

X

 

X

PC Profit Center Accounting

 

X

X

PS Project System

X

X

X

User Exits in Validations/Substitutions/Rules

User exits are user-defined FORM routines that are used to calculate and/or replace values within a validation, substitution, or rule.

User exits have the following format:

  1. U(for a user-defined user exit) 
  2. S(for a standard user exit)

You can configure the form pool name of the user exits and must store it in the table for client-dependent user exits (T80D) in Customizing . Table T80D contains the form pool names for the user exits used in validations, substitutions, and rules. Each validation/substitution form pool is client-dependent. 

The following table shows the types of user exits that can be used in validations, substitutions, and rules.

 

User exit type

Description

Application

Example

1

No parameters are defined for the user exit.

Rules, validations, and substitutions (prerequisite)

See form pool RGGBR000, parameter type C_EXIT_PARAM_NONE

2

Same as user exit type 1, except one parameter (the field to be substituted) is defined in the user exit. For example, you can create a substitution routine that analyzes the cost center irrespective of the field used.

Substitution

See form pool RGGBS000, parameter type C_EXIT_PARAM_FIELD

3

All data is passed as one parameter; this exit type can only be used in matrix validations and substitutions.

Rules, validations, and substitutions (prerequisite)

See form pool RGGBR000, parameter type C_EXIT_PARAM_CLASS

Formula Builder:

In the Formula Builder, all elements that you can enter in a logical statement (for example, operators, operands, sets, constant values, and so on) are displayed as push buttons. You enter a logical statement by choosing the elements that you want to include in the statement. 

You can work in the Formula Builder using three different settings:

  • The default setting when you call up the Formula Builder is Short descriptions . All operands (such as table fields, sets, exits, and so on) are displayed using their respective descriptions.

  • If you want to enter statements using the technical names of the operands rather than the descriptions, you change the setting by choosing Settings  Technical names .

  • The Expert mode setting displays the technical names of the operands and allows you to enter a statement directly. In this case, the statement field is ready for input.

Updating Invoice Text As Payment Document Reference:

Prerequisites:

Go to Transaction : FBZP

Transaction CodeFBZP

Click Payment method in the Country 

2.png

Double click on Payment method 

3.png

Posting Details Tab:

  1. Document type for payment "ZP"

4.png

The Payment Document Will be posting in document type ZP.

Configuring the FI Substitution :

Go to Transaction : GGB1

Transaction CodeGGB1

In this activity, you can create and maintain substitutions.

Actions

  1. Expand the hierarchy to the desired application area and event
  2. Select the substitution that you can to change or use as a template
  3. Proceed according the the instructions for creating and maintaining substitutions

Create substitution

  1. To create a substitution without a template, select an event and choose the Create substitution button
  2. To create a substitution using a template, choose the Copy substitution button.

Maintain substitution

  1. Create a substitution step and select a substitution step to be edited.
  2. If you want to insert a step, you have to select the field that is to be changed. Enter the prerequisite and define how the substitution is to be carried out.

In Financial accounting, we have 5 Part

  1. Document Header
  2. Line Item
  3. Completed Document
  4. Cost of Sales Accounting 
  5. Cost of Sales Accounting (New)

5.png

The reference field is in the header part, we need to create a substitution in the header part.

6.png

Now create a step Inside the substitution.

Select BKPF-XBLNR in Steps.

13.png

7.png

 Here you can define the prerequisite based upon your requirements.

  1. Document Type = 'ZP'
  2. Company Code = "XXXX'

8.png

In the Substitution step, define the Substitution based on Exits. We have to define our custom Exit in the EXIT-Formpool provided by SAP or we can copy the standard and create our own Module Pool for the same. In our case, we have copied  RGGBS000 to  ZRGGBS000.

Take a Z copy of RGGBS000

9.png

In the Module pool, define the exit name in the header in FORM GET_EXIT_TITLES.

Define user Exist Called Z300.

 

 

  exits-name = 'Z300'.
  exits-param = c_exit_param_none.
  exits-title = TEXT-z08.
  APPEND exits.

 

 

10.png

Down below in code, we define our code based on our logic as follows:

15.png

 

 

*&---------------------------------------------------------------------*
*& Form Z300
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM z300 .

  DATA: lv_date  TYPE regup-laufd,
        lv_runid TYPE regup-laufi.

  TYPES: BEGIN OF ty_regup,
           lifnr TYPE regup-lifnr,
           belnr TYPE regup-belnr,
           gjahr TYPE regup-gjahr,
           blart TYPE regup-blart,
         END OF ty_regup.

  DATA: lt_regup_final TYPE TABLE OF ty_regup.

  REFRESH: lt_regup_final.

  IF bkpf IS NOT INITIAL AND bkpf-tcode = 'F110' AND bkpf-bukrs = '7180' AND bkpf-blart = 'ZP'.

    SPLIT bkpf-bktxt AT '-' INTO lv_date lv_runid.

    SELECT lifnr, belnr, gjahr, blart, xvorl FROM regup INTO TABLE (lt_regup)
    WHERE laufd = _date AND laufi = _runid AND zbukr = '7180'.

    LOOP AT lt_regup INTO DATA(lwa_regup).
      READ TABLE lt_regup INTO DATA(lwa_regup_temp) WITH KEY belnr = lwa_regup-belnr xvorl = ''.
      IF sy-subrc NE 0.
        APPEND lwa_regup to lt_regup_final.
        CLEAR: lwa_regup, lwa_regup_temp.
      ENDIF.
    ENDLOOP.

    IF lt_regup_final IS NOT INITIAL.

      SELECT belnr, lifnr, sgtxt FROM bseg FOR ALL ENTRIES
      IN _regup_final
      WHERE bukrs = '7180' AND belnr = _regup_final-belnr AND lifnr = _regup_final-lifnr
      AND gjahr = _regup_final-gjahr AND koart = 'K'
      INTO TABLE (lt_bseg).

      SORT lt_bseg ASCENDING BY lifnr.

      IF lt_bseg IS NOT INITIAL.
        READ TABLE lt_bseg INTO DATA(lwa_bseg_1) INDEX 1.
        IF sy-subrc = 0.
          bkpf-xblnr = lwa_bseg_1-sgtxt.
        ENDIF.
      ENDIF.


    ENDIF.

  ENDIF.
ENDFORM.

 

 

Assign the same in view V_T80D with Application Area as GBLS (Val/sub:Exits for substitution) and Ex.prog. as ZRGGBS000.

12.png

11.png

Assign Z300 in substitution step.

14.png

In our last step, we have to activate this Substitution.

Transaction Code OBBH

16.png

There are times when we need to use the substitutions for particular fields but they are unavailable in Tcode GGB1. This requires a small effort to include the requisite field for Substitution.

1. Check if the field that needs to be substituted is already present in Tcode GGB1 or not.

2. If it is not present, go to SM30 -> table VWTYGB01. Click Maintain.

33.png

3. Uncheck the “Exclude” checkbox for the requisite field.

34.png

4. Run the program RGUGBR00 via SE38 and click execute.

35.png

5. The field will get added to the Substitution Rules.

Testing Scenarios: 

Review the Invoice:

Open the vendor invoice which you want to make payment and review it.

17.png

Text : F110 Substitution Test

Manage Automatic Payments:

Payment run process is an accounts payable process that is used to handle payments to vendors. The process is called automatic payment program.

With the transactional app Manage Automatic Payments, you can schedule payment proposals or schedule payments directly and get an overview of the proposal or payment status. The app identifies the overdue invoices and checks whether all the required payment information is complete.

The Payment Process includes the Following Steps

    • Invoices are Entered
    • Pending Invoices are analysed for due date
    • Invoices due for payment are prepared for review
    • Payments are approved or modified
    • Invoices are paid

Start fiori app “Manage Automatic Payments” and Click Create Parameter.

 

18.png

 


On the first screen, you need to enter run date and identification. In the identification field, give a five-characters alphanumeric code that will be used to identify the payment program. A combination of the run date and identification is used to identify the program in SAP system.

Fill the Run date and identification and click Create:

19.pngIn the Parameters Tab, We have to define the following and Click Save

    • What is to be paid – Docs. Entered Up to
    • What payment methods will be used – Payment Methods
    • When will the payments be made – Posting Date?
    • Which company codes will be considered – Company Codes?
    • How are they going to be paid – The payment Method Sequence decides the Priority of the Payment Method
    • Enable Additional log – To get some additional log information.

20.png

You can see the payment parameter created :

21.png

Create Payment Proposal:

Selected the Parameter and click schedule Proposal:

22.png

When you click on Proposal the system is going to ask whether you want to create it immediately or want to schedule it for a time in the future. For this demo, we are going to run it immediately. You should tick the checkbox for creation of payment medium.

Make sure you select “Start Immediately” and then click on Schedule.

23.pngYou can see the payment proposal in the respective tab.

A payment proposal is generated based on the parameters.

24.png
Review Payment Proposal:

    • Click on the arrow button to review the document selected in this run.
    • The system will list all the vendors that have been included in the payment proposal.
    • We can view the Proposal Log for possible errors by Pressing the Proposal Log Button.
    • We can edit the proposal to block the some payments if we want, Press the Edit Proposal Button.

 

25.pngPayment Run:

Go to Proposal and click on Schedule Payment to run Payment.

26.png
Check “Start Immediately” to start the payment run instantly and then click on Schedule.

23.png

Go to “Payments Processed” and You can see the payment posted.

We can check the status of the Payment run on the Status Tab.

27.png

You can also select the posted payment to see the log:

28.png

Review The Post Payment Document:

29.png

Invoice Document Text: F110 Substitution Test

Payment Document Text : F110 Substitutio

30.png

Since the length of BKPF-XBLNR is 16, It allows only 16 characters.

31.png

Transport of Substitutions:

You transport substitutions manually into the productive system using the function "Substitution" -> "Transport".

You can also transport substitutions using a specific Customizing transaction. For more information, see the "Transport Substitutions" activity.

32.png

Updating Reference Fields for single Payment:

When you clear items using the payment program, the system does not transfer the reference document number to the payment document, even though the reference document number in the items to be cleared is unique to each payment document. The requirement is not programmed, since the reference document number is generally not unique to each payment document.

Implement the attached program corrections.

A reference document number unique in all cleared items is transferred to the payment document.

SAP Note Reference : https://me.sap.com/notes/213551 

Hope this helps you in applying Substitution successfully in SAP.

1 Comment