configuration guide customer document version: 3.4.0 … s… · tax declaration framework for...

32
Configuration Guide CUSTOMER Document Version: 3.4.0 – 2016-12-12 SAP Tax Declaration Framework for Brazil 1.0

Upload: nguyenquynh

Post on 26-Jul-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Configuration Guide CUSTOMER

Document Version: 3.4.0 – 2016-12-12

SAP Tax Declaration Framework for Brazil 1.0

Page 2: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Content

1 Document History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Roles and Authorizations for SAP TDF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Run SPED EFD ICMS/IPI Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Run SPED EFD-Contribuições Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Run SPED ECF Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6 Run SPED ECD Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

7 CTR Data Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

8 Master Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23

9 Tables Required in HANA to Activate the CTR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24

10 Generating Documentation in HANA Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

11 CTR Demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

12 CTR Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

13 Customer Extension. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

14 Multi-Temperature Data Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Content

Page 3: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

1 Document History

The following table provides an overview of the most important document changes.

Table 1:

Version Date Description

1.0 2013-12-13 First Version

1.01 2014-05-30 General updates to guide's text.

New tables were added to the Tables Re­quired in HANA to Activate the CTR sec­tion.

1.02 2014-07-14 New tables were added to the Tables Re­quired in HANA to activate the CTR sec­tion.

Obsolete tables were excluded from the Tables Required in HANA to Activate the CTR section.

A new subsection about reference notas fiscais was added to the CTR Extensions section.

2.0 2014-10-17 New tables were added to the Tables Re­quired in HANA to activate the CTR sec­tion.

Obsolete tables were excluded from the Tables Required in HANA to Activate the CTR section.

A new subsection about SPED-related tables that are not properly populated was added to the CTR Extensions sec­tion.

New information about the Initial Load report was added to the Transactions for Configuration section.

A new section was created for the Or­ganizational Structure feature.

SAP Tax Declaration Framework for Brazil 1.0Document History C U S T O M E R 3

Page 4: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Version Date Description

2.1 2015-02-13 New subsection Configuration of Obser­vation Code for C190 Register added to the CTR Extensions section.

New tables were added to the Tables Re­quired in HANA to Activate the CTR sec­tion.

The SPED EFD reports every linked docu­ment of a nota fiscal subsection was ex­cluded from the CTR Extensions section.

The Transactions for Configuration sec­tion was deleted.

The Reports for Additional Functions section was created.

3.0 2015-08-24 The ITMF_CONTRIB_AUT_DET report was added to the Reports for Additional Functions section.

The text of the Organizational Structure section suffered minor changes.

The section Run SPED EFD ICMS/IPI Re­port was added.

The section Run SPED EFD-Contribui­ções Report was added. The section Run SPED ECF Report was added.

Two new tables were added to the CTR Data Structures section.

The ER Modeling subsection, under the CTR Data Structures section, was de­leted.

The Tables Required in HANA to Activate the CTR section was completely remod­eled; it now refers to the SAP Note that contains the HANA tables.

In the CTR Extensions section, the /TMF/D_PROFI_REG table was de­leted and the /TMF/D_REG_PROFI and /TMF/D_REG_PRIO tables were added.

The /TMF/INITIAL_LOAD report infor­mation was added to the Reports for Ad­ditional Functions section.

4 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Document History

Page 5: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Version Date Description

3.1 2015-12-11 The section Multi-Temperature Data Management was added.

The section Run SPED ECD Report was added.

3.2 2016-04-04 The section Customer Extension was added.

The section Roles and Authorizations for SAP TDF was added.

3.3 2016-08-08 The text of the Multiple Systems Config­uration section suffered minor changes.

The section Migration to TDF System was added.

Three tables were removed from the CTR Data Structures section. They were obsolete.

Five tables were added to the CTR Data Structures section.

3.4 2016-12-12 The text of the Run SPED EFD ICMS/IPI Report section suffered minor changes.

SAP Tax Declaration Framework for Brazil 1.0Document History C U S T O M E R 5

Page 6: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

2 Roles and Authorizations for SAP TDF

For information about the TDF roles and the authorizations objects, see the documentation below.

TDF Roles

For more information, see SAP Library for TDF on SAP Help Portal at http://help.sap.com/tdf_br Application Help English TDF Roles .

Authorization Objects

For more information, see SAP Library for TDF on SAP Help Portal at http://help.sap.com/tdf_br Application Help English Authorization Checks for SAP TDF .

6 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Roles and Authorizations for SAP TDF

Page 7: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

3 Run SPED EFD ICMS/IPI Report

To run the SPED EFD ICMS/IPI report, you execute the actions below:

ERP System

1. Activate the LOG_TMF_INT_1 business function using theSFW5 transaction.2. Run the ITMF_REPDAT_FILL report .

For more information, see .

TDF System

1. Perform the system configurations described in .2. Assign SAP System Aliases to OData Service as described in the Administrators' Guide at http://

help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 System Administration and Maintenance Information English Administrators' Guide .

3. Configure the Organizational Structure.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Maintain Organizational Structures .

4. Configure the fiscal period.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Fiscal Period Maintenance .

5. Populate SPED-related tables.For more information, see CTR Extensions [page 27].

6. Define the logical path.For more information, see .

7. Assign all the authorizations.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Authorization Checks for SAP TDF .

8. Deactivate the /UI5/UI5_INFRA_APP/REP_DT_PUT virus scan profile, so that you are able to upload files to Tax Obligation Monitor in UI5.For more information, see Customizing for SAP NetWeaver under Gateway OData ChannelAdministration General Settings Define Virus Scan Profiles .

9. Execute the SPED EFD report using the transaction code /TMF/EFD.

SAP Tax Declaration Framework for Brazil 1.0Run SPED EFD ICMS/IPI Report C U S T O M E R 7

Page 8: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Reporting SPED EFD - Background Information .

10. Check in the Tax Obligation Monitor if the entry for the SPED EFD run was generated.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor .

Migration to TDF System

When you migrate to TDF system, you have to report the changes that you have made in the material descriptions and in the material codes in the SPED EFD ICMS/IPI report.

Every data that you enter in the shadow tables are reported to SPED EFD ICMS/IPI report. Each modification should be informed in a different line of the shadow tables.

For the examples in the table below, consider the following information:

● DT_INI: The date when you started using the material code or material description.● DT_FIM: The date when you stopped using the material code or material description.● DESCR_ANT_ITEM: The material description that you want to report.● COD_ANT_ITEM: The previous material code that you want to report.● REPORTING_DATE: The period when the changes were reported.

Table 2:

From an SAP System

● Configuring changes in descriptions

1. Fill in the /TMF/D_ALT_ITEM shadow table with the infor­mation of the last reported modification.

2. Fill in the REPORTING_DATE field with the first day of the period in which you executed the /TMF/EFD_PRE_0205 report or with the first day of the period in which you re­ported the change.

Example

Table 3:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2001

05.01.2013

Previous descrip­tion

01.07.2013

From a non-SAP System

8 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED EFD ICMS/IPI Report

Page 9: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

● Configuring changes in descriptions

Fill in the /TMF/D_ALT_ITEM shadow table with the informa­tion of the last reported modification.

If you do not inform a date, the system considers the material creation date as the initial date of the material change.

Example

Table 4:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2007

05.10.2013

Previous descrip­tion

01.12.2013

● Configuring changes in material codeFill in the/TMF/D_ALT_ITEM shadow table with the infor­mation of the last reported modification.

Example

Table 5:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2007

05.10.2013

Previous code

01.12.2013

Optional Activities in TDF System

● Create exclusion profiles to exclude SPED registers from EFD report execution.You create these profiles in Customizing for Accounting under Tax Declaration Framework for BrazilReporting SPED EFD Create Exclusion Profile .

● Specify which registers the system excludes from EFD report execution, according to the exclusion profile.You specify these registers in Customizing for Accounting under Tax Declaration Framework for BrazilReporting SPED EFD Specify Exclusion Profile Registers .

● Pre-execute the 0175 register. For more information, see .● Pre-execute the 0205 register. For more information, see .● Define observation codes for SPED EFD report.

You define observation codes in Customizing for Accounting under Tax Declaration Framework for BrazilReporting SPED EFD ICMS/IPI Define Observation Code

● Map the observation codes to fiscal documents of SPED EFD report.You map observation codes in Customizing for Accounting under Tax Declaration Framework for BrazilReporting SPED EFD ICMS/IPI Map Observation Code to Fiscal Document .

● Define additional information codes for SPED EFD report.You define these information codes in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting SPED EFD ICMS/IPI Define Additional Information Code .

● Define the item types and the debit or credit G/L account of the SPED report.

SAP Tax Declaration Framework for Brazil 1.0Run SPED EFD ICMS/IPI Report C U S T O M E R 9

Page 10: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

You define item types and G/L accounts in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting SPED EFD ICMS/IPI Define Types of Products and Services for EFD .

10 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED EFD ICMS/IPI Report

Page 11: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

4 Run SPED EFD-Contribuições Report

To run the SPED EFD-Contribuições report, you execute the actions below:

ERP System

1. Activate the LOG_TMF_INT_1 business function using the SFW5 transaction.2. Run the ITMF_REPDAT_FILL report. For more information, see .3. Define the relevant CFOP for the SPED EFD-Contribuições in Customizing for Financial Accounting (New)

under General Ledger Accounting (New) Periodic Processing Report Statutory Reporting: BrazilSPED Reporting EFD Contributions Maintain CFOP for EFD-Contributions (view J_1BPIS_V_CFOP).

NoteIf you have more than one company code, you must define the CFOP that is relevant for the SPED EFD-Contribuições by company code. You do that in Customizing for Financial Accounting (New) under

General Ledger Accounting (New) Periodic Processing Report Statutory Reporting: Brazil SPED Reporting EFD Contributions Maintain CFOP by Company Code for EFD-Contributions (view J_1BPIS_V_CFOP2).

4. Define relevance of credit for COFINS in Customizing for Cross-Application Components under General Application Functions Tax Declaration Framework (Brazil) SPED EFD-Contribuições Define Credit Relevance for COFINS (view ITMF_COF_RELEV_V).

5. Define relevance of credit for PIS in Customizing for Cross-Application Components under General Application Functions Tax Declaration Framework (Brazil) SPED EFD-Contribuições Define Credit Relevance for PIS (view ITMF_PIS_RELEV_V).

6. Run the Automatic Determination for SPED EFD-Contribuições report (transaction ITMF_CONTRIB_DET) to update SPED Contribuições fields, according to customized rules or BAdI implementation.

Optional Activities in ERP System

● If the standard rules defined in the Automatic Determination for SPED EFD-Contribuições report do not fulfill your business requirements, you can implement the Determine NF Fields (BADI_ITMF_NF_FIELDS_DET) BAdI to determine new nota fiscal fields relevant to SPED EFD-Contribuições.You find this BAdI in Customizing for Cross-Application Components under General Application FunctionsTax Declaration Framework (Brazil) SPED EFD-Contribuições Business Add-Ins (BAdIs) Determine NF Fields .

SAP Tax Declaration Framework for Brazil 1.0Run SPED EFD-Contribuições Report C U S T O M E R 11

Page 12: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

TDF System

1. Perform the system configurations described in .2. Assign SAP System Aliases to OData Service as described in the Administrators' Guide at http://

help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 System Administration and Maintenance Information English Administrators' Guide .

3. Configure the Organizational Structure.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Maintain Organizational Structures .

4. Configure the fiscal period.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Fiscal Period Maintenance .

5. Populate SPED-related tables.For more information, see CTR Extensions [page 27].

6. Define the logical path.For more information, see .

7. Assign all required authorizations.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Authorization Checks for SAP TDF .

8. Deactivate the /UI5/UI5_INFRA_APP/REP_DT_PUT virus scan profile, so that you are able to upload files to Tax Obligation Monitor in UI5.For more information, see Customizing for SAP NetWeaver under Gateway OData ChannelAdministration General Settings Define Virus Scan Profiles .

9. Execute the SPED EFD-Contribuições report (transaction/TMF/PCO) under Accounting Tax Declaration Framework for Brazil Reporting SPED EFD-Contribuições .For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Reporting Executing the SPED EFD-Contribuições .

10. Check in the Tax Obligation Monitor if the entry for the SPED EFD-Contribuições run was generated.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor .

Migration to TDF System

When you migrate to TDF system, you have to report the changes that you have made in the material descriptions and in the material codes in the SPED EFD-Contribuições report.

Every data that you enter in the shadow tables are reported to SPED EFD-Contribuições report. Each modification should be informed in a different line of the shadow tables.

12 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED EFD-Contribuições Report

Page 13: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

For the examples in the table below, consider the following information:

● DT_INI: The date when you started using the material code or material description.● DT_FIM: The date when you stopped using the material code or material description.● DESCR_ANT_ITEM: The material description that you want to report.● COD_ANT_ITEM: The previous material code that you want to report.● REPORTING_DATE: The period when the changes were reported.

Table 6:

From an SAP System

● Configuring changes in descriptions

1. Fill in the /TMF/D_ALT_ITEM shadow table with the infor­mation of the last reported modification.

2. Fill in the REPORTING_DATE field with the first day of the period in which you executed the /TMF/EFD_PRE_0205 report or with the first day of the period in which you re­ported the change.

Example

Table 7:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2001

05.01.2013

Previous descrip­tion

01.07.2013

From a non-SAP System

● Configuring changes in descriptions

Fill in the /TMF/D_ALT_ITEM shadow table with the informa­tion of the last reported modification.

If you do not inform a date, the system considers the material creation date as the initial date of the material change.

Example

Table 8:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2007

05.10.2013

Previous descrip­tion

01.12.2013

● Configuring changes in material codeFill in the/TMF/D_ALT_ITEM shadow table with the infor­mation of the last reported modification.

Example

Table 9:

DT_INI DT_FIM COD_ANT_ITEM

DESCR_ANT_ITEM

REPORTING_DATE

01.05.2007

05.10.2013

Previous code

01.12.2013

SAP Tax Declaration Framework for Brazil 1.0Run SPED EFD-Contribuições Report C U S T O M E R 13

Page 14: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Optional Activities in TDF System

● Pre-execute the 0205 register.For more information, see .

● Define additional information codes for SPED EFD report.You define these information codes in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting SPED EFD Define Additional Information Code .

● Define the item types and the debit or credit G/L account of the SPED report.You define item types and G/L accounts in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting SPED EFD Define Types of Products and Services for EFD .

14 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED EFD-Contribuições Report

Page 15: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

5 Run SPED ECF Report

To run the SPED ECF report, you execute the actions below:

ERP System

1. Define the CNAE code in Customizing for Cross-Application Components under General Application Functions Nota fiscal Fiscal Classification Data Define CNAE .

2. Define the legal nature of the company in Customizing for Cross-Application Components under General Application Functions Nota fiscal Fiscal Classification Data Define Legal Nature .

3. Update the CNAE and the legal nature information for all company's branches.

TDF System

NoteIf you have TDF SP04 installed, the steps four, five, and six below are not necessary.

1. Check the Prework checkbox for the TMFLOCBR software component in the SM30 transaction, SNHI_DUP_PREWORK view.

2. Assign SAP System Aliases to OData Service as described in the Administrators' Guide at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 System Administration and Maintenance Information English Administrators' Guide .

3. Deactivate the /UI5/UI5_INFRA_APP/REP_DT_PUT virus scan profile, so that you are able to upload files to Tax Obligation Monitor in UI5.For more information, see Customizing for SAP NetWeaver under Gateway OData ChannelAdministration General Settings Define Virus Scan Profiles .

4. Define the characteristics of the SPED ECF report in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Maintain Master Data of Legal Reports .

5. Map the HANA view version to its corresponding SPED report layout version in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Map View Version to Legal Report Version .

6. Define what legal report version applies to the report you are submitting and what the validity date of this version is. You do this in Customizing for Accounting under Tax Declaration Framework for BrazilReporting Maintain Legal Reports and Versions .

7. Define the search parameters to obtain fiscal data from external systems in Customizing for Accounting under Tax Declaration Framework for Brazil General Settings Maintain External Systems Mapping .

SAP Tax Declaration Framework for Brazil 1.0Run SPED ECF Report C U S T O M E R 15

Page 16: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

8. Define how the system processes the SPED ECF jobs in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Define Parameters for SPED Jobs Execution .

9. Execute the /TMF/INITIAL_LOAD program to fill in the /TMF/D_ESTABELEC, /TMF/D_CNPJ, /TMF/D_CNPJ_ROOT, and /TMF/D_IE tables.

10. Activate the ICF services below using the SIFC transaction, to be able to access web pages:○ /default_host/sap/bc/ui5_ui5/tmf/ecf○ /default_host/sap/bc/bsp/tmf/ecf○ /default_host/sap/bc/ui5_ui5/tmf/orgstr01○ /default_host/sap/bc/bsp/tmf/orgstr01○ /default_host/sap/opu/odata/tmf/ecf_srv○ /default_host/sap/opu/odata/tmf/rtf_upload_srv○ /default_host/sap/opu/odata/tmf/tm_tmf_tom01○ /default_host/sap/opu/odata/tmf/ts_tmf_orgstr

11. Configure additional SPED ECF data in the SAP Easy Access screen under Accounting Tax Declaration Framework for Brazil Declaration Services Maintain Organizational Structures .

12. Create an Excel file to fill in the SPED ECF registers covered by this feature. You do that in the SAP Easy Access screen under Accounting Tax Declaration Framework for Brazil Data Integration Generate File with SPED Registers Data .For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Data Integration Generate File with SPED Registers Data .

13. Upload the Excel file you have created. You do that in the SAP Easy Access screen under Accounting Tax Declaration Framework for Brazil Data Integration Upload File with SPED Registers Data .For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Data Integration Upload File with SPED Registers Data .

14. Execute the SPED ECF report using the /TMF/ECF transaction or in the SAP Easy Access screen under Accounting Tax Declaration Framework for Brazil Reporting SPED ECF .

For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Reporting SPED ECF - Background Information .

15. Check in the Tax Obligation Monitor if the entry for the SPED ECF run was generated.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor .

16 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED ECF Report

Page 17: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

6 Run SPED ECD Report

To run the SPED ECD report, you execute the actions below:

TDF System

1. Perform the system configurations described in 2. Assign SAP System Aliases to OData Service as described in the Administrators' Guide at http://

help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 System Administration and Maintenance Information English Administrators' Guide .

3. Configure the Organizational Structure.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Maintain Organizational Structures .

4. Configure the fiscal period.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Fiscal Period Maintenance .

5. Check the characteristics of the SPED ECD report in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Maintain Master Data of Legal Reports .

6. Verify the HANA view version to its corresponding SPED report layout version in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Map View Version to Legal Report Version .

7. Specify what legal report version applies to the report you are submitting and what the validity date of this version is. You do this in Customizing for Accounting under Tax Declaration Framework for BrazilReporting Maintain Legal Reports and Versions .

8. Define how the system processes the SPED ECD jobs in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Define Parameters for SPED Jobs Execution .

9. Populate SPED-related tablesFor more information, see CTR Extensions [page 27].

10. Define the logical path.For more information, see .

11. Assign all the authorizations.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Authorization Checks for SAP TDF .

12. Deactivate the /UI5/UI5_INFRA_APP/REP_DT_PUT virus scan profile, so that you are able to upload files to Tax Obligation Monitor in UI5.For more information, see Customizing for SAP NetWeaver under Gateway OData ChannellAdministration General Settings Define Virus Scan Profiles .

SAP Tax Declaration Framework for Brazil 1.0Run SPED ECD Report C U S T O M E R 17

Page 18: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

13. Execute the SPED ECD report using the /TMF/ECD transaction code.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Reporting SPED ECD - Background Information .

14. Check in the Tax Obligation Monitor if the entry for the SPED ECD run was generated.For more information, see the Application Help documentation at http://help.sap.com/tdf_br, under SAP Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor .

18 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Run SPED ECD Report

Page 19: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

7 CTR Data Structures

In the Central Tax Repository (CTR), two types of data structure are used in data building for fiscal documents: tables and calculation views. These are divided into subtypes, as described in the following sections.

Tables

Tables are structures that store information from SAP ERP or another source. For the CTR, some types of tables have been created in order to organize and configure data. These tables are shown in the entity relationship (ER) model as a blue square or rectangle with no lines inside (see section Modeling Structure).

SAP ERP Standard Tables

These tables contain exactly the same data as the SAP ERP system, for example, T001K.

NoteDevelopers must not consume SAP ERP standard tables in programs, that is, front-end applications.

CPL Tables

Complement tables deliver information that does not exist in SAP ERP. The names of these tables have the suffix CPL, for example, INVENTARIO_CPL.

The following table lists all of the complement tables and the private views that consume them.

Table 10:

Complement Table Consumed By

/TMF/D_EMP_CPL PRV_EMPRESA

/TMF/D_ICMSSTCPL PRV_APURACAO_ICMS_ST_UF_ANTERIOR

/TMF/D_ICMS_CPL PRV_CMS_ANTERIOR

/TMF/D_ICTER_CPL PRV_INSUMOS_CONSUMIDOS_TERCEIROS

/TMF/D_IMPH_CPL PRV_IMPRESSAO_CABECALHO

/TMF/D_IMPI_CPL PRV_IMPRESSAO_ITEM

/TMF/D_INVEN_CPL PRV_INVENTARIO

/TMF/D_ITEM_CPL PRV_ITEM

/TMF/D_LCONT_CPL PRV_LANCAMENTO_CONTABIL

SAP Tax Declaration Framework for Brazil 1.0CTR Data Structures C U S T O M E R 19

Page 20: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Complement Table Consumed By

/TMF/D_NFDOC_CPL PRV_NF_DOCUMENTO

/TMF/D_NF_IT_CPL PRV_NF_ITEM

/TMF/D_OP_MD_CPL PRV_OPER_MEDICAMENTO

/TMF/D_PLCTA_CPL PRV_PLANO_CONTAS

/TMF/D_PROD_CPL PRV_PRODUCAO

/TMF/D_SCONT_CPL PRV_SALDO_CONTABIL

Shadow Tables

Shadow tables have the same structure as the reuse views. They are used when data from SAP ERP requires changes or corrections that, for any reason, cannot be done in SAP ERP itself, but are legal obligations in Brazil.

In the views that use shadow tables, if any register is retrieved from SAP ERP with the same key in the shadow table, the information is replaced with data from the shadow table. That is, shadow tables have priority over data formed from SAP ERP tables.

Also, it is possible to insert data that is not available in the SAP ERP directly into the shadow tables.

Shadow tables are represented with a name similar to the scenarios required for the fiscal legislation in Brazil.

Calculation Views

Calculation views are entities that get information from tables in SAP ERP, the CTR or legacy systems as input, execute several required calculations, and give the result in a proper consumable format .

The CTR splits views into different types in order to differentiate between views that belong to standard SAP ERP and views that can be manipulated by users to get any kind of information that does not exist in the standard system.

These views are shown in the ER model as a purple square or rectangle with two lines inside (see section Modeling Structure).

Private Views

Private views are used to isolate the SAP ERP content from the CTR. These views are the foundation for CTR reuse views and are the only entity that access SAP ERP data. Private views cannot consume a reuse view.

The name of these views have the prefix PRV, for example, PRV_LANCAMENTO_CONTABIL.

NoteDevelopers must not consume private views in programs, that is, front-end applications.

Reuse Views

20 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

CTR Data Structures

Page 21: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Reuse views aggregate, in a single place, data from SAP ERP, legacy systems, CPL tables, shadow tables PRV views or other reuse views. They never access any standard tables; they contain all the necessary data to create reports.

The names of these tables usually follow the name of the process to which they refer, for example, NF_ITEM.

All reuse views are available for consumption directly in an ABAP program. This is possible because the HANA View is synchronized with NetWeaver. For more information on how to use refer to the ABAP program /TMF/CTR_DEMO.

Modeling Structure

The figure below illustrates how data is modeled in the CTR:

The bottom (blue) box shows SAP ERP tables. These tables feed the private views shown in the next (gray) box. Complement tables are also shown in the gray box, if they exist. The next (green) box shows the reuse views, which will be consumed by other views, for example, to fill SPED EFD.

SAP Tax Declaration Framework for Brazil 1.0CTR Data Structures C U S T O M E R 21

Page 22: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Entity Relationship Model

Definition

The entity relationship model, also known as the ER model or ER diagram, is a diagrammatic model that describes the system data model with a high level of abstraction. It is a static view of the system. Its main application is to visualize the relationship between database tables, which are built through the association of table attributes.

22 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

CTR Data Structures

Page 23: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

8 Master Data

Enhancements have been made to the master data in SAP ERP to provide more information as demanded by federal law in Brazil. For more information, see SAP Note 1889776 , (ERP Master Data and Tax Determination Enhancements).

SAP Tax Declaration Framework for Brazil 1.0Master Data C U S T O M E R 23

Page 24: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

9 Tables Required in HANA to Activate the CTR

For the updated list of tables, see the SAP Note 2190963 - TDF Tables needed in SLT replication.

24 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Tables Required in HANA to Activate the CTR

Page 25: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

10 Generating Documentation in HANA Studio

Use

HANA Studio can generate documentation about views.

Features

To generate documentation:

1. Right click in the object/package and choose Auto Documentation.2. In the Auto Documentation dialog box, enter a path in Target Location.3. Choose Finish. The Auto Documentation activity appears in the Job Log panel.

The documentation is generated as a PDF file with the following blocks:

● General● Attributes● Calculated Attributes● Measures● Calculated Measures● Counters● Variables● Input Parameters● Where-Used● Cross-References● Calculation View SQL Script

SAP Tax Declaration Framework for Brazil 1.0Generating Documentation in HANA Studio C U S T O M E R 25

Page 26: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

11 CTR Demo

The program /TMF/CTR_DEMO demonstrates how to consume and insert data into the CTR. The program shows how to apply, using ABAP code, the main concepts presented in this document.

Access the report (/TMF/CTR_TECH_INFO) to check which tables are used in each CTR.

26 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

CTR Demo

Page 27: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

12 CTR Extensions

It is possible that information is identified as required in the CTR but not yet supported there. In this case, the CTR must be enhanced to support this data.

Depending on the source and category of the data, there are different strategies to support CTR enhancements.

Extension Scenarios

● Field exists in SAP ERP but not in the CTRThe requirement must be communicated to SAP, which will analyze it and possibly add it to the CTR upper views and reports depending on them.

● Field does not exist in SAP ERP but is required in the CTRCPL tables (see section CPL Tables in CTR Data Structures [page 19]) have been created to support this situation. Check whether the field is not already present in the respective table. If it is not, the requirement must be communicated to SAP, which will analyze it and possibly add it to the CPL table and consequently to all necessary CTR views. Once the field is available, the data must be inserted accordingly so it is consumed by the CTR.

● Information is not available as part of CTR scopeNew views must be created. The CTR views should be added to the new views as a separate projection. Copying the complete CTR view instead of reusing it causes the view to not receive updates and corrections, and, therefore, this is not recommended. It is recommended to first apply for the previously mentioned options because, in that case, the data is communicated through several CTR views, facilitating the data consumption.For example, a new table is created with an additional field NEW_FIELD. To join this field with the existing nota fiscal CTR view, a new view is created. This new view projects the new table and joins a CTR view with data already aggregated, which enables the new view to be ready for output.

● SPED-related tables are not properly populatedTo ensure that the /TMF/D_REP_FISC, /TMF/D_VIEW_VERS, /TMF/D_REP_VERS, /TMF/D_REG_PROFI, and /TMF/D_REG_PRIO tables are populated correctly, with all necessary entries from the EFD and ECD reports, you check SAP Note 2045948 for the required information.

SAP Tax Declaration Framework for Brazil 1.0CTR Extensions C U S T O M E R 27

Page 28: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

13 Customer Extension

RecommendationIn general for TDF, SAP recommends to fix data inconsistencies at origin, which means correcting data in the ERP system connected to the TDF system. This is the best approach as it avoids introducing new errors in subsequent reporting periods. In cases where it is not possible to correct data in ERP, filling shadow tables is the second option. In exceptional cases, where it is not possible to correct data either at origin or in the shadow tables, proceed as described below.

In TDF, there are two ways to extend the standard content and logic, in addition to the usage of shadow tables:

● Create a new HANA view to generate the result of a given register.● Create a specific class to handle or retrieve the data from a register.

Important

● Customer extensions are considered to be non-standard development. Views created by customers or logic implemented in the ABAP are not supported by SAP.

● During incident processing, customers might be asked to activate the TDF trace report in order to identify customer extensions in TDF reports. Customers might also be asked to deactivate customer extensions. For details of the trace report, see View Report Execution Log in the application help for TDF.

● It is the customer's responsibility to ensure the compatibility of customer extensions after installing support packages or implementing SAP notes.

Create Views with Your Own Logic

If you have a specific scenario not covered by the standard logic available in TDF views or that cannot be covered through populating shadow tables, you can create a specific view for your requirements.

To create a view, proceed as follows:

1. Create a package in the same level as package “sap”, with the customer’s or partner’s name.2. In this package, you can organize the objects and sub-packages freely according to your requirements.3. In that structure, implement your HANA view, with the logic you need. It is important to pay attention to the

following items:○ Use input parameters only if they are available in the parameter class of the SPED report you are

extending. For example, for SPED EFD-Contribuições, you can only use parameters available in class /TMF/CL_SPED_PARAMETERS_PCO.

○ The name of these parameters must be the same used in the GET_* and SET_* methods. For example, for a parameter to filter company code, use P_EMPRESA as its name, since the method GET_EMPRESA is available in class /TMF/CL_SPED_PARAMETERS_PCO and this method is responsible for returning the company code entered in the selection screen of the report.

○ Two fields are mandatory in the view’s output:○ REG (register name)

This field marks the beginning of the register’s content

28 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Customer Extension

Page 29: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

○ SORTER (unique code that is used to sort the report’s final result)This field marks the end of the register’s content and must be the last one in the output list.

○ You cannot have measures as part of the view’s output, only attributes.○ If you need any additional fields, for example, to act as filters in a child register, you can insert them

before the field REG, so it that they are not in the report line. The fields MANDT, EMPRESA and FILIAL must be available in the output this way whenever is possible

4. Create this view’s mapping to NetWeaver, generating an ABAP view.

5. Map the ABAP to the register. You do this in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting Map View Version to Legal Report Version .

Modify the ABAP Code Responsible for Handling a HANA View

There may be cases when it is necessary to create specific logic to handle register data in ABAP. For example, this could be to create a specific query for a register, to create post-processing logic to treat the data retrieved by a view, or to create a specific format for a given field

CautionModifying data outside HANA using ABAP is not considered good practice as other tools can consume data from HANA and give different results from SPED reports. Use this alternative only when really necessary and in cases where fixing data at origin, shadow tables and customer-specific views is not possible.

To modify the ABAP code:

1. Create a specific class for your needs. This class must have class /TMF/CL_SPED_REG or classes /TMF/CL_SPED_REG_<report> as the super class. For example, to create a class for register 0200 of SPED EFD-Contribuições, you can create the class ZCL_SPED_REG_PCO_0200 as a child of /TMF/CL_SPED_REG_PCO.Note: You should not redefine the method GET_FORMATTED_DATA in class /TMF/CL_SPED_REG.

2. Implement your specific logic in the created class.3. Create an implementation for BAdI /TMF/BADI_SPED_REG_FACTORY, available in enhancement spot /TMF/

ES_SPED_REG_FACTORY.The BAdI is available in Customizing for Accounting under Tax Declaration Framework for Brazil Reporting

BAdI: Generate Register Instance .4. Implement method /TMF/IF_SPED_REG_FACTORY~REGISTER_FACTORY in this BAdI implementation. In

this method you have the following available as input data:○ Details of the register to be executed as provided by HANA view sap.glo.tmflocbr.ctr/

REGISTROS_POR_VERSAO_REPORT (IS_REGISTER)○ Report selection screen parameters and values (IO_PARAMETERS)

Use this data to generate the register instance to be returned in parameter RO_REGISTER.In the example above, when the field is_register-report_id has the value "3" (SPED EFD-Contribuições) and the field is_register-view_register has the value "0200", you create the instance of class ZCL_SPED_REG_PCO_0200.

SAP Tax Declaration Framework for Brazil 1.0Customer Extension C U S T O M E R 29

Page 30: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

14 Multi-Temperature Data Management

Due to the high amount of data required for the SAP Tax Declaration Framework processes, you may face performance issues. To prevent these issues, you can manage the lifecycle of your information using the extended table concept with SAP HANA Dynamic Tiering.

For more information, see the Help Portal documentation at http://help.sap.com, under Technology PlatformSAP NetWeaver SAP NetWeaver 7.4 Using the SAP HANA Database Operation and Administration of the SAP BW on SAP HANA Multi-Temperature Data Management .

30 C U S T O M E RSAP Tax Declaration Framework for Brazil 1.0

Multi-Temperature Data Management

Page 31: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

Important Disclaimers and Legal Information

Coding SamplesAny software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP intentionally or by SAP's gross negligence.

AccessibilityThe information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be a binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however, does not apply in cases of willful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations of SAP.

Gender-Neutral LanguageAs far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as "sales person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun does not exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.

Internet HyperlinksThe SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does not warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any damages caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for transparency (see: http://help.sap.com/disclaimer).

SAP Tax Declaration Framework for Brazil 1.0Important Disclaimers and Legal Information C U S T O M E R 31

Page 32: Configuration Guide CUSTOMER Document Version: 3.4.0 … S… · Tax Declaration Framework for Brazil 1.0 Application Help English Declaration Services Tax Obligation Monitor . Migration

go.sap.com/registration/contact.html

© 2016 SAP SE or an SAP affiliate company. All rights reserved.No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. The information contained herein may be changed without prior notice.Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary.These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company 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 SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies.Please see http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.