2008 Jul 04 9:48 AM
Hi All,
I want to create a view on two tables and check the Key option for all the fields in the view.
I found in the system that only the fields in the table with Key selection are automatically reflecting the key selection in the view.
I also want Non key fields in the table to be key fields in the view. In our system there are similar views.
Is it possible?
it is very very urgent
Hi All,
I want to create a view on two tables and check the Key option for all the fields in the view.
I found in the system that only the fields in the table with Key selection are automatically reflecting the key selection in the view.
I also want Non key fields in the table to be key fields in the view. In our system there are similar views.
Is it possible?
it is very very urgent
2008 Jul 04 9:51 AM
Hi Prem,
I think it's not possible...View is nothing but the combination of two or more tables provided a foreign key relationship between two tables.
You can't make the non key fields from the table as key fields in the view.
Thanks,
Ponraj.s.
2008 Jul 04 10:00 AM
Hi,
I also find the same in the system.
But there are some views already created with non key fields in the table as key fields in the view.
2008 Jul 04 10:11 AM
Hi,
The key for a view is determined automatically by SAP. We can not change the key. Please read below the F1 help content given by SAP ::
Flag if field belongs to key
This indicator shows whether the view field belongs to the key of the view.
The system automatically derives the key of a view from the key fields of the tables involved in the view and the join conditions.
The key is defined so that it satisfies the following requirements:
1. All the key fields must be stored together at the beginning. Fields that do not actually belong to the key but which lie between the key fields are also marked as key fields.
2. All the data records of the view are already unique in the key. If no key can be defined with this attribute, all the fields of the view are marked as key fields.
The key of a view has an effect when accessing the view data with OPEN SQL in ABAP programs. The key plays a direct role for example for SELECT SINGLE and for the supplement ORDER BY PRIMARY KEY, but it also plays an indirect role internally when compressing data with SELECT ... FOR ALL ENTRIES.
Hope this would be of some help!!!
Regards,
Lalit Kabra
2008 Jul 04 10:16 AM