Application Development 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: 

how to add fields to a database table.

Former Member
0 Kudos

how to add fields to a database table.

7 REPLIES 7

Former Member
0 Kudos

If u want to add standard table, then u need to get access key for that.

Use SE11 to add fields to database table.

Former Member
0 Kudos

Hi,

You have 2 options to include the Fields 1) Append Structure 2) Include structure

<b>Append Structure</b>:- An append structure is a structure assigned to just one table. When a table is activated, all append structures for the table are found and appended to the table. Append structures are used to add customer fields to SAP tables.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm

<b>Include Structure</b>:- Include structures are used to add fields in the middle also.where as append structures adds fields only at the end.In addition to listing the individual fields, you can also include the fields of another structure in tables and structures. Individual fields and includes can be mixed as required.

Regards

Sudheer

Former Member
0 Kudos

Hi Sripathy,

There are two ways to add field to the DB Table. They are

INCLUDE

and

APPEND

structure.

Check this ..

Append Structures :

Append structures are used for enhancements that are not included in the standard. This includes special developments, country versions and adding customer fields to any tables or structures.

An append structure is a structure that is assigned to exactly one table or structure. There can be more than one append structure for a table or structure.

The following enhancements can be made to a table or structure TAB with an append structure:

Insert new fields in TAB,

Define foreign keys for fields of TAB that already exist,

Attach search helps to fields of TAB that already exist,

These enhancements are part of the append structure, i.e. they must always be changed and transported with the append structure.

When a table or structure is activated, all the append structures of the table are searched and the fields of these append structures are added to the table or structure. Foreign keys and search help attachments added using the append structure are also added to the table. If an append structure is created or changed, the table or structure assigned to it is also adjusted to these changes when the append structure is activated.

Since the order of the fields in the ABAP Dictionary can differ from the order of the fields on the database, adding append structures or inserting fields in such append structures does not result in a table conversion.

The customer creates append structures in the customer namespace. The append structure is thus protected against overwriting during an upgrade. The fields in the append structure should also reside in the customer namespace, that is the field names should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP.

Include Structure:

In addition to listing the individual fields, you can also include the fields of another structure in tables and structures. Individual fields and includes can be mixed as required.

When an include is changed, all the tables and structures that include it are automatically adjusted.

Structure A was included in table B. A new field is inserted in structure A. When structure A is activated, table B is adjusted to this change, that is the new field is also inserted there.

You can assign the include a group name with which the group of fields in the include can be addressed as a whole in ABAP programs.

Includes can also be nested, that is structure A includes structure B which in turn includes another structure C, etc. The maximum nesting depth is limited to nine. The maximum length of a path of nested includes in a table or structure is therefore nine (the table/structure itself not included).

Only flat structures can be included. In a flat structure, every field either refers to a data element or is directly assigned a data type, length and possibly decimal places.

Only structures may be included in a table. Tables, structures and views may be included in a structure.

The length of the field names is more restricted in tables than in structures. In a table, a field name may not have more than 16 places, but in a structure up to 30 places are allowed for the field name. A structure therefore can only be included in a table if none of the field names of the structure are longer than 16 places.

The path of nested includes may only contain one table.

Table TAB1 includes structure STRUCT1, which in turn includes structure STRUCT2. The path of the nested includes here only contains table TAB1. It is also possible to include TAB1 in a further structure STRUCT0,

but no other table TAB2 may be included in TAB1 since in this case a path of nested includes would contain two tables (TAB1 and TAB2).

The fields of the include are added to the table in the database. If you inserted the fields of the include as key fields, the primary index of the table is built again.

You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. The activation log is displayed immediately if errors occur when the table is activated.

Check these links

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ea6a446011d189700000e8322d00/frameset.htm

Hope this resolves your query.

Reward all the helpful answers.

Regards

Former Member
0 Kudos

Hi

You can not direct add field in data base table. u need to have Access key for that.

or you can copy standard table to Ztable then add fields.

Thanks

sasmita

Former Member
0 Kudos

hi sripathi,

just follow this to add structure to the database table,

go to the se11 ->,

provide the table name ->,

go for display ->,

select GOTO option at the menu ->,

select Append structure ->,

provide the Append name ->,

Enter ->,

provide stort text and fields to the structure ->,

then save and activate,

now check the table, now u can see the table with new structure at the last.

regards..

seshu.

Former Member
0 Kudos

For Custom tables you can add fields to the database tables.

Go to SE11 enter table name and press change button

If table contaons no data add new field name etc

For Stadard tables:

You copy the stanndard table like ZTBALE and then try to add your own fields.

Hope it hepls you.

Reward points if helpful.

Regds,

Rama chary.Pammi

Former Member
0 Kudos

jus goto se11 and enter the name of the table in which you want to enter the fields,

enter the fields and if any error occurs just goto UTILITIES-> ACTIVATE DATABASE.....

Also see the links,

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm

Regards,

Pavan P.