Troubleshooting tips
App
Upload General Journal Entries app let user upload Journal Entries using Excel template. Download Template option in app generates excel file with header, items and COPA fields. The user then uses this template to upload Journal Entries.
Uploading Additional Fields
The template is generated with a certain number of fields in header and item level. Depending on S4HANA version, the template will also have COPA level fields in it. However, there are many more fields available at header, item and COPA level which user can specify in the template by manually changing it.
These additional available fields are described here in SAP Documentation.
Simply add any of missing fields, using technical name, which is not in template. Note COPA/Profitability fields has prefix PROF_ and goes at line item level.
Fields not getting Updated/Uploaded
Tip 1
Following upload, the program checks values against SAP data. For example, if we are specifying a value for sales order then it will be checked against VBAK. If values are not valid then it might not be loaded.
Tip 2
Each GL account has something called Field Status Group assigned to it which decides if some of the fields are suppressed. I was not able to upload Plant (WERKS) value for GL account 61100000 using the template.
Looking at GL account setting in FS00 transaction it turned out that Plant along with some others fields are suppressed.
Function module FI_FIELD_SELECTION_DETERMINE is called to check the FSG setting. The program then clears out the uploaded field value based on FSG setting.
Tip 3
Some of the fields are not allowed at the COPA level. For example, company code, controlling area, production order, sales order. These fields are determined from header/items fields, so use fields on these level to specify these “NOT_ALLOWEED_COPA_FIELDS”.
Logic for this is in class method CL_FAC_FINANCIALS_POST_DPC_EXT=>ACCDOC_CRT_FRM_FILE.
Adding Fields to Download Template
If the customer/user is not happy about specifying additional manually in the template and want those fields to be part of Downloaded Template from App then this will need enhancement.
When user press Download Template button they are presented with dialog box to choose file type.
In class CL_FAC_JE_TEMPLATE_UTILS=>GENERATE_TEMPLATE based on user selection file is generated.
List of fields which appears in excel is determined in CL_FAC_JE_TEMPLATE_UTILS=>GET_TRANS_MAPPING. Depending on version code determines (2) header field, (3) item fields and (4) copa fields.
For header field system works out all available fields using GET_FULL_FIELDS_MAPPING, then it works out fields that needs to be excluded using GET_HEADER_EXCEPTED_FIELDS. Using these two sets method ASSEMBLE_FIELDS_MAPPING creates ET_FIELDS_HEADER_MAPPING.
Simillarly, for item fields, system work out all available fields using GET_FULL_FIELDS_MAPPING. It then works out fields which needs to be excluded using GET_LINEITEMS_EXCEPTED_FIELDS. Using these two sets method ASSEMBLE_FIELDS_MAPPING creates ET_FIELDS_LINEITEMS_MAPPING.
In S4 2020 logic for COPA items are added. Logic here is slightly diffenrent. Instead of excluded fields system work out fields that needs to be added using method GET_COPA_EXPECTED_FIELDS.
Example:
Add Fields sales order, sales order line and plant in line item in template. Add COPA field Material and Customer at line item level. Below example is from S4 1809.
Post exit enhancements for method GET_LINEITEM_EXPCEPTED_FIELDS and GET_TRANS_MAPPING.
Code: Post Exit – GET_LINEITEM_EXPCEPTED_FIELDS
Removing plant, sales order and sales order item from excluded list.
Code: Post exit – GET_TRANS_MAPPING
Fixing column position for sales order, sales order line and plant column and adding COPA fields.
Note in S4 2020 approach would be slightly different.
Hi,
I am having a requirement where I need to add zfields in header level in JE fiori app.
Can you please suggest how I can do it ?
Hi Dibya
You can make use of the Custom Fields and Logic App to add the Zfields.
Thanks,
Anil
Wonderful, blog post. Keep up the good work mate.
Hi Dibya
i have also have same requirement.
need to add custom fields in journal entry fiori app.
and not able to add using CFL.
Any update on your code or how u r doing, please help.