‎2015 Mar 12 10:06 AM
Hi All,
can i assign primary key field to database table from included structure ?
‎2015 Mar 12 2:14 PM
Hello Abdulkadir
I think this is not possible. You can select the included structure as primary key, but then all fields of that structure are marked as primary keys
Maybe create a seperate structure to include just with the field you want as primary key?
Hope this helps.
Kind regards
Thomas
‎2015 Mar 12 11:11 AM
Hi Abdulkadir,
I hope it is not possible to assign the field of include structure as Primary key field.
Regards,
Vinodkumar.
‎2015 Mar 12 11:23 AM
‎2015 Mar 12 1:59 PM
‎2015 Mar 12 2:18 PM
‎2015 Mar 12 2:14 PM
Hello Abdulkadir
I think this is not possible. You can select the included structure as primary key, but then all fields of that structure are marked as primary keys
Maybe create a seperate structure to include just with the field you want as primary key?
Hope this helps.
Kind regards
Thomas
‎2015 Mar 12 2:17 PM
Hello Thomas,
Yes your advice is my best alternative solution.
Thanks.
‎2015 Mar 12 2:20 PM
‎2015 Mar 12 3:08 PM
I am new at SAP systems therefore i want to consult to experts. I 'll develope an application (Db + Web Service). I wanted to design my dictionary objects in best and short style, generate all objects from structure (all objects= Db Tables, web services inputs/outputs, codebehind declarations ...). But Db Primary key attribute block it.
Which way is better?
Then, there is no benefit to declare structure if I can't assign primary key field to table from included structure.
i 'll create table without create/.include structure and use type of the table at codebehind declarations, web service inputs/outputs. (please look at followings images)
I mean;
> ztUser(Table) > Data: gv_user type ztUser.
and there is no requirement create table from structure .
> zsUser(Structure) > ztUser(Table .included zsUser) > Data: xx type ztUser
‎2015 Mar 12 3:19 PM
The benefit of include structures is there re-usability. Your ZDEN_SDATASTATUS is a good example. SAP creates structures for key fields, inserts them at the beginning of tables and sets the structure as the key field. They can then add more keys in subsequent fields.
Generally, we don't use structures for keys, but use them for non-key fields in multiple tables.
Rob