Friday 15 December 2017

Posting FI Documents Using Flat File Interface- SAP FI-CO

Posting FI Account documents is a vital step for any Company to manage business flow. SAP provided different ways to post FI documents. One of the way is using FLAT FILE to upload and post FI documents.

Interfacing is one of the techniques used in SAP and of course in other technologies as well for uploading and then updating/Inserting data to the database. The data loaded must have some validation checks to make sure that the correct data is passed to the application , and saved to the database.

There are many interfacing techniques available with in the SAP Environment such as IDOCS, XI/PI , BDC AND LSMW.  In this blog i am explaining the process of uploading data using the flat file for financial postings.

Below are the Steps to setup flat file and Object development step.

(1) For demonstration purposes, i am taking single record for 26 fields coming into the system. Below is the screen capture of the flat file.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(2)Next step is the development of file upload program. I leveraged the file upload program and changed it based on my requirement. Below is the screen capture for creating file upload program.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(3) Run the program and see how the screen for the file upload program looks like. This one has an option to upload file from the application server or Flat file.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(4) Now let us put a break point in the program to see how the file upload program is handling the flat tile data.

(a) Initially the data is loaded from flat file into the it_data1 internal table using file upload program.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(b) Data with in the internal table from flat file.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(5) Now lets move to the next step where we are arranging data in a separate internal table it_data2 for further processing for the interface. I have used SPLIT command to arrange data into the desired fields as shown below.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(6)The data is setup in the second internal table for further processing as shown in the above screen capture.

(7) data setup for gl account, currency amount and tax in their tables are shown in the below screen capture.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

(8)Now we call BAPI BAPI_ACC_DOCUMENT_CHECK to see if there are any errors in the postings we are doing.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

as you can see the Lt_return table has no entries , indicating there are no errors in the document.

Now lets move to function module BAPI_ACC_DOCUMENT_POST to post financial entries.

SAP ABAP Tutorials and Materials, SAP ABAP Guides, SAP ABAP, SAP FI-CO, SAP ABAP Certifications

Return table indicates success message, the document is successfully posted.

No comments:

Post a Comment