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 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:
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.
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.
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.
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 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:
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 |
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.
Prerequisites:
Go to Transaction : FBZP
Transaction Code | FBZP |
Click Payment method in the Country
Double click on Payment method
Posting Details Tab:
Document type for payment "ZP"
The Payment Document Will be posting in document type ZP.
Go to Transaction : GGB1
Transaction Code | GGB1 |
In this activity, you can create and maintain substitutions.
Actions
Create substitution
Maintain substitution
In Financial accounting, we have 5 Part
The reference field is in the header part, we need to create a substitution in the header part.
Now create a step Inside the substitution.
Select BKPF-XBLNR in Steps.
Here you can define the prerequisite based upon your requirements.
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
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.
Down below in code, we define our code based on our logic as follows:
*&---------------------------------------------------------------------*
*& 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.
Assign Z300 in substitution step.
In our last step, we have to activate this Substitution.
Transaction Code | OBBH |
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.
3. Uncheck the “Exclude” checkbox for the requisite field.
4. Run the program RGUGBR00 via SE38 and click execute.
5. The field will get added to the Substitution Rules.
Open the vendor invoice which you want to make payment and review it.
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
Start fiori app “Manage Automatic Payments” and Click Create Parameter.
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:
In the Parameters Tab, We have to define the following and Click Save
You can see the payment parameter created :
Create Payment Proposal:
Selected the Parameter and click schedule Proposal:
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.
You can see the payment proposal in the respective tab.
A payment proposal is generated based on the parameters.
Review Payment Proposal:
Payment Run:
Go to Proposal and click on Schedule Payment to run Payment.
Check “Start Immediately” to start the payment run instantly and then click on Schedule.
Go to “Payments Processed” and You can see the payment posted.
We can check the status of the Payment run on the Status Tab.
You can also select the posted payment to see the log:
Invoice Document Text: F110 Substitution Test
Payment Document Text : F110 Substitutio
Since the length of BKPF-XBLNR is 16, It allows only 16 characters.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.