Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to create Primary key

Former Member
0 Likes
3,314

how to create Primary key for tables

could u plz explain clearly step by step with screen shots and comments

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
1,785

HI,

During the creation of table in Transaction SE11 when you entered a field name and field type there is a check box field 'KEY' if you checked it, this field will also be key field.

REgards,

how to create Primary key for tables

could u plz explain clearly step by step with screen shots and comments

6 REPLIES 6
Read only

dani_mn
Active Contributor
0 Likes
1,786

HI,

During the creation of table in Transaction SE11 when you entered a field name and field type there is a check box field 'KEY' if you checked it, this field will also be key field.

REgards,

Read only

Former Member
0 Likes
1,785

Hi,

While creating the fields for the table in SE11, u need to check the option "Key".

Regards

Kannaiah

Read only

Former Member
0 Likes
1,785

Hi

When you are creating Ztable,when you have to create fields,

Say EMP table and Empno,so EMPNO cant have same values ,it will be unique.

for that EMPNO you make it primary key jusy by clicking next check button.

When creating table..go to se11 and create domain-dataelement and fields..

or you can create direct method inside se11.

Just search for Table creation in sdn,you will find so many.

Thanks

Read only

Former Member
0 Likes
1,785

1. Begin at the Dictionary: Initial Screen (To get there from the SAP main menu, use the menu path Tools->ABAP/4 Workbench, Development->ABAP/4 Dictionary).

2. Type the table name (zxyz) in the Object Name field.

3. Choose the Tables radio button.

4. Press the Change pushbutton. This takes you to the Dictionary: Table/Structure: Change Fields screen.

5. Press the New Fields pushbutton. Blank lines appear at the bottom of the screen, and the existing table fields are scrolled upward.

6. In the Field Name column, enter the name of the field you wish to add.

<b>7. Tickmark the Key column if it forms part of the primary key. (eg.The -regio and -land1 fields in LFA1 do not, but this procedure is written generically so that it can be used in general situations.)</b>

8. Enter the name of the associated data elements in the Data Elem. column.

9. Press the Enter key.

10. Look at the status bar. You should see the message "Data element is not active," because the data element does not exist.

11. Double-click on the data element name. The Create Data Element dialog box will be displayed. In the Data Element field will be the name of the data element to be created. This will of course be the data element you wish to create, so unless it is misspelled, do not change it here.

12. Press the Continue button. The Dictionary: Change Data Element screen appears.

13. Enter short text for the data element.

14. Enter a domain name.

15. Double-click on the domain name to create it. The Create Domain dialog box will be displayed. In the Domain Name field will be the name of the domain to be created. This will of course be the domain you wish to create, so unless it is misspelled, do not change it here.

16. Press the Continue button. The Dictionary: Maintain Domain screen is displayed.

17. Fill in the Short Text, Data Type, and Field Length fields.

18. Press the Activate button on the Application toolbar.

19. Press the Local Object button. You are returned to the Dictionary: Maintain Domain screen. The value in the Status field changes to Act. and the message "was activated" appears in the status bar.

20. Press the Back button on the Standard toolbar to return to the Dictionary: Change Data Element screen.

21. Enter the remaining fields for the data element (

22. Press the Activate button on the Application toolbar. You will then see the Create Object Catalog Entry screen.

23. Press the Local Object button. You are returned to the Dictionary: Change Data Element screen. The value in the Status field changes to Act. and the message "was activated" appears in the status bar.

24. Press the Back button on the Standard toolbar. You are returned to the Dictionary: Table/Structure: Change Fields screen. There should be no messages in the status bar.

25. Repeat steps 5 through 23 for each new data element you want to create.

26. After you have created all domains and data elements, press the Activate button on the Application toolbar. If the activation was successful, the message "was activated" appears in the status bar and the Status field contains the value Act.

27. Press the Back button to return to the Dictionary: Initial Screen.

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,785

Hi

At the time of table creation there is check box for Primary keys.

Check that box for fields which you want to make them as key fields.

Regards,

kumar

Read only

Former Member
0 Likes
1,785

thanks a lot