
MODE | Comment/Description |
INSERT | Creates a new Item in SAP Hybris Commerce from the processed value line. By default, ImpEx does not check if an item with the same attributes already exists. Therefore, trying to insert an item with a code that already exists may throw an exception caused by the SAP Hybris Commerce core. For that reason, it is recommended to use the unique modifier, where ImpEx pre-checks a violation of attribute uniqueness. |
UPDATE | Selects an existing item in SAP Hybris Commerce from the combination of the values of all columns marked with the unique modifier, which are referred to as key attributes, and sets the item attributes to the values specified in the value line. If there is no item that matches the values of all key attributes, the value line cannot be resolved. The value line is dumped into a temporary file and the ImpEx extension tries to resolve the value line later on. Refer to ImpEx API document, section Import Using an Importer Instance for details. Also note that the default value for attributes is null. This means that any attributes that are referenced by the header but for which no values are specified in the value line are not ignored, but are explicitly set to null. For example, the following ImpEx lines cause the ahertz customer to have the name attribute set to null as the second line after the header specifies no value for the name attribute. UPDATE User;uid[unique=true];name;customerID; ;ahertz;Anja Hertz;; ;ahertz;;K2006-C0005; To set values for both the name and the customerID attributes, you would need to use one of the three following approaches: Specify all values in one single line: UPDATE User;uid[unique=true];name;customerID; ;ahertz;Anja Hertz;K2006-C0005; Re-specify all values that have been set in a prior line: UPDATE User;uid[unique=true];name;customerID; ;ahertz;Anja Hertz;; ;ahertz;Anja Hertz;K2006-C0005; Use individual headers: UPDATE User;uid[unique=true];name; ;ahertz;Anja Hertz; UPDATE User;uid[unique=true];custmerID; ;ahertz;K2006-C0005; UPDATE User;uid[unique=true];name;customerID; ;ahertz;Anja Hertz;; ;ahertz;Anja Hertz;K2006-C0005; Use individual headers: |
INSERT_UPDATE | Combines the effects of the INSERT and UPDATE header modes: if an item with the values of all key attributes exists, this item is updated. If no item exists that matches the combination of all key attributes, the value line is used to create the item. The hybris ImpEx extension always uses this order: UPDATE, then INSERT. |
REMOVE | As in UPDATE mode, the hybris ImpEx extension tries to find an existing item using the key attributes. If such an item exists, it is deleted, otherwise a log message of level warning is printed to the log. |
INSERT Job; code[unique=true]
Customer;SampleCustomer
Employee;SampleEmployee
Each column followed by the header type at the header line describes an attribute of the header type where the column value of the following value lines are mapped to. The ImpEx extension checks the specified type and its attributes and uses a Translator to match the value line's entry to the individual attribute.
INSERT Product;code;unit(code)
;MyProduct;pieces
Items are translated into a text representation called a value line completely driven by their business type definition. Generally, one item is represented by one value line - its attribute values by the columns of this row.
INSERT_UPDATE Product;code[unique=true]; varianttype(code);name[lang=en];
;;;;;;;;;;;;;;;
#;;;;;;;;;;;;;;;
# BASEPRODUCTS JEANS;;;;;;;;;;;;;;;
#;;;;;;;;;;;;
$catalog=catalog(id)
$catalogVersion=catalogVersion($catalog,version)
INSERT Product; code; $catalogVersion
INSERT Product; code; catalogVersion(catalog(id),version)
In the Import content section paste a script and click the Import content button.
In the Import script section choose a script from a different location and click the Import file button.
Hope this blog help you...
Thanks for Reading...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.