简体   繁体   中英

SAP How to create a view with special conditions and aliases

I want to make a view for following SELECT statement:

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

How can I do that? Where can I choose aliases and special conditions in SE11?

Unfortunately the case you've described isn't possible with a dictionary view.

You can certainly define the conditions, but you cannot define field aliases. The only option that would give you a similar result is to define an OR condition for each language and then process the rows accordingly (it would give you one row per language per material, however). I doubt that would be an acceptable alternative.

Note Answer changed - I originally missed the point that you had three joins to MAKT .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM