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的原创文章,请关注公众号"汪子熙":

![公众号截图](https://imgconvert.csdnimg.cn/aHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vNTY2OTk1NC82MDA5NzY2OS02ODIyNDkwMC05Nzg2LTExZTktOWYxZS1lOGJlZTA4ZGI0ZmEucG5n?x-oss-process=image/format,png)

目录
相关文章
|
7月前
|
XML 存储 搜索推荐
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字段
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字段
60 0
|
8月前
SAP 电商云 Spartacus 5_0.md 迁移文档的编写格式
SAP 电商云 Spartacus 5_0.md 迁移文档的编写格式
33 0
|
XML 数据格式 容器
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字段(2)
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字段
103 0
|
XML 存储 搜索推荐
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字(1)段
一个真实的 SAP 标准 UI5 应用的扩展开发项目(Extension Project)分享 - UI5 界面上新增订单创建者字段
SAP RETAIL 对WG22执行LSMW批量导入物料组描述信息时需要前台执行
SAP RETAIL 对WG22执行LSMW批量导入物料组描述信息时需要前台执行
SAP RETAIL 对WG22执行LSMW批量导入物料组描述信息时需要前台执行
SAP LSMW 物料主数据Basic Data Text数据的导入
SAP LSMW 物料主数据Basic Data Text数据的导入
SAP LSMW 物料主数据Basic Data Text数据的导入
hybris使用impEx导入产品主数据的示例脚本
hybris使用impEx导入产品主数据的示例脚本
85 0
hybris导出系统已有数据的两种方式
hybris导出系统已有数据的两种方式
140 0
宏在hybris impEx 产品主数据导入脚本中的用途
宏在hybris impEx 产品主数据导入脚本中的用途
91 0
|
API 网络架构
Hybris commerce产品主数据的搜索API,批量返回若干主数据的值
Hybris commerce产品主数据的搜索API,批量返回若干主数据的值