SAP 如何创建具有特殊条件和别名的视图
SAP How to create a view with special conditions and aliases
我想对以下 SELECT 声明发表看法:
SELECT ma~matnr ma~mtart ma~ernam ma~ersda ma~laeda de~maktx as maktx_de fr~maktx as maktx_fr it~maktx as maktx_it
FROM mara as ma
LEFT JOIN MAKT as de ON de~matnr = ma~matnr AND de~spras = 'DE'
LEFT JOIN MAKT as fr ON fr~matnr = ma~matnr AND fr~spras = 'FR'
LEFT JOIN MAKT as it ON it~matnr = ma~matnr AND it~spras = 'IT'
INTO CORRESPONDING FIELDS OF TABLE g_it_material
我该怎么做?在 SE11 中哪里可以选择别名和特殊条件?
很遗憾,字典视图无法实现您描述的情况。
当然可以定义条件,但是不能定义字段别名。给你一个 similar 结果的唯一选择是为每种语言定义一个 OR
条件,然后相应地处理行(它会给你每种语言每行 material, 然而)。我怀疑这是一个可以接受的替代方案。
注意 答案已更改 - 我最初没有注意到您对 MAKT
.
进行了三个连接
我想对以下 SELECT 声明发表看法:
SELECT ma~matnr ma~mtart ma~ernam ma~ersda ma~laeda de~maktx as maktx_de fr~maktx as maktx_fr it~maktx as maktx_it
FROM mara as ma
LEFT JOIN MAKT as de ON de~matnr = ma~matnr AND de~spras = 'DE'
LEFT JOIN MAKT as fr ON fr~matnr = ma~matnr AND fr~spras = 'FR'
LEFT JOIN MAKT as it ON it~matnr = ma~matnr AND it~spras = 'IT'
INTO CORRESPONDING FIELDS OF TABLE g_it_material
我该怎么做?在 SE11 中哪里可以选择别名和特殊条件?
很遗憾,字典视图无法实现您描述的情况。
当然可以定义条件,但是不能定义字段别名。给你一个 similar 结果的唯一选择是为每种语言定义一个 OR
条件,然后相应地处理行(它会给你每种语言每行 material, 然而)。我怀疑这是一个可以接受的替代方案。
注意 答案已更改 - 我最初没有注意到您对 MAKT
.