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

Display all Hide all

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.

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.
An identifier must be specified for the table SINVOICE because the link between SINVOICEV and SINVOICE is described in the object.

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.
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, it will be necessary to import only the parent product (the components not being considered as belonging to the kit or BOM but processed like classic 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 into the invoice header, footer and line. This can be set up in the import template by using the global variable GIMP (in the template the fields *71... must be mentioned).

  • 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.

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).
It is possible to import link fields to specify the origin of the invoice or the 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.

Import of dimension types on the line

To import the dimension types of a document line, it is necessary to add an additional level to enter the common table containing the analytical information on the line (CPTANALIN).
See SIHFL import template.



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)

SEEWARNING If 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 fields Invoice status (INVSTA) or Stock movement (STOMVTFLG) are not present in the import template, then 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

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

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