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.
- We can include new components.
- We can define foreign keys.
For example, there is a table called ZCOMP_EMPLOYER and this table has some columns like:
- EMNAME EMPHN
Now I would like to append two more columns to this table i.e. ZEMADR and ZEMDOJ as shown below.
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.
Open SAP ABAP and type SE11 Tcode in the search bar and enter.
In the ABAP Initial Screen page, provide the details below:
- Database table = Provide the database table name as “ZCOMP_EMPLOYER“.
Click on the Display button.
In this step, our existing table with fields will appear.
Click on Goto -> Append Structure… at the top of the page.
In this step, give the Append Name starting with Z and click the tickmark.
Save the Append structure in the Local Object to do the further steps.
On this Display Append Structure page,
- Give the Short Description then type the field name you want to add under the component and component type.
- Typing methods will be chosen as Types.
Double-click on the field ZEMADR( Address field) to create data element and domain creation by the usual method of table creation.
Choose the Data element from the list of options and click the tickmark at the end.
On this, page
- Give the Short Description (Employer Address)
- Domain as the same name as the Data element.
- Then Double-click on the Domain name to do further.
On the Domain Creation page,
- Give a Short Description like Domain for address
- Data Type as CHAR.
- No. characters, and the Output length as 50.
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.
- 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.
- Choose the Data element and click the tickmark.
- Now, Save it in the Local Object to proceed with the forthcoming steps.
- Double-click on the ZEMDOJ to create the data element and data domain. It will ask to Create the Type, click Yes.
- Give a Short Description name and Domain name same as the Data element.
- Now Double-click on the domain to declare the datatype to append the structure in SAP ABAP. It will ask for Save, click Yes.
- Give the Short Description and declare the Data Type as DATS (Data Data type).
- Save the append structure by CTRL+S and activate it by clicking the F3 button.
- 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.
- In this step, we will see the output for the append structure in SAP ABAP. On the page of the Display table,
- Click Utilities -> Table contents -> Display.
- In this step, we can see the added column in the output page of the append structure in SAP ABAP.
You may also like:
- How to Create Table in SAP ABAP [With Columns]
- How to Create Module Pool Program in SAP?
- How to Create Table Maintenance Generator in SAP ABAP
- How to Use Select Statement in SAP HANA Cloud
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.
I am Chris Waldron, working as a Senior SAP HANA Consultant at Halliburton, Houston, Texas, United States. I have been working in SAP for more than 15 years, especially in SAP IT consulting and business consulting. I worked in various industries in Sales & Distribution, Customer Relationship Management, banking, Risk Management, etc. And I am an SAP Certified Development Specialist – ABAP for SAP HANA 2.0 and SAP HANA Modeling Certified consultant. Read more