You are on page 1of 12

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

Portugal

System and Application Help Documentation


© 2013 by SAP AG. All rights reserved.
SAP and the SAP logo are registered trademarks of SAP AG in Germany and other countries. Business
Objects and the Business Objects logo are trademarks or registered trademarks of Business Objects
Software Ltd. Business Objects is an SAP company.
Sybase and the Sybase logo are registered trademarks of Sybase Inc. Sybase is an
SAP company.

Copyright/Trademark
This document provides you with the current system and application documentation available for
the Standard Audit Files for Tax Purposes (SAF-T) for Portugal. The complete system
documentation objects will be available in your system upon installation of the relevant support
package. The current documentation serves therefore only as a reference.

Table of Contents

Contents
System Documentation ............................................................................................................................. 4
Data Elements ............................................................................................................................................. 4
SAFT_INV_SEL_SRC_KK Extraction Rule .................................................................................................. 4
SAFT_EXT_PROCTYP_KK Process type (used only for customer extension) .............................................. 4
Report Documentation ................................................................................................................................. 5
RFKKPTSAFT – SAFT: Source Document Extraction .................................................................................. 5
Customizing ................................................................................................................................................. 6
View Cluster VCFKKSAFTINV_RULE Define Extraction Rules of Source Documents for SAF-T Files .......... 6
Application Help ........................................................................................................................................ 7
Creating SAFT-PT Files with DART ............................................................................................................. 7
SAFT-PT: XML File Creation.......................................................................................................................10
Standard Audit Files for Tax Purposes (SAF-T) ...........................................................................................12

Copyright/Trademark
SYSTEM DOCUMENTATION
Data Elements

SAFT_INV_SEL_SRC_KK Extraction Rule

Definition

Specifies which source documents are to be extracted for the SAF-T files based on the following criteria:

Documents with or without official document number and/or

Documents with or without digital signature

By selecting Exclude, you explicitly specify that for the defined posting period, the combination of document types
origin keys defined in the rule should not considered for the generation of SAF-T files.

Use

The selection done in this field, along with the other rule conditions defined by you in the customizing, will be
stored in temporary tables. This data will be the source for the generation of the SAF-T files for the Portuguese
authorities.

SAFT_EXT_PROCTYP_KK Process type (used only for customer extension)

Definition

Specifies a unique name for a function module.

Copyright/Trademark
Report Documentation

RFKKPTSAFT – SAFT: Source Document Extraction

Purpose

You use this report to store in temporary tables the data of FI-CA source documents relevant for the generation of
SAF-T files for the Portuguese authorities.

The report XML File Creation (Portugal) (RSAFT_PT_XML) accesses the information stored in these tables to
generate the SAF-T files in XML format.

Prerequisites

You have defined the rules to select the relevant source documents for a given posting period in the Customizing
activity Define Extraction Rules of Source Documents for SAF-T Files

Output

After you run the report, the data that matches the selection you have done is stored in the temporary tables and
can be accessed by the report XML File Creation (Portugal) (RSAFT_PT_XML) for further processing.

Activities

You must define for which application area, company code, and posting period you want to run the report to.

Copyright/Trademark
Customizing

View Cluster VCFKKSAFTINV_RULE Define Extraction Rules of Source Documents for SAF-T Files

Use

In this Customizing activity, you can define rules to select the source documents to be listed in the Standard Audit
File for Tax Purposes (SAF-T-PT) XML file that is generated for the Portuguese authorities.

Requirements

You have done the customizing in Enter Data for Tax Codes

Activities

You can define as many rules as necessary for a given company code by selecting different combinations of
document type forms, origin keys, and posting dates, as well as specifying if the documents are issued with or
without official document numbering and/or must be digitally signed.

You use the Extension ID column to enhance the solution with your customer-specific customizing. For instance, in
case the definition of the official document number for your documents is alphanumeric, you assign a function
module that selects only the numeric part of the official document number and forwards it to SAF-T file.

Copyright/Trademark
APPLICATION HELP

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.

End of the note.


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 32–bit 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.

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

Copyright/Trademark
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

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.

Copyright/Trademark
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.

Copyright/Trademark
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.

End of the note.


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,
you can select that the report also considers FI-CA documents by selecting Invoice Selection from FI-CA. By
selecting the Integrated FI + FI-CA Systems, the output of the report will contain data from both components,
whereas by selecting Stand-alone FI-CA, the output will contain only data from FI-CA.

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

Copyright/Trademark
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 .

Copyright/Trademark
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 to the tax authorities for tax
auditing purposes when required.

Integration
You use 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
and FI-CA run in the same system, you can generate a consolidated XML file that contains data from both
applications. For stand-alone FI-CA solutions, you can generate XML files that considers FI-CA documents
only.
For more information, see Creating SAFT-PT Files with DART

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

Additionally, you have defined rules for the selection and extraction 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 EC Sales List Standard Audit Files Standard Audit File for Tax Purposes – Portugal
(SAF-T PT) Define Extraction Rules of Source Documents for SAF-T Files

Activities
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

The following must be specified to run the report for FI-CA documents:

1. In the Contract Account Based Data group box, select Invoice Selection from FI-CA 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 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.

Copyright/Trademark

You might also like