meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sap_hybris_commerce:import_export:impex_examples_and_tips [2019/12/18 20:17]
127.0.0.1 external edit
sap_hybris_commerce:import_export:impex_examples_and_tips [2020/05/08 12:55] (current)
Antonio Robirosa Relation export
Line 71: Line 71:
  
 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. 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.
 +
 +You can also export many-to-many relations and use the fields **source** and **target** to extract the information you need. In this example where get a list of product code with their keywords:
 +<​code>​
 +INSERT_UPDATE Product2KeywordRelation;​source(keyword)[unique=true];​target(code)[unique=true]
 +"#% impex.exportItemsFlexibleSearch(""​select {p2k.pk} from {Product2KeywordRelation as p2k inner join Product as p on {p2k.target}={p.pk}} order by {p.pk}""​);"​
 +</​code>​
 +:!: The flexible search must be in one line.
  
 --Based on SAP Hybris 6.4 --Based on SAP Hybris 6.4