2008 Mar 06 3:56 AM
Hi all,
I have just created a database view in SE11 between 2 tables, but when I test it, the veiw is empty. I found out that in the Maint. Status tab, there's a warning saying that "You can only read database views with more than one table". What is my problem here? Both my tables are having lots of data. Please help.
2008 Mar 06 4:41 AM
Hi,
VIEWS:
-
View is a data dictionary object.
It exists logically inside the data dictionary.
It is used to fetch datas from more than one database table.
In views, we specify the tables and SAP will automatically generate a join condition code in the background.
Navigations to create a view:
-
SE11 -> Select 'VIEW' radiobutton -> Specify view name starting with Z or Y
-> Create -> Select as 'DATABASE VIEW' -> Click on Copy -> Enter short description
-> Specify name of the tables from which you want to fetch records
-> Click on Relationships pushbutton -> Opens an interface
-> Select the condition based on primary key relationship -> Click on Copy
-> A join condition is created -> Click on 'View Fields' tab button
-> Click on Table fields pushbutton -> Opens an interface with specified table names
-> Click on first table -> Click on Choose -> Select required fields -> Click on Copy
-> Do the same thing for choosing fields from second table -> Save -> Activate
-> Discard the warning message.
To implement the view created, use SE38 editor and write the following code:
TABLES ZMYVIEW1.
SELECT * FROM ZMYVIEW1.
WRITE 😕 ZMYVIEW1-MATNR, ZMYVIEW1-MTART, ZMYVIEW1-MBRSH, ZMYVIEW1-MEINS,
ZMYVIEW1-WERKS, ZMYVIEW1-LVORM, ZMYVIEW1-MMSTA.
ENDSELECT.
Save -> Activate -> Execute.
In the above code, TABLES statement is used to create a temporary table space area
to hold the records of view.
Regards,
Priya.