How to Create Append Structure in SAP ABAP

Are you aware of Append Structure in SAP ABAP? This is the right platform to check what is append structure and how to create an Append structure in SAP ABAP.

Also, Read: How to Logon to SAP System

Append Structure in SAP ABAP

SAP ABAP Append structure is a structure that is attached to another structure in the database table.

It can be assigned to one table or structure. Below are the things we can do in the append structure.

  1. We can include new components.
  2. We can define foreign keys.

Example:

For example, there is a table called ZCOMP_EMPLOYER and this table has some columns like:

  • MANDT
  • EMID
  • EMNAME EMPHN
  • EMCON

Now I would like to append two more columns to this table i.e. ZEMADR and ZEMDOJ as shown below.

How to Create Append Structure in SAP ABAP

Once the Database table or structure is activated, we can see the added columns in the output table.

Points to Remember while using SAP ABAP Append structure:

The appended structure can be used only for transparent tables (one-to-one relation tables).
The same structure can be appended to different database tables or structures by including it in the individual append structures as an included structure.

Check out: How to Create a Foreign Key in SAP ABAP

How to Create Append Structure in SAP ABAP

Let’s see how to create an append structure in SAP ABAP. Follow the steps below to do so.

Step-1:

Open SAP ABAP and type SE11 Tcode in the search bar and enter.

How to create Append structure in SAP ABAP

Step-2:

In the ABAP Initial Screen page, provide the details below:

  1. Database table = Provide the database table name as “ZCOMP_EMPLOYER“.

Click on the Display button.

Append Structure in SAP ABAP

Step-3:

In this step, our existing table with fields will appear.

Click on Goto -> Append Structure… at the top of the page.

Create Append Structure in SAP ABAP

Step-4:

In this step, give the Append Name starting with Z and click the tickmark.

Append in SAP ABAP

Step-5:

Save the Append structure in the Local Object to do the further steps.

Append Structure in Local Object

Step-6:

On this Display Append Structure page,

  1. Give the Short Description then type the field name you want to add under the component and component type.
  2. Typing methods will be chosen as Types.
Append Structure in SAP ABAP

Step-7:

Double-click on the field ZEMADR( Address field) to create data element and domain creation by the usual method of table creation.

Step-8:

Choose the Data element from the list of options and click the tickmark at the end.

Append in ABAP Program

Step-9:

On this, page

  1. Give the Short Description (Employer Address)
  2. Domain as the same name as the Data element.
  3. Then Double-click on the Domain name to do further.
Append structure in ABAP

Step-10:

On the Domain Creation page,

  1. Give a Short Description like Domain for address
  2. Data Type as CHAR.
  3. No. characters, and the Output length as 50.
How to Create Append Structure in SAP ABAP

Step-11:

Save by clicking CTRL+S and activate by clicking the F3 key to add the next column in the append structure.

This is the method to create an append structure in SAP ABAP for one column.

Read also: How to Create a Foreign Key in SAP ABAP

Add Next Column in Append Structure

We will see how to add the Employer’s Date of joining in the column to append the structure in the SAP ABAP.

Step-1:

  • Type the column name under the component.
  • Types under Typing method, and under component type same as a component.
  • Double-click on ZEMDOJ under the component type to proceed further.
How to append Structure in SAP ABAP

Step-2:

  • Choose the Data element and click the tickmark.
Append Structure in DOJ Field

Step-3:

  • Now, Save it in the Local Object to proceed with the forthcoming steps.
Append Structure in Local Object

Step-5:

  • Double-click on the ZEMDOJ to create the data element and data domain. It will ask to Create the Type, click Yes.
DOJ details in SAP ABAP

Step-6:

  • Give a Short Description name and Domain name same as the Data element.
Data in DOJ Append Structure

Step-7:

  • Now Double-click on the domain to declare the datatype to append the structure in SAP ABAP. It will ask for Save, click Yes.
Append Structure in SAP ABAP

Step-8:

  • Give the Short Description and declare the Data Type as DATS (Data Data type).
Create Append Structure in SAP ABAP

Step-9:

  • Save the append structure by CTRL+S and activate it by clicking the F3 button.
Activate Append structure

Step-10:

  • On the Change Append Structure page and save the fields and activate by clicking the F3 key or clicking the activate icon at the top.
Activate Append Structure in SAP ABAP

Step-11:

  • In this step, we will see the output for the append structure in SAP ABAP. On the page of the Display table,
  1. Click Utilities -> Table contents -> Display.
Output in Append structure

Step-12:

  • In this step, we can see the added column in the output page of the append structure in SAP ABAP.
Output for Append Structure

You may also like:

Conclusion

This tutorial explains enough information about the append structure in SAP ABAP. The main concept of the append structure is to add the wanted columns based on the requirements of the clients. Hope this information is useful to you.