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

append structure !

Former Member
0 Likes
2,673

hi..!

iam having doubt about Append structure ?

for a standard table we will add fields using Append Structure .

similarly Can we add a Structure using append Structure

rather than a single field.

(i created a structure in data dict. with five fields,

can i add my struct. to a standard database table..!)

or we can add only single fields to a standard table.

can any one clarify my doubt.!

Thanks & Regards,

Rajesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,802

Hi Rajesh,

The rule about APPEND STRUCTURE is that the structure appended cannot exist independant of the table nor can it be appended to another table or structure.

You cannot create a structure and then append it to a table. SAP will not allow it. You need to use the APPEND STRUCTURE funtionality to create a structure that is appended to a table.

You have 2 choices.

1) Use the include structure functionality to include your existing structure to the table.

OR

2) Create a structure similar to the stucture you created before but this time do it using the APPEND STRUCTURE functionality.

Regards,

Mark

5 REPLIES 5
Read only

Former Member
0 Likes
1,803

Hi Rajesh,

The rule about APPEND STRUCTURE is that the structure appended cannot exist independant of the table nor can it be appended to another table or structure.

You cannot create a structure and then append it to a table. SAP will not allow it. You need to use the APPEND STRUCTURE funtionality to create a structure that is appended to a table.

You have 2 choices.

1) Use the include structure functionality to include your existing structure to the table.

OR

2) Create a structure similar to the stucture you created before but this time do it using the APPEND STRUCTURE functionality.

Regards,

Mark

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,802

Hello Rajesh

An APPEND has a 1:1 relation to its DB table to which it is appended.

Within this APPEND you can add either single fields or include other structure which is the way I prefer.

Why?

When you have just an APPEND structure and you want to add a new field you need to touch the APPEND again.

If you have included a z-structure into the APPEND structure then you only change this z-structure and there is not need to touch the APPEND structure again.

Anothe advantage of using structures is to group common fields together.

Example:

- Your APPEND includes a z-structure ZADDRESS containing address related fields

- Your APPEND includes a second z-structure ZSALESAREA containing sales area related fields

Using include structure you can give these includes a GROUP name (rightmost column in SE11), e.g. ADDRESS for structure ZADDRESS and SALESAREA for structure ZSALESAREA. This way you can address these fields specifically, e.g.:

DATA: ls_data    TYPE <name of DB table with APPEND; APPEND contains 2 include structures>

 ls_data-address = ...   " structure with address fields only
 ls_data-salesarea = ... " structure with sales area related fields only

Regards

Uwe

Read only

Former Member
0 Likes
1,802

hi Rajesh,

you can add additional fields to table by using

1)include structure

2)append structure

Include Structure:you can include any no of fields using include structure and you can include this structure in any no of fields.but if you want to use include for sap tables they have to provide include.check table MARA.we have an include EMARA.so if you insert any field in EMARA it is added to the field

Append Structure:You can include any no of fields using append structure.but append structure is only for one table.you can use the structure for only one table.mara is also have some append structures.check by clicking on append structures which is in application toolbar

Read only

Former Member
0 Likes
1,802

Hi,

Go to change mode in the maintenance screen of the table where you want to add the append structure.

If the table contains a long field (data type VARC, LCHR or LRAW), you cannot add an append structure.

Choose Goto ® Append structures.

Either a dialog box appears in which you can enter the name of the append structure or a list of all the append structures. that were already created for the table appears. If append structures already exist, you have to choose to get the dialog box for entering the name.

Enter the append structure name and choose . The name must lie in the customer namespace.

You go to the field maintenance screen of the append structure.

Define the fields of the append structure. You can proceed as when creating a normal structure with two restrictions (see Creating Structures).

The fields of an append structure must lie in the customer namespace, that is the field names must begin with ZZ or YY. This prevents conflicts with fields inserted in the table by SAP.

An append structure must be flat, that is each field of the append structure must either refer to a data element or be directly assigned a data type, length, decimal places and short text.

If you want to create foreign keys or search help attachments for table fields that already exist, you can display these fields with Show appending objects. Proceed as if you wanted to create the foreign key or search help attachment in the underlying table (see Creating Tables).

If a foreign key or search help attachment is already defined for a field in the table, you cannot change this definition with the append structure.

Choose .

Result

The table will also be activated when the append structure is activated. The fields of the append structure are appended to the table in the database. Foreign keys or search help attachments for the fields that are already in the table and that were defined with the append structure are also activated.

You can display information about the activation process with Utilities ® Activation log. Errors occurring when the append structure is activated are displayed directly in the activation log.

Pls. reward if useful....

Read only

Former Member
0 Likes
1,802

yes you can add a stucture using an append structure , using an include statement,

the only condition is that the append structure as well as the including structure should follow the naming conventions of append structure, so that during upgrade you donot lose your development

Award points if helpful