In some occasions we need to export a subset of the existing products or other items. This can be do using Impex and a flexible search query.

The Impex Writer class allows to use a flexble search query to select the items to export:

INSERT_UPDATE Product;pk[unique=true];sapECommerceVersandort
"#% impex.exportItemsFlexibleSearch(""select {}, {p.sapECommerceVersandort} from {Product as p} where {p.sapECommerceVersandort} is not null order by {}"");"

In the above example with export all the products (including subclasses) where the field sapECommerceVersandort is not null. The only restriction is that the query must return the pk of the items. Then the header defines what fields are going to be exported.

 Based on Hybris 4.8.12

Add comment

Security code