Import/export template > Module Sales > Import/export template SIH (Invoices) 

Use the invoice import feature to create or modify direct invoices or credit memos.

The SIH import template is not a comprehensive template, the proposed configuration is for information purposes only. This template is used to import the first four invoicing elements.

When the import is for a large number of records, the process duration can be quite long.
Implementing solutions to create multilegislation records for each of the folder legislations can reduce the process duration.

Example: The FRA, POR and USA legislations are used in a folder. If the FRA and POR legislations have the same setup, it is recommended to create a record for the FRA legislation and a record for the POR legislation, instead of having a single record for all legislations.
To view more information on the multilegislation performance improvement principle and obtain the list of objects that you can create by legislation, refer to the document:Performance improvement: List of the multilegislation objects..

A sale invoice consists of two header files: SINVOICE and SINVOICEV and the SINVOICED line file.
In the import template, you need to set up two identifiers:

  • One for the header file SINVOICEV;
  • One for the detail file SINVOICED.

It is not necessary to specify an identifier for the SINVOICE table because the link between SINVOICEV and SINVOICE is described in the object.

Invoices or direct credit memos validated or not, can be imported. This depends on the presence of the INVSTA field (table SINVOICEV) in the import template as well as its value. If the field is missing from the import template, the invoice or the direct credit memo is created in the system with a 'not validated' and 'not printed' status.

Import limitations in Modification mode
When importing a detail line, the system analyzes whether the line is a new line (creation) or an existing line (modification). To that end, the system uses the identifying fields of the line. These fields are: the line number assigned automatically (SIDLIN) and the product reference (ITMREF).
  • If SIDLIN is set up in the template and if it is entered and different from 0, this field or ITMREF is used.
    If there is a line with the SIDLIN value, this line is modified. Otherwise, a new line is created.
  • If SIDLIN is not set up or if it is set to 0, the ITMREF field is used.
    If there is such a line with a value corresponding to the value contained in the field ITMREF, this line is modified. Otherwise, a new line is created.

In this context, if two lines share the same product reference, it is necessary to set up the line number and to enter it in order to differentiate these two lines. Otherwise, the user must always change the first line he sees.

Even if the line number contained in SIDLIN is assigned automatically, you need to enter it, even in creation mode, to ensure a proper functioning.

Invoice import in modification mode

The import of invoice in modification does not update stocks. The system rejects the import if there are imported lines in modification mode with stock update. The message: 'Invoice number: Product code: Invoice with unauthorized stock movement' is displayed in the log file.

When importing an invoice or a credit memo, you can let the system calculate the invoice footer automatically, or import it without the system running a recalculation. The selection depends on the existence in the import template of the data linked to the valuation of the invoice footer. If the data ha been entered, the system will not recalculate the invoice (especially if the AMTATI field of the SINVOICE table is contained in the template).

Import of calculated values
It is possible to import the calculated value of the invoicing elements via an additional level linked to the table that stores the calculation of each SVCRFOOT invoicing element.
It is possible to import the calculated value of the tax elements via an additional level linked to the table that stores the calculation of each SVCRVAT tax element.
See the SIHMPNCAL import template used to import invoices without triggering the invoice valuation methods.

When importing an invoice with a template used to calculate the invoice footer, the invoice elements are imported in the INVDTAAMT fields of the SINVOICEV table.

Import with stock movement

It is possible to import invoices with stock movement when this is a direct invoice provided that the imported invoice has the non-validated status. Otherwise, no stock movement will be carried out and the Stock movement flag will be set to No.
To import non-validated direct invoices with stock movement, it is necessary to add the field STOMVTFLG of the table SINVOICEV in the import template and to set correctly its value in the import file. The stock to be issued is determined by the allocation rules of the product category. Credit memos with stock movements cannot be imported in any way, the field STOMVTFLG is ignored in this context and set to No.

Import of kits and BOMs

Only the invoices are concerned by the import of the kits and BOMs.
The credit memos are not used to manage the kit as a group of products. Each element of the BOM is managed independently.

There are two different ways of importing the kits and BOMs on an invoice:

  • The LINTYP field is not present in the template. In this case, only the parent product needs to be imported
    (the components are not considered as belonging to the kit or BOM, but processed as standard products). The import of the parent product then leads to the automatic generation of all the components defined by the first BOM code. The components with the Option or BOM code type are also generated for the first option and the first variant.
  • The LINTYP field is contained in the template. In this case, the import of the parent product does not trigger the automatic generation of the components. The component lines must be imported by specifying the value of the corresponding LINTYP. You can thus specify the selected components for kits or BOMs containing options or variables.
Import of texts

When necessary, it is possible to import the texts of the invoice header, footer and line: you can set this up in the import template using the GIMP global variable (in the template, fields *71 (etc.) must be indicated).

  • The GIMP(71..78) fields are used to import texts linked to the invoice header. You can thus import a text of 8*100 characters i.e. 800 characters.
  • The GIMP(81..88) fields are used to import texts linked to the invoice footer.
  • The GIMP(91..98) fields are used to import texts linked to the invoice lines.
Import of dimension types on the line

See SIHFL import template.

Specificities of the invoice import

During the import, the sold-to customer can be specified in the import template. The customer will be used when creating the invoice, to determine the the prices and discounts (if not included in the import template).

You can also import link fields to specify the origin of the invoice or credit memo, or even the origin of the invoice and credit memo lines. These are for information purposes only. The source documents (if any) will not be impacted.

Scheduled invoices are not imported. They are calculated based on the invoice payment term.

Prerequisite

For the import to operate properly, the data used in the import and relating to the following tables must already be available:

  • Site table
  • Product table
  • Product/site table
  • Customer table
  • Ship-to customer table

Mandatory fields in the template

In this import, the mandatory fields are the following:

Table SINVOICEV
  • Bill-to-customer (Field BPCINV)

SEEWARNINGIf the storage site and the sales site are not contained in the import template (for those invoices containing stock movement), the sites will be determined by the default storage site and sales site of the session that performs the import.

Table SINVOICED
  • Product reference (ITMREF field)
  • Quantity in sales units (QTY field)

If the sales unit is not mentioned, the determined unit will be first that of the customer, then that of the product.

Table SIVTYP (invoice type)

If the invoice type is not specified, the system selects the first of the list in alphabetical order. This determines the type of invoice or credit memo (even if INVTYP in the template).

If the Invoice status (INVSTA) or Stock movement (STOMVTFLG) fields are not contained in the import template, they are set to No.

Local menus

In addition to the generic error messages, the following messages can appear during the entry :

All the checks carried out by the object in interactive entry are also carried out on invoice import. The main checks being:

Sales site does not exist: Warning to check the sales site control of the invoice.

Non-existing storage site: Warning to check the storage site of the invoice during the invoice with stock movement import.

XXX Customer record does not exist: Warning to check the existence of the customer.

Product YYY record does not exist: Warning to check the existence of the product and the sales-product.

Unit ZZZ record does not exist: Warning to check the existence and the validity of the unit for the product.

Mandatory QTY field: Control message corresponding to the existence of this information at the time of importing the invoice.

Tables used

This template can be used in import and export modes. The data is updated in the following tables :

Table

Table description

BPARTNER [BPR]

Business partner

BPCUSTMVT [MVC]

Customer transactions

BPCUSTOMER [BPC]

Customers

BPDLVCUST [BPD]

Ship-to customer

CONTSERV [CON]

Service contract

CPTANALIN [CAL]

Analytical accounting lines

FACILITY [FCY]

Sites

GACCCODE [CAC]

Accounting codes

GACCOUNT [GAC]

Accounts

GTYPACCENT [GTE]

Document types

HDKTASKINV [HDI]

Consumptions to be invoiced

ITMBPC [ITU]

Customer product

ITMCATEG [ITG]

Product category

ITMFACILIT [ITF]

Products-sites

ITMMASTER [ITM]

Products

ITMMVT [ITV]

Product-site totals

ITMSALES [ITS]

Products - sales

ITMWRH [ITW]

Products-warehouses

LPN [LPN]

License plate number

PRICSTRUCT [PRS]

Price structure (cust/supp)

SALESREP [REP]

Sales rep

SDELIVERY [SDH]

Delivery header

SDELIVERYD [SDD]

Delivery detail

SERREQUEST [SRE]

Service requests

SFOOTINV [SFI]

Invoicing elements

SINVOICE [SIH]

Sales invoices

SINVOICED [SID]

Sales invoice detail

SINVOICEV [SIV]

Costing sales invoice

SORDER [SOH]

Sales orders - header

SORDERP [SOP]

Sales orders - price

SORDERQ [SOQ]

Sales orders - quantities

SPRICLINK [SPK]

Sales price list search

SPRICLIST [SPL]

Customer price lists

SRETURND [SRD]

Sales return detail

STOCK [STO]

Stock

STOJOU [STJ]

Stock journal

STOLOT [STL]

Lot numbers

SVCRFOOT [SVF]

Sales document - footer el.

SVCRVAT [SVV]

Sales document - tax

TABCONTAINER [TCTR]

Container

TABCUR [TCU]

Currency table

TABPRTMOD [TPM]

Print template table

TABSIVTYP [TSV]

Customer invoice type table

TABUNIT [TUN]

Table of units of measure

WAREHOUSE [WRH]

Warehouses