前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP Commerce Impex语法

SAP Commerce Impex语法

作者头像
Jerry Wang
发布2020-04-15 18:15:53
4780
发布2020-04-15 18:15:53
举报

Header:上图蓝色和浅绿色文字。

A header is a single line defining a mapping of the following value lines to the type system. A header applies to all processed value lines until the next header or until the end of file, whichever comes first. You can put any number of headers into a CSV file.

定义了接下来value line和type系统的映射关系。

格式:

代码语言:javascript
复制
mode type[modifier=value];attribute[modifier=value];attribute[modifier=value];attribute[modifier=value][;...];attribute[modifier=value]

方框里的modifier:Gives additional information for translating a value record to the mapped type attribute

例子:INSERT_UPDATE

代码语言:javascript
复制
category;code[unique=true];name[lang=de];name[lang=en];$supercategories;$thumbnail;description[lang=de];order

This header states that each following value line creates or updates a category instance, until another header occurs. 注意,大小写无关。

代码语言:javascript
复制
INSERT Address;firstname;owner(Principal.uid|AbstractOrder.code)
;Hans;admin
;Klaus;O-K2006-C0000-001

由|分隔开的语法叫alternative pattern.

When importing the first value line ;Hans;admin, the ImpEx extension searches all instances of the Principal type to verify if any instance exists where the uid attribute is set to admin.

Impex extension首先查找所有principal实例,看是否存在其uid属性值为admin的实例。

注意我们现在是试图插入Address数据,如果上述的搜索命中,则将Impex语句里的address值维护到搜索命中的admin Principal实例去。

If an instance exists (and there is, by platform default), the new instance of the Address type has its owner attribute set to a reference to that Principal type instance.

如果并没有Pricipal实例,其uid属性等于admin,那么进行第二轮搜索,根据AbstractOrder的code字段进行搜索。

Attribute modifier:

…;attribute[modifier=value,modifier=value,modifier=value];… 或者 …;attribute[modifier=value][modifier=value][modifier=value];…

The value of the catalog macro sets the catalog id. The value of the version macro sets the version string of the catalog version to export.

catalog=clothescatalogversion=Staged

宏的实现:

$catalog=catalog(id) catalogVersion=catalogVersion(catalogVersion=catalogVersion(catalogVersion=catalogVersion(catalog,version)

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-04-13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档