You are on page 1of 9

SAP Library 10.07.

2013

Standard Audit Files for Tax Purposes (SAF-T) for Portugal


Contract Accounts Receivable and Payable (FI-CA)

PUBLIC | CUSTOMER | INTERNAL | CONFIDENTIAL | STRICTLY CONFIDENTIAL


Document Version: 6774 July 10 2013

Portugal 6774 1
SAP Library 10.07.2013

Copyright
Copyright 2013 SAP AG. All rights reserved.

SAP Library document classification: PUBLIC

No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP AG. The information contained herein may be changed
without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors. National product specifications may vary.

These materials are provided by SAP AG and its affiliated companies (SAP Group) for
informational purposes only, without representation or warranty of any kind, and SAP Group
shall not be liable for errors or omissions with respect to the materials. The only warranties for
SAP Group products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and other countries.

Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for


additional trademark information and notices.

Portugal 6774 2
SAP Library 10.07.2013

Icons in Body Text


Icon Meaning
Caution
Example
Note
Recommendation
Syntax
Additional icons are used in SAP Library documentation to help you identify different types of
information at a glance. For more information, see Help on Help General Information
Classes and Information Classes for Business Information Warehouse on the first page of any
version of SAP Library.

Typographic Conventions
Type Style Description
Example text Words or characters quoted from the screen. These include field names, screen
titles, pushbuttons labels, menu names, menu paths, and menu options.
Cross-references to other documentation.
Example text Emphasized words or phrases in body text, graphic titles, and table titles.
EXAMPLE TEXT Technical names of system objects. These include report names, program
names, transaction codes, table names, and key concepts of a programming
language when they are surrounded by body text, for example, SELECT and
INCLUDE.
Example text Output on the screen. This includes file and directory names and their paths,
messages, names of variables and parameters, source text, and names of
installation, upgrade and database tools.
Example text Exact user entry. These are words or characters that you enter in the system
exactly as they appear in the documentation.
<Example text> Variable user entry. Angle brackets indicate that you replace these words and
characters with appropriate entries to make entries in the system.
EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER.

Portugal 6774 3
SAP Library 10.07.2013

Portugal ..................................................................................................................................
1 Standard Audit Files for Tax Purposes (SAF-T) ................. Error! Bookmark not defined.
2 Creating SAFT-PT Files with DART.5
3 Customizing for SAFT-PT File Creation with DART..7
4 SAFT-PT: XML File Creation.8

Standard Audit Files for Tax Purposes (SAF-T)

In Portugal, you are required to create a standard data export file called Standard Audit File
for Tax Purposes (SAF- T) to store all tax-relevant data in XML format and submit the file
monthly to the tax authorities.

You use the SAFT-PT: XML File Creation report in Financials (FI) to generate the SAF-T XML
for data from Contract Accounts Receivable and Payable (FI-CA). If your solution is an
integrated one, that is FI/SD and FI-CA run in the same system, you generate a consolidated
XML file that contains data from both applications. For stand-alone FI-CA solutions, you
generate XML files that considers FI-CA documents only.
For more information, see Creating SAFT-PT Files with DART [External]

The functionality to generate SAF-T files in FI-CA is currently only available for the IS
Utilities.

SAF-T Invoice Numbers

The documents reported in the SAF-T file are identified with the SAF-T Invoice Number and
this number might differ from the official document number of the document. The SAF-T
Invoice Number is made of the concatenation of a mandatory prefix (including an internal
code and a series ID), and a sequential number.

To have unique SAF-T Invoice Number for each company code and fiscal year, you have to
define different internal code and series ID combinations for a set of Number Range Object,
Subobject, Number Range Number and To fiscal year. You do this in the Customizing activity
under Contract Accounts Receivable and Payable Basic Functions Document Official
Document Numbers Define Specifications for Official Document Number in Portugal
Define ODN and SAF-T Invoice Number Structure

Prerequisites
You have made settings necessary to run the report in FI as described in Customizing for
SAFT-PT File Creation with DART [External].

You have defined rules for the selection of FI-CA source documents that are to be reported in
the XML file. You do this in Customizing for Contract Accounts Receivable and Payable under
Basic Functions Standard Audit Files Standard Audit Files for Tax Purposes (SAF-T)
Standard Audit File for Tax Purposes (SAF-T) - Portugal Define Extraction Rules of Source
Documents for SAF-T Files

Procedure
1. You run the Source Document Extraction (RFKKPTSAFT) report to extract the data of
the documents you have defined in Customizing and store it in tables that will be read

Portugal 6774 4
SAP Library 10.07.2013

during the generation of the XML file. To access this report, enter RFKKPTSAFT in
SE38 and run the transaction.

2. You generate the XML file by using the SAFT-PT: XML File Creation report in FI. To
access the SAFT-PT: XML File Creation report, on the SAP Easy Access screen,
choose Accounting Financial Accounting General Ledger Reporting Tax
Reports Portugal Standard Audit File for Tax Purposes (SAFT-PT) SAFT-PT: XML
File Creation

Make your settings in the report as described in SAFT-PT: XML File Creation
[External]. Additionally, you must make FI-CA specific settings as described bellow:

1. In the Contract Account Based Data group box, select Invoice Select FICA
Data and specify if the XML file should generated for FI-CA data only by
selecting Stand-Alone FI-CA system, or for integrated data for FI/SD and FI-
CA by selecting Integrated FI+FI-CA systems.

2. The report selects the invoices from the application or the FI-CA documents
based on their posting dates, therefore you have to specify the time range of
the posting date for selection.

3. Save the XML file to your file system and submit it to the local authorities.

In case you have extracted a large volume of data, you can use the Delete Extracted
Data (RFKKPTSAFT_DELETE_EXTRACT_DATA) report to delete the extracted data. This
report can also be used to delete the extracted data after you have generated the SAF-T
files and have submitted them to the authorities.

Creating SAFT-PT Files with DART

In Portugal, you are required to create a standard data export file called Standard Audit File
for Tax Purposes (SAFT-PT) to store all tax-relevant data in XML format and submit the file to
the tax authorities for tax auditing purposes when required.

To create the XML files, you follow the standard procedure of the Data Retention Tool (DART)
and the process described below.

Note

You must use DART, version 2.4 or higher.

The system generates a flat file containing the relevant data and stores it on the SAP
application server. You convert it to an XML file. You can download the file to your local
workstation and submit it to the tax authorities when required.

Due to the large data volume, the procedure of creating the XML file can consume a large
amount of memory, especially on 32bit platforms, and memory problems may arise during
the program execution. If the system is unable to create one standard data export file, you
must create several files first by splitting data as described in Processing of Large Data
Volume.

You need to submit the XML file to the tax authorities for tax auditing purposes, when they
request them.

Portugal 6774 5
SAP Library 10.07.2013

Prerequisites
You have made settings as described in Customizing for SAFT-PT File Creation with DART

In addition, you have implemented the necessary coding in function module


PT_USER_EXIT_DART on the SAP Easy Access screen, by choosing Tools ABAP
Workbench Development Function Builder .

Procedure
1. On the SAP Easy Access screen, choose Tools Administration Administration
Data Retention Tool.

2. On the SAP Easy Access Data Retention Tool screen, choose Configuration
Data Extracts (FTWP transaction) and make settings as follows:

1. On the Data Extraction tab page, choose the Transaction Data tab page and

Select the Finance documents (FI), Sales documents (SD), Delivery


documents (SD), and Billing documents (SD) checkboxes

Choose Select source tables automatically in the Source Tables for


Sales and Use Tax Data group box

Select the Billing document pricing conditions and checkbox in the


Additional Transaction Data group box

2. On the Data Extraction tab page, choose the Master Data tab page and
select the Enable master data segment selection checkbox in the Additional
Options group box.

3. On the Data Extraction tab page, choose the Technical Settings tab page,
enter your technical settings according to your system environment.

4. On the File Directories tab page, enter the DART directory set with a
description, select the row, and choose Choose.

Enter the directory name of the application server manually.

3. On the SAP Easy Access Data Retention Tool screen, choose Utilities Extract
Data (FTW1A transaction) and make settings as follows:

1. In the Transaction Data group box, select the items you want to extract.

2. In the Master Data group box, select the following individual master data
segments:

Master Data Segment Description

Cross-Application

TXW_PLANT Plant Master

Financial Accounting (FI)

TXW_COMPC Company Code Master

TXW_GLACC G/L Account Master

TXW_VENDOR Vendor Master

Portugal 6774 6
SAP Library 10.07.2013

TXW_LFAS Vendor Master (VAT registration numbers general section)

TXW_CUST_E1 Customer Master (Extension)

TXW_BSEC One-Time Account Data Document Segment

Materials Management (MM)

TXW_MAT Materials master

3. In the Data File group box, enter a data file name and the DART directory set
and its description.

The system enters all the other data you specified in step 2.

4. Execute the report.

The system generates a flat file and stores it on the application server. You
can search for the file with the Data Extract Browser on the SAP Easy
Access Data Retention Tool screen, by choosing Information System
Data Extract Browser (FTWF transaction).

4. Generate the XML file with the SAFT-PT: XML File Creation report.

To access the report, on the SAP Easy Access screen, choose Accounting
Financial Accounting General Ledger Reporting Tax Reports Portugal
Standard Audit File for Tax Purposes (SAFT-PT) SAFT-PT: XML File Creation .

Result
The system generates the XML file and stores it on the application server. To check both the
flat file and the XML file, on the SAP Easy Access screen, choose Tools Administration
Monitor Performance Exceptions/Users Exceptions SAP Directories (AL11
transaction).

You can download the generated XML file using the Download Files: Parameters (CG3Y
transaction) transaction or you can download the file directly from the server you indicated
while creating the file with the SAFT-PT: XML File Creation program to your local PC.

Customizing for SAFT-PT File Creation with DART

To create the XML files of Standard Audit File for Tax Purposes (SAFT-PT) correctly, make
settings as follows:

Enter all the Portuguese tax code parameters in Customizing for Financial Accounting
(New) (FI) under General Ledger Accounting (New) Periodic Processing
Report Statutory Reporting: Portugal Standard Audit File for Tax Purposes
(SAFT-PT) Enter Tax Code Data

Assign the All Data Volume value to your company code by maintaining table
TXW_C_BUKRS via transaction SM30

If you have manual invoices or real estate invoices, you additionally need to make settings as
described below in Customizing for Financial Accounting (New) (FI) under General Ledger
Accounting (New) Periodic Processing Report Statutory Reporting: Portugal Standard
Audit File for Tax Purposes (SAFT-PT)

Portugal 6774 7
SAP Library 10.07.2013

Define Material Numbers Based on G/L Accounts

You define product numbers for manual invoices and the DART tool identifies them
as sales invoices and applies this product number as a product code in the XML file
of SAFT-PT.

Assign Prefix to Material Numbers

You assign a prefix to the real estate invoice identifiers (which consist of the ID of the
contract type and flow type. The DART tool can use the prefix and the identifier as the
product code in the XML file of SAFT-PT.

Enter Material Master Data for Invoices (in special cases)

You define the product master data of manual invoices based on the document line
item of G/L accounts. The DART tool extracts the data and inserts them as the
product master data of a record in the XML file of SAFT-PT.

SAFT-PT: XML File Creation

You use this report to create an XML file from each flat file the data retention tool (DART) tool
generated as a result of the data extraction. You can use this report for all company codes
with small to large amount of data.

Prerequisites
You have extracted the tax-relevant data with DART as described in Creating SAFT-PT Files
with DART.

Features
Selection
In the DART Data group box, enter the required data about the flat file from which you want to
generate the XML file.

In the Master Data: Products group box, specify the plants for which you want to generate the
XML file.

In the XML File Data group box, enter the header data of the XML file as required, and in the
File Name field, enter the name of the target file.

Note

The system validates if the file path entered by the user aligns with the file system
configurations authenticated for the report.

The file system configuration includes a logical file name (FI_SAFT_XML_FILE_NAME) and a
logical file path (FI_SAFT_FILE_PATH), associated with the report. You should maintain the
physical file path that you need to use in this report, against the logical file path
FI_SAFT_FILE_PATH using transaction FILE.

You can create the XML file per sales office by specifying the corresponding sales office in
the Sales Office field.

In the Contract Account Based Data: For solutions based on Contract Accounts Receivable
and Payable (FI-CA), you can select that the report also considers FI-CA documents by
selecting Invoice Selection from FI-CA. Furthermore, you must select the scope of the XML
files: By selecting Integrated FI + FI-CA Systems, the output of the report will contain data

Portugal 6774 8
SAP Library 10.07.2013

from both components, whereas by selecting Stand-alone FI-CA, the output will contain only
data from FI-CA. For information about SAF-T files creation in FI-CA, see Standard Audit
Files for Tax Purposes (SAF-T).

In the Transaction Data group box, select the RE-FI Invoices and/or the Sales Documents
checkboxes, depending on the invoice type you want to create the XML file from. Specify the
document type so that the report can select the FI or SD documents with the given document
type. You additionally need to specify the document types for which you want the report to list
the G/L line items or the business partner.

Output
The report generates the XML file and stores it on the application server. You can check both
the flat file and the XML file and download the XML file from the application server as
described in Creating SAFT-PT Files with DART.

Activities
To access the report, on the SAP Easy Access screen, choose Accounting Financial
Accounting General Ledger Reporting Tax Reports Portugal Standard Audit File for
Tax Purposes (SAFT-PT) SAFT-PT: XML File Creation .

Portugal 6774 9

You might also like