Users who use SAP Business Planning and Consolidation (SAP BPC) together with Analysis for Office (AfO) have the option of uploading local CSV files to planning applications using the BPC planning function "Upload files from AO" (0RSPL_FILE_UPLOAD_AO). We have explained how this works in detail in the article "Planning function 'Upload files from AO' explained". In this article, we take a look at the BAdI BADI_RSPLFA_FILE_UPLOAD. This allows the CSV file to be customised using the ABAP programming language.
The BAdI allows access to the filter values, the file name and the values contained in the file. The following parameters are available.
Parameters |
Type |
Type Description |
I_R_MSG |
Importing |
Messages |
I_SRVNM |
Importing |
Name of the executed planning function |
I_INFOPROV |
Importing |
Name of the aggregation level |
I_T_DATA_CHARSEL |
Importing |
Contains the filter values |
I_T_DATA_NODE_SEL |
Importing |
Hierarchy Information of the filter |
I_FILENAME |
Importing |
The relative file path with the file name |
C_TH_FILE |
Changing |
The values contained in the file |
However, it must be admitted that this information is only of limited use. If the filter values are unique, i.e. only one value has been defined per InfoObject in the target ADSO, these are filled automatically from SAP BW7.5 SP23 at the latest. It is not necessary to use the BAdI for this.
The BAdI is also less suitable for the automated derivation of values, as SAP has a dedicated tool for this with the characteristic relationships. You can choose between various options. You can implement characteristic relationships using ADSOs, hierarchies, attributes or exit classes. In the first variant, the relationships between the characteristics are stored in an ADSO. The derivation is based on the defined combinations. Alternatively, an existing hierarchy can also be used. This must contain external characteristics. When deriving via attributes, existing master data is used for derivation. All these options utilise the standard SAP functions and do not require any programming.
Finally, customised implementation with customer-specific logic is also possible within the characteristic relationships. This allows maximum flexibility and can be implemented with ABAP or SQL Script. Thanks to the built-in buffer mechanism, a higher performance is achieved than with the Upload BAdI. In the case of realisation via SQL Script, you benefit from direct execution on the HANA database.
In practice, the BAdI is used to read the file name, as this can contain information about the entity to be uploaded, such as country or company, based on a defined naming convention. In this case, the BAdI could be used to read the file name, derive the entity and fill the corresponding field in the ADSO.
Unfortunately, the BAdI is not able to check and automatically correct the values contained in the file. This is because the values contained in the file are validated by the system against the master data before the BAdI is executed. If the values are incorrect, an error occurs and the BAdI is not even executed.
If you have such requirements for an upload process, our NextTables tool could provide a remedy. It is an SAP add-on that is fully integrated into the SAP landscape and requires no additional hardware. NextTables supports all ADSO types as well as normal tables. One of the core functions of NextTables is a flat file upload via an intuitive user interface. Thanks to the user-friendly operation, the upload can be carried out by users from the business department without the involvement of the IT department.
Import options in NextTables
Experience has shown that there are often problems with the content of the files during upload. For this reason, NextTables includes various checks as standard and others can be implemented on a customer-specific basis using the BAdI (Business Add-In) provided. For example, currency and measurement units can be automatically removed from the key figures. It is also possible to recognise whether a description is imported instead of the key and then replace it with the correct key. If no value with the imported description is available, a fuzzy search algorithm can also be used to search for a value with a similar description. The user is notified of the changes made and can either accept them or adjust them manually.
NextTables Import from Excel
Thanks to the integrated status display, you always have an overview of the current import process. This is particularly helpful for large files with many values.
Uploading large files to NextTables
As soon as the upload has been successfully completed, you will receive a comprehensive overview of all the steps performed and the validation results. You also have the option of activating or deactivating the master data check as required with just one click. The validation results can also be conveniently downloaded as an Excel file.
Validation results of the import
If errors occur during an import, you will immediately receive a detailed overview of all errors and warnings. This saves you the time-consuming search for errors. With smaller files in particular, you have the option of correcting the errors immediately, which speeds up the import process considerably. In contrast to Analysis for Office Upload, you do not have to cancel the import to correct the source file, but can continue with the import process seamlessly after correcting the error.
Particularly noteworthy is the option to adjust the import settings, such as decimal separators and thousands separators, directly during the upload. These settings can also be saved in the user profile and used automatically the next time.
NextTables also offers the following advantages:
If a smooth upload process is important to you and you are looking for a simple and freely configurable solution, NextTables could be a suitable alternative for you.
This blog article looks at the use of the BAdI BADI_RSPLFA_FILE_UPLOAD in SAP BW. When uploading CSV files, this enables this data to be customised using ABAP programming. However, it has been shown that the BAdI provides very little added value in many cases, as many scenarios are already covered by automated SAP functions or dedicated tools such as characteristic relationships. For specific customisations, NextTables offers an integrated solution with comprehensive validation options and user-friendly operation. With functions such as automatic error correction, customisation of import settings and variable assignment of InfoObjects, NextTables offers an efficient alternative for a smooth data upload process.
Do you have questions about planning topics, NextTables or any other topic? Simply get in touch with us - we look forward to exchanging ideas with you!