Upload Flat File in Sap Analysis for Office

Many organizations employ SAP ERP and SAP Business organization Warehouse systems for business analytics on transactional information loaded from many different types of source systems.

They also utilize apartment file (e.g. .CSV format) sources for uploading transactional data into their data warehousing systems. Typically, the loaded data is further processed, apple-pie, and consumed in upstream systems with boosted business logic.

The flat file data loads are typically automated by utilizing the procedure chain (PC) functionality. The procedure concatenation picks up the flat file from the designated AL11 directory and delivers it via InfoPackage for further upstream processing into BW layers. The BW PC processes i flat file at a fourth dimension; however, during the financial close process or any other fourth dimension-sensitive cycle, there could be multiple flat files containing transactional information from different business units or segments that need to be processed at regular and frequent intervals. This is easily achieved past scheduling procedure chains at the pre-defined frequency, eastward.thousand. every xxx minutes.

This works just fine as long as the flat file is nowadays and ready to be processed in the designated AL11 directory. When they are not bachelor for processing, the InfoPackage fails if not handled with an appropriate solution. This creates a failed empty asking in the persistent staging surface area (PSA) layer. This situation could potentially create hundreds of failed process chain instances and failed requests in the PSA layer during a typical fiscal flow.

This post will explore a artistic solution to address this challenge past utilizing a combination of existing SAP BW toolsets forth with a bit of customization.

The Challenge

The main claiming is to explore and identify a solution that meets the post-obit criteria:

  1. Successful execution of the process chain when apartment files are not available in the designated AL11 directory. This essentially requires an intelligence built into the BW InfoPackage to identify that non-availability of flat files is a valid business concern scenario.
  2. Purge erroneous PSA requests created considering of the non-availability of flat files.

Solution

SAP provides a rich framework of toolsets inside the SAP BW arrangement that can be deployed to build a robust solution for a seamless user experience. The toolset includes procedure chains, function modules, tables (both standard and custom), and InfoPackages that incorporate an ABAP exit routine (shown below). This routine is executed while loading flat files to the PSA layer. Information technology tin can also access BW objects which can be used for functional validations and temporary storage of flags or variable values.

SAP BW InfoPackage exit routine Assumptions

Before getting started, there are a few assumptions that we worked with:

  • The dummy file (more than on this later) must have the same construction equally the actual transactional data file. The file contains but the header record and no transactional information.
  • The dummy flat file name and initial status is correctly configured in the control table.
  • This workaround has been developed and deployed on an SAP BW organisation with the below specifications.

Jadhav Table 1

Annotation: While this solution was developed on an SAP BW system, it is applicable to SAP BW/4HANA systems as well with some modification. For case, the PSA layer is not available in SAP BW/4HANA.

Workaround Steps

Follow these steps to create the workaround.

  1. Create a dummy flat file (due east.g. "DUMMY_FILE.csv") with just a header in it and no transactional information. The structure of the header should be the same every bit the real apartment file construction. Identify the dummy apartment file at the designated location in the AL11 directory on the SAP BW server.
  2. Create a custom table or use any existing table to store the proper noun of the dummy file with some flag representing 'Aye' or 'NO'.

Custom table to store dummy file name

  1. Create an InfoPackage with a information validation routine to process flat file data.
    1. This routine is used to go the list of apartment file names existence processed from the designated AL11 directory location (see effigy below) and sort them in chronological order (latest get-go).
    2. When but the dummy file is available to procedure, it returns only one file in the list with its name.
    3. The routine also gets the dummy flat file proper name from the table (ZTABLE_TEST in this example).
    4. If the ii file names from the previous ii points match, the custom table is updated with the flag "YES." If not, the flag is set to "NO."

Code snippet to get flat file name

  1. Create a custom class (e.g. ZCLASS_TEST) with a custom method Z_DF_GEN_STATUS. This method checks the custom table ZTABLE_TEST for the status of ("YES" or "NO") against the dummy file name.
    1. The parameter i_variant (method import parameter) could be the apartment file name or some other flat file identifying entry in the table (e.chiliad. "ABC" in this example).

Code snippet of custom flag logic

  1. Create a custom BW process chain (such equally PC ZBW_TEST shown in the figure below) with a custom determination process to bank check if the InfoPackage processed a dummy flat file or real flat file.

Process chain with custom decision step

  1. The custom decision procedure ("Is Flat File Blazon Dummy") could be configured by double clicking for multiple options (see below). The figure shows two options but it tin be configured for more than than two options if required by the business logic. The last option is ever configured as an error.

Decision steps with options

  1. Configure the formula for each option by clicking on the pencil icon. It opens up a formula editor.
  2. Configure the formula every bit shown in the two figures below for Option i and Option ii respectively for checking if the flag set up upwards in the control tabular array (ZTABLE_TEST) is set to "Yes" or "NO."
    1. The input parameter ("ABC") to the method phone call is the principal primal of the record in the control table (ZTABLE_TEST) and it could correspond process chain name or process itself.

Formula using 'ABC' for 'YES'

Formula using 'ABC' for 'NO'

Results

Hither are the results that nosotros come up with subsequently performing the configuration.

  1. The custom table ZTABLE_TEST was configured as shown below.

Dummy flat file status set to

  1. A dummy flat file named DUMMY_FILE.csv was placed in the designated AL11 directory.
  2. The process chain was executed to procedure the flat file nowadays in the AL11 directory. The process chain correctly determined that the InfoPackage has processed the dummy apartment file and also processed the highlighted branch of information menses/purged the requests from PSA (run into figure below). The solution was used in a real application where this type of process concatenation is scheduled to run every 30 minutes and all seven days a week. Each run successfully distinguishes between dummy and real apartment files and keeps the PSA clean.

Process chain execution for dummy flat file

  1. The custom table accurately reflects the status of the dummy file equally "YES."

Dummy flat file status set to ''YES

Conclusion

Organizations utilizing SAP Business Warehouse nearly frequently use flat files for uploading a multifariousness of transactional business concern data into their SAP BW systems. The flat files are processed by running a procedure chain which inherently processes 1 flat file at a fourth dimension. When at that place are no apartment files present in the AL11 directory to exist processed, the BW InfoPackage fails and creates an empty asking in PSA. A number of failures and empty requests created in PSA could soon spiral out of command.

This post presented a solution to address this challenge past utilizing InfoPackage routines in a creative mode. In this approach, the routine sets a flag in a custom table to highlight whether it candy a existent flat file or a dummy flat file. A custom determination process within the process concatenation checks this flag using a custom class and method. If indeed a dummy file was processed, the process chain ends the execution gracefully after purging erroneous PSA requests.

Cheers to Rajesh Hemnani, Snehal Mehare, and Venka Reddy Buchi for their assistance with this post.

rogersobbect.blogspot.com

Source: https://blog.sap-press.com/how-to-work-around-sap-bw-flat-file-data-load-infopackage-failures

0 Response to "Upload Flat File in Sap Analysis for Office"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel