This blog is targeted to ABAP technical team working on S4 HANA conversion projects.
In my previous blog , I discussed about handling of Material Field Length Extension cases in S/4 HANA conversion scenario. You can find the blog
here
In this Blog I am going to discuss another important field length extension change introduced by SAP, which is Amount Field Length Extension (AFLE).
What is changed in Amount Field Length from ECC to S/4 HANA?

Currency Field in ECC

Currency Field in S/4 HANA
As you see above the length of amount field has been changed from 13 with decimal 2 to 23 with decimal 2 from ECC to S/4 HANA. Hence custom code using currency types nee to be adjusted as per AFLE settings maintained by customer.
How to identify if customer has adapted AFLE?
Transaction FLETS

Highlighted check box is checked for extending AFLE
What is impact on the custom code if extended Amount Field length is adapted?
Exmpale1
Lets take example of custom code where customer is not going to adapt the AFLE. Custom code written as below
TYPES : BEGIN OF ty_cr_db_amt
,
debits
TYPE dmbtr
,
credit
TYPE dmbtr
,
END OF ty_cr_db_amt
.
WRITE: /2
'Debit Amount:',
20 lst_all_acct_total
-debits
DECIMALS 2, '|',
/2
'Credit Amount',
19 lst_all_acct_total
-credit
DECIMALS 2 NO-SIGN.
Here data type DMBTR is used . As you know length of DMBTR has been changed from
Length 13 Dec 2 To
Length 23 Dec 2. When code is migrated to S/4 HANA the WRITE statement will behave differently than it was working on ECC.
Output of the code on ECC system

Output of the code on S/4 HANA

As you see here alignment of the text has been changed on S/4 HANA system. Hence custom code needs to be adjusted for such cases as below
TYPES : BEGIN OF ty_cr_db_amt
,
debits
TYPE dmbtr_cs
,
credit
TYPE dmbtr_cs
,
END OF ty_cr_db_amt
.
WRITE: /2
'Debit Amount:',
20 lst_all_acct_total
-debits
DECIMALS 2, '|',
/2
'Credit Amount',
19 lst_all_acct_total
-credit
DECIMALS 2 NO-SIGN.
Example 2
Arithmetic operation
Lets take example where where customer is going to adapt the AFLE. Custom code written as below
DATA: amount
TYPE wrbtr
,
rate
TYPE wrbtr
,
total
TYPE char11
.
CATCH SYSTEM-EXCEPTIONS arithmetic_errors
= 4.
total
= ( amount * rate
) *
100.
ENDCATCH
.
As you see here length of
total field has length char11 . Increased length of values in amount might cause the frequent arithmetic exceptions. Hence data type of total field needs to be changed to wrbtr.
DATA: amount
TYPE wrbtr,
rate
TYPE wrbtr,
total
TYPE wrbtr.
CATCH SYSTEM-EXCEPTIONS arithmetic_errors
= 4.
total
= ( amount * rate
) *
100.
ENDCATCH
.
Looking at above to cases, it is recommended that before applying the code corrections impact of the change needs to be analyzed first. Here are the steps to analyze the impact.
Steps to Analyze the Amount Field Length Extension impact on custom code?
1.
Update Simplification database with latest information.
This most important step before running the custom code impact analysis. Refer the note
2241080
After updating the database, Go to Transaction SYCM and verify if Simplification database has been updated.

Click on
Overview

2. Set up of check variant S4HANA_READINESS_<release>
SAP has provided standard check variant S4HANA_READINESS_<release> to perform the analysis on the custom code. It not only covers FLE ( Field Length Extension) scenarios but lot of other scenarios as well.
Open READINESS Check variant S4HANA_READINESS_<release>
In my case it is S4HANA_READINESS_2020. Open the check variant in Edit mode.

Click on the highlighted arrow.

On the next pop up select the highlighted check box as per the requirement.

Save the changes in the transport request. You can also create custom variant by copying the Standard check variant and then make changes in the custom check variant.
OR
If you don't want to do all above customizations and customer is not opting for extended field lengths use the standard check variant
S4HANA_READINESS_2020_NO_FLE
3. Execute
ABAP Test cockpit (ATC) check on the custom package.

You can find many cases of AFLE in ATC output where custom code needs to be adjusted. Adjust the code as per the requirement of going with extended field length or not. You can also refer the SAP 2610650 for more information .
2610650 - Amount Field Length Extension: Code Adaptations
As Material FLE and Amount FLE scenarios are similar in nature , handling method of the various ATC errors are also quite similar for both of them. You can refer my blog on handling of material FLE scenarios.
Handling of Material Field Length Extension scenarios in S4 HANA conversion
Summary
We have learned
- After converting to S/4 HANA code adaption is required where amount related Fields, domains and data elements are used.
- Customer may or may not use extended lengths of amount fields , hence based on customer decision custom code needs to be modified.
- Transaction FLETS is used for identifying the configuration of AFLE.
- Custom code impact analysis can be done using ATC transaction with check variants S4HANA_READINESS_<release> OR S4HANA_READINESS_<release>_NO_FLE
- Before modifying the code the impact analysis has to be done .
Thank you for reading through the blog. Please share your comments. You can also post your questions here in comments section or in the
Q&A section.
In the next blog I will try to come up with more custom code adaption cases from S/4 HANA conversion.