Sei sulla pagina 1di 6

SAP Note 2080644

eDocument Spain - eInvoicing: Configuration and


Customizing

Consulting

2014 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.
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. Please
see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices. 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 SE or its affiliated companies shall not be liable for errors
or omissions with respect to the materials. The only warranties for SAP SE 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.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein.
This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may
be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on
these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
These settings are relevant for the basic solution and for the full solution.

1. Customer Master

Maintain the accounting office (Oficina contable), the management body (rgano gestor) and processing
units (Unidad Tramitadora) of the government entity for those customers that have to be invoiced
electronically.
These government entity codes must be entered in the field KNA1-STCD5 (Tax number 5). The codes must
be filled only for those customers that are to be invoiced electronically. The field is used as selection criterion
for the electronic invoicing process.

Please refer to SAP Note 2028454 for more information about these government entity codes.

When Tax Number 5 is not visible in the Control Data Tab, then the field controls in IMG must be changed, in
order to have this field available as an optional entry in the mater data maintenance:

1- Transaction SPRO: Financial Accounting Accounts Receivable and Accounts Payable


Customer Accounts Master Data Preparations for Creating Customer Master Data
Define Account Groups with Screen Layout (Customers)

For every Account Group for which you need to make the field available: Select field status
General Data, and then select Group Control. Set the screen control for the entry Tax
number 5 to Opt. Entry and save.

2- Transaction SPRO: Financial Accounting -> Accounts Receivable and Accounts Payable ->
Customer Accounts -> Master Data -> Preparations for Creating Customer Master Data ->
Define Screen Layout per Activity (Customers)

For every entry in the table double-click on it and: Select field status General Data, and then
select Group Control. Set the screen control for the entry 'Tax number 5' to 'Opt. Entry' and
save.

You have to repeat this action for all the entries in the table: 'Create Customer (Accounting)',
'Change Customer (Accounting)', 'Display Customer (Accounting)', 'Create Customer (Sales)',
'Change Customer (Sales)', 'Create Customer (Centrally)', 'Change Customer (Centrally)' and
'Display Customer (Centrally)'.

For the entries 'Display...' instead of setting the screen control to 'Opt.entry' you should set it to
'Display'.

If the customer has a Webservice as a destination for eInvoices, create the following entry in the
communication method SSF of that customer:

SSF-ID: <Webservice address>


Notes: ES_INV_WS (this value is used to identify that address as a Webservice for
eInvoices for Spain)

Example:

Copyright/Trademark
Remark: If an entry is not found, then the manual process will be determined for that customer (manual
download/upload of eInvoices).

2. Activate Source Document Types per Company Code

This table is used to indicate for which source document types and Company codes the eDocuments must
be created. The source document types must be activated as follows:

2.1. Execute transaction SM30.


2.2. Enter EDOCOMPANYACTIV in the Table/View field.
2.3. Choose the Edit/Maintain push button.
2.4. Choose the New Entries push button
2.5. Make an entry for each company code and source document type combination that you want to
activate.
2.6. Select the Activate check box for each entry to activate it.
2.7. Save your entries.

Example:

Company code Source Type Active

E001 SD_INVOICE X

E001 FI_INVOICE X

Copyright/Trademark
3. Define Solution Type per Country

This table is used to indicate which eDocument solution (basic or full solution) is used for every country. The
table must be maintained as follows:

3.1. Execute transaction SM30.


3.2. Enter EDOCOUNTRYSOLV in the Table/View field.
3.3. Choose the Edit/Maintain push button.
3.4. Choose the New Entries push button
3.5. Make an entry for each country code and solution type combination that you want to set.
3.6. Save your entries.

Example: Use the value BS for basic solution and FS for full solution.

Remark: If the field Solution Type is empty or you do not create any entry for the country, by default, it will
be considered basic solution.

4. Define Interface Type per eDocument Type

This table is used to define the interface type that will be used for an eDocument. For each Company code
and eDocument type, an interface type must be entered as follows:

4.1. Execute transaction SM30.


4.2. Enter EDOINTTYPEV in the Table/View field.
4.3. Choose the Edit/Maintain push button.
4.4. Choose the New Entries push button
4.5. Make an entry for each company code and eDocument type combination.
Note: All eDocument types for Spain start with ES_*
ES_INV eInvoice
ES_INV_COR eInvoice Correction
4.6. In the Interface Type column, select the interface type according to the solution that you have
implemented:
Basic solution: Select the value CUSTOM - Customer-specific
Full solution: Select the value AIF_PROXY - AIF proxy (for web services)
4.7. Save your entries.

Example for Basic Solution:

Company code eDocument Type Interface Type

E001 ES_INV CUSTOM

E001 ES_INV_COR CUSTOM

5. Assign the eDocument Type to Accounting Document Types

The accounting document types that are relevant for the electronic invoicing process in Spain must be
maintained in a table. Every accounting document type maintained here will trigger the creation of an
eDocument with the type that is assigned to it.

5.1. Enter T003EDOC in the Table/View field.

Copyright/Trademark
5.2. Choose the Edit/Maintain push button.
5.3. Choose the New Entries push button
5.4. For each accounting document type, make an entry:
5.4.1.Enter ES in the Country column.
5.4.2.Enter an accounting document type and assign the corresponding eDocument Type.
Note: All eDocument types for Spain start with ES_*
ES_INV eInvoice
ES_INV_COR eInvoice Correction

5.5. Save your entries.

Example:

Country Accounting eDocument Type


Document Type

ES DR ES_INV

ES RV ES_INV

ES DG ES_INV_COR

Hint: You can use the method CHANGE_EDOCUMENT_TYPE of the BAdI EDOC_ADAPTOR to change the
eDocument type that has been determined according to these settings. For example, in the table T003EDOC
you could have one generic entry for the accounting document type AB, and then, you can implement this
method to decide in which scenarios the eDocument types ES_INV or ES_INV_COR will be determined,
according to your business logic.

6. eDocument determination

The following criteria to determine if the eDocument functionality is applicable are part of the solution:

6.1. Bill-to Party


Only some customers are relevant for electronic invoicing. For those that are, the accounting office
(Oficina contable), the management body (rgano gestor) and processing unit (Unidad
Tramitadora) of the government entity must be filled in the field Tax number 5 (KNA1-STCD5) of the
master data of the Bill-to party of the invoice.

Please refer to SAP Note 2028454 for more information about these government entity codes.

6.2. Accounting Document Type


The eDocuments will be created only for those accounting document types that are relevant for
electronic invoicing (the ones included in the table T003EDOC).

6.3. BAdI to implement your own Business Logic


The method IS_RELEVANT of the BAdI EDOC_ADAPTOR can be implemented with your own
business logic to determine if the eDocument functionality is applicable.

For instance, in case you want to prevent the creation of eDocuments for Billing or Accounting
Documents that were posted before the eDocument functionality was implemented, you can set the

Copyright/Trademark
changing parameter CX_RELEVANT equal to ABAP_FALSE and the eDocument will not be
created (for example, you could check the field Invoice Date or Creation Date).

Hint: The data of the Billing or Accounting Document can be retrieved from the importing object
IO_SOURCE using the method IO_SOURCE->GET_DATA(). This method will return a structure of
type EDOC_SRC_DATA_SD_INVOICE or EDOC_SRC_DATA_FI_INVOICE, depending on the
Source type (whether IO_SOURCE->MV_SOURCE_TYPE is equal to SD_INVOICE or equal to
FI_INVOICE).

7. Authorizations

Two authorization objects have been created for the report EDOC_RESUBMIT_EDOCUMENT. To execute
the report, the users will require these authorizations.

7.1. Company code EDO_BUK


This authorization object verifies if you are authorized to select/display eDocuments for that
Company code.
7.2. Process Step EDO_PROC
This authorization object verifies if you are authorized to perform the corresponding process step for
the eDocument process:

Processes:
ESINV Spain eInvoice (Download)
ESWSINV Spain eInvoice (Webservice)
Steps:
SENDEDOC Send eDocument
DELETEDOC Delete eDocument
REQ_STATUS Request status
CANCEL Cancel eDocument

8. Status Handling of eDocuments

Please refer to SAP Note 2080683 for the Basic Solution.

Copyright/Trademark

Potrebbero piacerti anche