2.1.11.1.4.1. Enhancement overall description
All Mapping enhancements spots follow a common protocol at the time of implementation.
Firstly it is checked in the mapping excel (provided in the technical documentation of the tool) which is the default assignment for each field. If this coincides with the client's proposal of the implementation, then no further modification is necessary. If on the contrary the proposal differs, it is necessary to determine if there is an extension of type BAdI that allows us to change the mapping so that it takes the requested value.
All the BAdIs that can be used to change the default mappings are grouped in the enhncement spot /EDGE/SII_MAPEOS.
Starting from this repository of enhancements and checking the code of the method GET_ESTRUCTURA_XML of the class that applies to the mapping of the field in question we can determine the existence (or not) of an alternative of expansion through BAdI.
Each stream will have one or two BAdIs supplied. The finalized in the suffix "_CLI" only provide a series of methods without default code and that we must complete with the corresponding mapping. Those that do not have a "_CLI" suffix provide a default base code that can be altered to fit the needs of each client.
- BAdIs with default implementation:
- /EDGE/BADI_SII_MAPEOS_GEN: This BAdI is used for fields to map in different books of general way, the methods that it contains are the following:
- GET_DATOS_ACREEDOR_CONTRAPARTE: Retrieves the data of a creditor based on the counterpart fields.
- GET_DATOS_DEUDOR_CONTRAPARTE: Retrieves the data of a customer based on the counterparty fields.
- GET_SOCIEDAD: Recovers the value of society.
- SET_SOCIEDAD:Assigns the value of the company code.
- GET_TIPO_FACTURA: Retrieves the value for the "InvoiceType" field.
- GET_DESC_OPERACION: Determines the value of the "Operation Description" field.
- GET_FACTURAS_RECTIFICADAS: Recovers the type of amending invoice.
- GET_TIPO_RETIFICADAS: Returns a table with the data of the invoices that an invoice is rectifying.
- GET_IMPORTE_RECTIFICATIVAS: Calculates the amount of an invoice to be rectified
- GET_REGIMEN_ESPECIAL:Calculates the values of the fields for the Special XML Regime.
- GET_AUTO_CONSUMO:Determines if an invoice is for self-consumption.
- GET_FECHA_OP_RECTIFICADA: Determines the field "Operation Date" if an invoice is an amending invoice
- CAMBIAR_SIGNO_ANTICIPOS:This method is responsible for adjusting the sign of the amount to the tax items if an invoice is a down payment.
- GET_FECHA_OPERACION: Calculates the transaction date for an invoice that is not an amending invoice
- /EDGE/BADI_SII_MAPEOS_EMI: This BAdI is used for fields to map in the invoice book issued, the methods contained are as follows:
- GET_DATOS_INMUEBLE: Retrieves the values for the fields of "DatosInmueble"..
- GET_NUMERO_FACTURA: Retrieves the number+serial value that identifies the invoice issued.
- GET_SRC_KEY_PARA_NUMERO_FACT: Retrieves data from the EDOCUMENT-SOURCE_KEY field for a number + serial value that identifies the invoice issued.
- GET_CAUSA_EXENCION: Recovers the causes of exemption by VAT rate.
- GET_SOCIEDAD: It recovers the value of company.
- SET_SOCIEDAD: Assigns the value of the company.
- GET_PERIODO_IMPOSITIVO: Map the tax period block for the issued XML.
- GET_CAUSA_EXENCION: Recover causes of exemption by VAT type.
- GET_TIPO_NO_SUJETA: Determines the type of not subject.
- GET_DESGLOSE_AUTO_CONS: Map the breakdown of an outgoing self-consumption invoice.
- GET_IMPOR_NO_SUJETA_TAI_LOCAL: Determines the amount of the TAI Location Rules amount tag.
- GET_CUPON: Determines whether an outgoing invoice has a coupon.
- /EDGE/BADI_SII_MAPPING_REC: This BAdI is used for fields to be mapped in the received invoice book, the methods it contains are as follows:
- GET_ID_EMISOR_FACTURA: Retrieves the data of the issuer id of the invoice.
- GET_NUMERO_FACTURA: Retrieves the number+serial value that identifies the invoice issued.
- GET_SOCIEDAD: It recovers the value of company.
- SET_SOCIEDAD: Assigns the value of the company.
- GET_SRC_KEY_PARA_NUMERO_FACT: Retrieves data from the EDOCUMENT-SOURCE_KEY field for a number +serial value that identifies the invoice issued.
- /EDGE/BADI_SII_MAPEOS_GEN: This BAdI is used for fields to map in different books of general way, the methods that it contains are the following:
- /EDGE/BADI_SII_MAPEOS_CE: This BAdI is used for fields to be mapped in the charge book, the methods it contains are as follows:
- GET_DATOS_COBROS: It calculates the data of the receipts of the issued invoices and returns them in a table that maps to the xml of the corresponding eDocument.
- /EDGE/BADI_SII_MAPEOS_OA: This BAdI is used for fields to map of annual operations and the methods that it contains are the following:
- GET_IMPORTE_OS: Retrieves Amount for Insurance Operations.
- GET_IMPORTE_AV: Recover amount for Travel Agencies.
- GET_IMPORTE_CM: Recover amount for cash Collection.
- /EDGE/BADI_SII_MAPEOS_OI: This BAdI is used for fields to be mapped in the book of Intra-Community Operations, the methods that it contains are the following:
- GET_DIRECCION_OPERADOR_EMI: Returns the address of the operator for invoices issued.
- GET_DIRECCION_OPERADOR_REC: Returns the address of the operator for received invoices.
- GET_SOCIEDAD: Recover the value of the company
- SET_SOCIEDAD: Assigns the value of the company..
- GET_TIPO_OPERACION: Returns the type of intracommunity communication.
- /EDGE/BADI_SII_MAPEOS_PR: This BAdI is used for fields to be mapped in the Invoices Receipts book, the methods it contains are as follows:
- GET_DATOS_PAGOS: Retrieve payments for a document
- GET_SOCIEDAD: It recovers the value of company.
- SET_SOCIEDAD: Assigns the value of the company.
- /EDGE/BADI_SII_MAPEOS_BI This BAdI is used for fields to be mapped in the Investment Goods book, the methods it contains are as follows:
- /EDGE/BADI_SII_MAPEOS_CE: This BAdI is used for fields to be mapped in the charge book, the methods it contains are as follows:
- GET_PERIODO_IMPOSITIVO: Retrieves the tax period block
- GET_IDENTIFICACION_BIEN : Retrieves the value of the field Identification Good
- GET_FECHA_INICIO_UTIL: Retrieves the value of the Start Date field Usage
- GET_PRORRATA_ANUAL_DEFI : Retrieves the value of the final Annual Apportionment field
- BAdIs without default implementation:
- /EDGE/IF_SII_MAPEOS_GEN_CLI: This BAdI is used for fields to map in different books of general way, the methods that it contains are the following:
- GET_NIF_REPRESENTANTE_DEUDOR: Retrieves NIF Representative for Debtor.
- GET_NIF_REPRESENTANTE_ACREEDOR: Retrieves NIF Representative for Creditor.
- GET_SAP_DEUDOR_CONTRA_PAIS_ESP: Debtor SAP data from counterpart for special countries.
- GET_SAP_ACREE_CONTRA_PAIS_ESP: SAP data creditor from counterpart to special countries.
- GET_RECTIFICATIVAS: Returns data from rectified invoices..
- GET_IMPORTE_RECTIFICATIVAS: Returns data of the total amount rectified.o.
- GET_CAUSA_EXENCION: Returns field of cause of exemption..
- GET_REGIMEN_ESPECIAL: Recupera campo de régimen especial.
- GET_NUM_SERIE_FACTURA_EM_FIN: Number+Series that identifies the last invoice issued.
- GET_FACTURAS_AGRUPADAS: Returns data from pooled invoices.
- GET_EMISOR_RESUMEN: Returns sender summary.
- /EDGE/BADI_SII_MAPEOS_EMI_CLI: This BAdI is used for fields to be mapped in the book of issued invoices , the methods it contains are the following:
- GET_EMITIDA_POR_TERCEROS: Retrieves data issued to third parties.
- GET_IMPORTE_TRANSMISION_A_IVA: Retrieves VAT transmission amount.
- GET_IMPORTE_NO_SUJETA: Recovers amount of not subject.
- /EDGE/BADI_SII_MAPPING_REC_CLI: This BAdI is used for fields to be mapped in the received invoice book, the methods it contains are as follows:
- GET_ADUANAS: Returns Customs data.
- GET_PORCENT_REAGYP: Returns percentage compensation REAGYP.
- GET_IMPORTE_REAGYP: Returns amount compensation REAGYP.
- GET_CUOTA_DEDUCIBLE: Returns Deductible Fee.
- /EDGE/BADI_SII_MAPEOS_OI_CLI: This BAdI is used for fields to be mapped in the book of certain intra-Community operations, the methods it contains are the following:
- GET_TIPO_OPERACION: Returns operation type.
- GET_PLAZO_OPERACION:Returns operation term.
- GET_FACTURAS_O_DOC: Returns other invoices or documentation related to the operations in question
- /EDGE/BADI_SII_MAPEOS_BI_CLI: This BAdI is used for fields to be mapped in the Book of Investment Goods, the methods it contains are as follows::
- GET_REGULACION_ANUAL_DEDUCCION: Returns the value of the annual deduction regulation field.
- GET_ID_ENTREGA: Returns the value of the field of delivery identification.
- GET_REGULA_DEDUCCION_EFECTUADA: Returns the value of the deduction regularization field made.
- /EDGE/BADI_SII_MAPEOS_CE_CLI: This BAdI is used for fields to be mapped in the Book of Invoices Received, the methods it contains are as follows:
- GET_CUENTA_O_MEDIO: Returns value of the field Cuenta_O_Medio.
- /EDGE/BADI_SII_MAPEOS_OS_CLI: This BAdI is used for fields to be mapped in the Insurance Operations book, the methods it contains are as follows:
- GET_CLAVE_OPERACION: Returns the value of the key operation field..
- /EDGE/BADI_SII_MAPEOS_PR_CLI: This BAdI is used for fields to map in the book of Payments for Invoices Received, the methods it contains are as follows:
- GET_CUENTA_O_MEDIO: Returns value of the field Cuenta_O_Medio..
- /EDGE/IF_SII_MAPEOS_GEN_CLI: This BAdI is used for fields to map in different books of general way, the methods that it contains are the following:
If there is no alternative to add via BAdI, it is necessary to evaluate the option to implement a class Z as the daughter of the class /EDGE/mapping corresponding to the batch whose mapping we want to modify (eg /EDGE/CL_EDOC_SII_MAP_FE_L, /EDGE/CL_EDOC_SII_MAP_FR_L, etc ...). Once this is done, we would redefine the GET_ESTRUCTURA_XML method using the super method to reuse the existing logic with the modifications we deem necessary or to rewrite it completely. In the enhancement, the class Z must be assigned as the assignment class using the transaction /EDGE/SII_CU_015. Optionally you could create a POST or OVERWRITE type enhancement over the GET_ESTRUCTURA_XML method.
Also, in this enhancement spot is also the BAdi /EDGE/BADI_SII_MAPEOS_VALIDAC that will be used to add any type of prior validation that the client wants to do. This BAdi does not have a default implementation because there are already a series of previous validations that can be parameterized for the societies involved from the start menu mapping section:
This BAdi has the validation interface /EDGE/IF_VALIDATIONS_SII associated with the following methods:
- CHECK_VALIDACION: Check the necessary previous validations.
- GET_RELATIVE_NAME: Returns the type of eDocument to valid.
The verification of these validations is done once the mapping of the xml fields has been done. See documentation on validations at point: 2.1.6.6. Before sending validations
Avvale 2024