09-11-2008 9:56 PM
Hi,
I am running into this problem and I am stuck.
Short story:
I need to join two views into one view,
or include one view into another containing base tables,
or join the same table twice using, maybe, and alias.
Long story:
I have to create a view which joins vendor number and name with manufacturer number and name. All this through views and no coding.
There already exists a working view containing the vendor info and manufacturer number.
Z_VENDOR_VIEW
Tables:
MARA
LFA1
MARC
MAKT
EINA
Using the manufacturer number (MFRNR) from the above, I want to fetch the name from LFA1-NAME1.
The problem is that LFA1-NAME1 is already used in the above view as the vendor name with the join condition EINA and LFA1.
The end result should display: vendor_# vendor_name manufacturer_# manufacturer_name.
Thanks,
09-16-2008 10:36 AM
even if I understand your need, having twice the same field in a view makes no sense in a technical point of view ...
you could do it with some abap code but not in a dictionary view
09-16-2008 10:36 AM
even if I understand your need, having twice the same field in a view makes no sense in a technical point of view ...
you could do it with some abap code but not in a dictionary view
09-16-2008 10:40 AM
09-16-2008 11:55 AM
09-16-2008 5:19 PM
Thanks for your help. In the end I will code it as you say. It will simplify things.
It is interesting though that views cannot be joined/nested.
09-17-2008 11:22 AM
In real SQL you can, as you say, create a database view by joining a table to itself, but this requires the use of aliases and so cannot be done in SE11. I did once try to bypass this by creating a single table view based on the table in SE11 so that I would have a different name for the table and then trying to create a view joining that view and the table (in real SQL you can base a view on a view), but it wouldn't allow me to do this either.