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.
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.
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.
Step-2:
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.
Step-3:
In this step, our existing table with fields will appear.
Click on Goto -> Append Structure… at the top of the page.
Step-4:
In this step, give the Append Name starting with Z and click the tickmark.
Step-5:
Save the Append structure in the Local Object to do the further steps.
Step-6:
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.
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.
Step-9:
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.
Step-10:
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.
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.
Step-2:
- Choose the Data element and click the tickmark.
Step-3:
- Now, Save it in the Local Object to proceed with the forthcoming steps.
Step-5:
- Double-click on the ZEMDOJ to create the data element and data domain. It will ask to Create the Type, click Yes.
Step-6:
- Give a Short Description name and Domain name same as the Data element.
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.
Step-8:
- Give the Short Description and declare the Data Type as DATS (Data Data type).
Step-9:
- Save the append structure by CTRL+S and activate it by clicking the F3 button.
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.
Step-11:
- 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.
Step-12:
- 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
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.
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