09-27-2006 9:01 AM
Hi friendz,
can u give me procedure to create a data base view and after creating how to write select statements to slect data from a view.
regards,
siri,
09-27-2006 9:07 AM
Hi Sireesha,
example.
i have created a view zview,in it i have 5 fields
matnr,mtart,werks,dispo,dismm,
now my select query is
select matnr mtart werks dispo dismm from zview
into table it_view.
regards,
nagaraj
09-27-2006 9:04 AM
Hi
To create View: trx SE11
- Choose View option;
- Insert the name Z<VIEW>
- Choose the type View
- Insert the tables of the view a the join condition
- Insert the fields you need in the views from the tables of the join
The select is the same:
SELECT * FROM Z<VIEW> WHERE ......
Max
09-27-2006 9:05 AM
Hi,
You can create views through TCode - se11. Giv some some name and click on create. It will prompt you to select the type of view you need to create. Select any one from the popup window and proceed. Click on the below link for more details in creating views.
<a href="http://help.sap.com/saphelp_47x200/helpdata/EN/4c/81c1351181b73fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/EN/4c/81c1351181b73fe10000009b38f839/frameset.htm</a>
<a href="http://help.sap.com/saphelp_46c/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm">http://help.sap.com/saphelp_46c/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm</a>
And to select the data from the view it's same as selecting from the table...
Cheers,
Simha.
Note: Some points could be fine..
09-27-2006 9:07 AM
Hi Sireesha,
example.
i have created a view zview,in it i have 5 fields
matnr,mtart,werks,dispo,dismm,
now my select query is
select matnr mtart werks dispo dismm from zview
into table it_view.
regards,
nagaraj
09-27-2006 9:07 AM
09-27-2006 9:08 AM
Hi,
GOTO SE11, in the view tab, give a view name(Zview), Create, select DB view Radiobutton, enter short description, give the Check table name and the dependent table names on the left hand side view, Click on Establish Relationship button, select the checkboxes the relationships are automatically generated,click on the viewfield button in tabstrip, give the view fields and the corresponding table fields, if you want any specific condition enter in the conditions tab, activate the view and in the program use the normal select query instead of table name give view name.
Regards:-
Santosh.D