hybris使用impEx导入产品主数据的示例脚本
生活随笔
收集整理的這篇文章主要介紹了
hybris使用impEx导入产品主数据的示例脚本
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
SAP官網鏈接:https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/8bdf595b86691014b902e0974f71491a.html
菜單路徑:
Platform,Services,and Utilities->Commerce Platform Module->Commerce Platform Module Features->ImpEx->Working with ImpEx->Importing Products and Orders:
完整代碼如下:
# # Macro definitions (1) # $catalogVersion=catalogVersion(catalog(id[default='clothescatalog']), version[default='Staged'])[unique=true,default='clothescatalog:Staged'] $prices=europe1Prices[translator=de.hybris.platform.europe1.jalo.impex.Europe1PricesTranslator] $baseProduct=baseProduct(code, catalogVersion(catalog(id[default='clothescatalog']), version[default='Staged']));;;;;;;; # # Create a category (2) # INSERT_UPDATE Category;code[unique=true];$catalogVersion;name[lang=de];name[lang=en];description[lang=de];description[lang=en]; ;SampleCategory;clothescatalog:Online;Testkategorie;Sample category;Dies ist eine Testkategorie;This is a sample category;# # Create some products (3) # INSERT_UPDATE Product;code[unique=true];name[lang=en]; name[lang=de];unit(code);$catalogVersion; description[lang=en]; description[lang=de]; approvalStatus(code);supercategories(code) ;sampleproduct1;SampleProduct1;Testprodukt1;pieces;clothescatalog:Online;"This is a sample product";"Dies ist ein Testprodukt";approved;SampleCategory ;sampleproduct2;SampleProduct2;Testprodukt2;pieces;clothescatalog:Online;"This is another sample product";"Dies ist ein weiteres Testprodukt";approved;SampleCategory ;sampleproduct3;SampleProduct3;Testprodukt3;pieces;clothescatalog:Online;"This is the third sample product";"Dies ist das dritte Testprodukt";approved;SampleCategory# # Some pricerows for our products (4) # INSERT_UPDATE Product;code[unique=true];$catalogVersion;$prices;Europe1PriceFactory_PTG(code); ;sampleproduct1;clothescatalog:Online;"1 pieces = 12,00 EUR, 20 pieces = 10,00 EUR";Tax_Full; ;sampleproduct2;clothescatalog:Online;"1 pieces = 11,50 EUR, 30 pieces = 0,99 EUR";Tax_Half; ;sampleproduct3;clothescatalog:Online;"1 pieces = 651,89 EUR, 10 pieces = 599,99 EUR";Tax_Full;# # Some variants of sampleproduct1 including Prices (5) # INSERT_UPDATE Product;code[unique=true]; $baseProduct;$catalogVersion; approvalStatus(code); Europe1PriceFactory_PTG(code); $prices;unit(code[default=pieces]); ;sampleproduct1-00;sampleproduct1;clothescatalog:Online;approved;Tax_Full;11,50 EUR N; pieces; ;sampleproduct1-01;sampleproduct1;clothescatalog:Online;approved;Tax_Full;11,00 EUR N; pieces;# # Defining an Order (6) # INSERT_UPDATE Order;code[unique=true];user(uid);date[dateformat=dd.MM.yyyy HH:mm];currency(isocode);net;deliveryMode(code);paymentMode(code);Discounts(code);calculated ;SampleOrder1;demo;17.01.2006 10:58;EUR;false;;advance;;false #% impex.getLastImportedItem().setDeliveryAddress(impex.getLastImportedItem().getUser().getDefaultDeliveryAddress()); #% impex.getLastImportedItem().setPaymentAddress(impex.getLastImportedItem().getUser().getDefaultPaymentAddress());# # Setting OrderEntries on the Order (7) # INSERT_UPDATE OrderEntry;order(code)[unique=true];product(code,catalogVersion(catalog(id),version))[unique=true];quantity;calculated;unit(code);entryNumber;;; ;SampleOrder1;sampleproduct1:clothescatalog:Online;1;false;pieces;0;;; ;SampleOrder1;sampleproduct2:clothescatalog:Online;2;false;pieces;1;;; ;SampleOrder1;sampleproduct3:clothescatalog:Online;3;false;pieces;2;;;# # Calculating the Order (8) # UPDATE Order;code[unique=true] ;SampleOrder1 #% impex.getLastImportedItem().recalculate(); ```要獲取更多Jerry的原創文章,請關注公眾號"汪子熙": 總結
以上是生活随笔為你收集整理的hybris使用impEx导入产品主数据的示例脚本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: openEuler工业领域操作系统筹备委
- 下一篇: 使用root用户安装Hybris遇到的错