0% found this document useful (0 votes)
38 views22 pages

Education Presentation ABAP Week-10

The document outlines key techniques for mastering SAP ABAP database table maintenance, including copying, deleting, and modifying tables and structures. It details the integration of the ABAP Data Dictionary with the ABAP Workbench and provides transaction codes for various operations. Additionally, it explains the creation and use of structures and append structures for enhancing database tables without altering their original structure.

Uploaded by

praveengkumarer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views22 pages

Education Presentation ABAP Week-10

The document outlines key techniques for mastering SAP ABAP database table maintenance, including copying, deleting, and modifying tables and structures. It details the integration of the ABAP Data Dictionary with the ABAP Workbench and provides transaction codes for various operations. Additionally, it explains the creation and use of structures and append structures for enhancing database tables without altering their original structure.

Uploaded by

praveengkumarer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

SAP ABAP Training

By: Hamad Ahmad


SAP ABAP Trainer
Table of Contents for 10th Week
Important Key Techniques To Master SAP Database Table
Maintenance
Su Making a Copy of a Table
01

Su Delete Customized Table


02

Su Adding or Deleting Fields -Database Utility


03

Su Create Structures
04

Su Include Structures
05

Su Append Structure
06
ABAP DICTIONARY

Integration to ABAP Workbench:


Integration to ABAP Workbench -
ABAP Data dictionary completely integrated to ABAP workbench. ABAP
system allows the Data dictionary to be integrated actively with
development environment.

Diagram shows the integration to ABAP/4 workbench -

Objects may have both active and inactive components at the same time
in ABAP dictionary. Objects of ABAP dictionary changed any number of
times before activating and available to the all components of the system.
Inactive objects have no impact on the system and uses for modifications.

Related Transactions -

SE11 - Data Dictionary Initial Screen


SE12 - Data Dictionary Initial Screen Display only
SE13 - ABAP Dictionary Technical Settings
SE14 - Database Utility
SE15 - Repository Information System
SE16 - Data Browser
SE17 - General table Display
SE55 - Table View Maintenance
SM30 - Table Maintenance
COPY TABLE
Making a Copy of a Table
Transaction code is SE11 for ABAP Dictionary.

It is important to realize that whenever one wants to change a


database table, there is a risk of losing data, especially where
key fields in the table are being affected. The database
system itself will try to determine whether adjustments can
be made by deleting and creating new items which change
the underlying database catalogue, or whether what has
already defined has to be re-implemented.

Note: When you copy a database table, it is only the


structure itself which is copied, meaning only its properties –
fields and so on, not the actual data.

Step back to the initial SE11 screen. With ZABAP_M in the


Database table field, click the Copy button, then give the new
table of ZABAP_M_COPY. The ‘Create Object Directory Entry’
box will appear and as before, set package and TR.
DELETING TABLE
Deleting Table
Transaction code is SE11 for ABAP Dictionary.

One will not often have to delete an entire database table, for
largely the same reasons as were outlined above for fields. If
this does have to be done it is important to remember that
one’s own customer-specific tables are the only ones which
can be deleted, SAP delivered tables cannot be deleted.
Because ZABAP_M has only just been created, and nothing
else depends on this table, it can be deleted without
consequences.

To check whether a table can be deleted without causing


unintended consequences elsewhere in the system, return to
the ABAP Dictionary’s initial screen. Because the original
ZABAP_M table was used in the programs which have been
created, use this as a test.

Insert this into the Database table field on the screen and
then click the ‘Where-used list’ icon from the toolbar.
Database Utility
Database Utility
Transaction code is SE14 Utilities for Dictionary Tables.

You could use SE14 for database utility OR you could go to SE11,
give your database table name, go inside SE11 and then Utility-
>Database Object->Database Utility.

The database utility is a tool to provide the interface between the


ABAP Dictionary and the underlying database management system
(DBMS).

Uses:

a) Convert Data (I.e. change field lengths and data types etc)
b) Activate Objects
c) Create/Delete/Change of tables and indexes

Approach:

Go to Transaction SE14The Initial screen of database utility is


displayed. Enter Name of either table/view/Match code/Pool/Cluster
tables
Database Utility
Database Utility
Transaction code is SE14 Utilities for Dictionary Tables.

This is used for the following reasons:

1) When you have changed some database definition. For example you
have created a Database table with 4 fields and maintained data. But
later on you decide you need to add some more fields. In that case,
you add the fields in data base and then "Activate and adjust" with
'Save data“

2) Similarly, you want to delete the data after adjustment of database,


then "Activate and adjust" and "delete data".

Processing Type:

The DB Utility can be run either online or in the background.


A) Direct: the create/delete/modify operations of the object will be
performed in foreground.
B) Background: the create/delete/modify operations of the object will be
performed in background
C) Enter for Mass processing: If you want to modify large no of objects,
choose this option.
If you run DB Utility, a log file gets created which contains information on
whether or not the conversion was successful and the point of failure
during the conversion if it was not successful.
CREATING STRUCTURE

What is Structure?
Structure is a group of components defined under a name. A
component is a field that can be an elementary type or another
structure or table.

The group of components defined under structure can be of any


data type that are stored one after the other in the memory in the
same order how they defined. Structure can be nested to any
depth.

Structures are two types based on how they have used and those
are -

Local Structures - Structures created in the ABAP programs that


are local to the program.

Global Structures - Structures created in ABAP dictionary that are


globally available to all the programs.

Structured are three types based on how they created and those
are -

Flat Structure : Defines with only elementary types.


Nested Structure : Defines with elementary types along with
another structure.
Deep Structure : Defines with table type along with
elementary types.
APPEND STRUCTURE

APPEND STRUCTURE
These can be used to add additional fields. This is the preferred
CLICK HERE
method for maintaining SAP delivered tables and quite often for
customer-specific tables. If one does not use Append structures,
problems can arise if, for example, a new version of SAP is used
which does not correspond with aspects of the tables already
created, resulting in serious errors.

Append structures give a safe way to enhance tables. When these


are used, the initial table remains unchanged, removing any risk of
changes being overwritten later if a different version of SAP is used.
Quite often, a table may have multiple Append structures applied
to it, because different development needs have arisen as time has
gone by and people have wanted to add further fields to the
standard SAP tables.

In the SE11 Maintain Table screen, go to the ‘Append structure’


button on the right of the top toolbar:

This is a very useful way to add new fields to a table without


affecting the structure of the table itself. If one then browses the
data as normal, a new column will have been called NEW FIELDS.
Data can then be entered into this field just like it can for any other.
APPEND
STRUCTUR
E

Enter
Structure Name

Append Structure

Please Follow the Step for appending


a Structure .
APPPEND
STRUCTUR
E
ENTER SHORT
DESCRIPTION

Append Structure

Please Follow the Step for appending


a Structure .
APPEND
STRUCTUR
E

APPEND STRUCTURE

Please Follow the Step for Append


Structure .
CREATING STRUCTURE

Initial Screen of ABAP Dictionary


Once its open you can create a new Data type or you can
check also already structure.

It is preferable that you write the structure name with Z or Y.


This shows that it’s your customized structure. Enter structure
Name Z----
Once you write structure name in the data type, click create
button for further proceedings. It opens Create Type dialog
box Select Structure radio button and click
on Continue button.
Click Here

NOTE: Structures are useful for painting screen fields, and for
manipulating data that has a consistent format defined by a
discrete number of fields. A structure may have only a
single record at run-time, but a table can have many
records.
CREATING STRUCTURE

STRUCTURE SCREEN
It opens Dictionary: Change Structure screen.

Enter the description and component name and select the


component type from the component type list.

Press (Ctrl + S) or "Save" icon to save the Structure. System


asks for the package. Enter existing package if any, or create
new package.

Once the structure saved successfully, the "ZSTRUC"


message displayed on status bar.

Click on "Activate" icon or "Ctrl +F3" to activate structure. If


the structure activated successfully, the “Active Object
generated" message displayed on status bar like below.
INCLUDE STRUCTURE

INCLUDE STRUCTURE
Include structures are similar to Append structures, with the main
difference being that they are re-usable objects and can be
linked to many other tables, ABAP programs, dialogue programs
and structures. It is important to keep in mind that Include
structures must be flat structures, meaning that they cannot hold
any additional structure within them, and that the maximum length
of the fields within an include structure is 16 characters.

There is no Include structure button in the way that there is an


Append structure button. To create one, first ensure Change mode
is selected. Where the cursor is placed is important here, as
wherever the cursor is when the Include structure is created, it will
be created one row above. If you want the Include structure to be
part of the table key, it must appear at the top, because all table
fields used as a table key need to be grouped together at the top.
In this instance though, it will just be inserted above the Append
structure. Place the cursor on the ‘.APPEND’ row, select the ‘Edit’
menu, then ‘Include’ and ‘Insert’.
INCLUDE
STRUCTUR
E

Enter
Structure Name

Including Structure

Please Follow the Step for Including


Structure .
INCLUDE
STRUCTUR
E

Structure
included

INCLUDE STRUCTURE :

Activate the table now, and view the


contents. The New Columns should
now be visible, and these records can
now be edited and created like any
other.
INCLUDE STRUCTURE

Include Structure in ITAB Include Structure in ITAB


Define Internal Table Including Multiple Structures can be Define Internal Table Including Multiple Structures and modify
declared using DATA: BEGIN OF and END OF keywords. extra fields in internal table can be declared using DATA:
BEGIN OF and END OF keywords.
-------------------------------------------------- --------------------------------------------------
data: begin of itab occurs 0. data: begin of itab occurs 0.
data:
include structure Mara. matnr LIKE bseg-matnr,
maktx LIKE makt-maktx,
data end of itab. pur_doc LIKE bseg-ebeln,
-------------------------------------------------- bwart LIKE ekbe-bwart,
cpudt LIKE bkpf-cpudt,
usnam LIKE bkpf-usnam.

include structure faglposx.


data end of itab.
--------------------------------------------------
Roll Numbers Roll No.
ABAP-E-3-2-110
Student Name
Muhammad Nawaz
ABAP-E-3-2-259 Asma Shahzad
ABAP-E-3-2-459 Hamza Qayoom
ABAP-E-3-2-144 Muhammad Ismail Zia
ABAP-E-3-2-37 Adeel Saeed
ABAP-E-3-2-343 Saad Mehmood
ABAP-E-3-2-159 Muhammad Awais Aleem
ABAP-E-3-2-168 Muhammad Ayub
ABAP-E-3-2-452 Muhammad Farooq
ABAP-E-3-2-191 Arslan Mazhar
ABAP-E-3-2-451 Waqar Hussain Shahid
ABAP-E-3-2-197 Danish Gul
ABAP-E-3-2-340 Qayyum Ahsan
ABAP-E-3-2-254 Hafiz Muhammad Abubkar
ABAP-E-3-2-397 Umar Farooq
ABAP-E-3-2-398 Mateen Munir
ABAP-E-3-2-400 Fahad Khalid
ABAP-E-3-2-401 Zain ulabdeen
ABAP-E-3-2-357 Muhammad Abubakar Saeed
ABAP-E-3-2-377 Aniya Raees
ABAP-E-3-2-413 Abdul Ahad
ABAP-E-3-2-204 Muhammad Ubaidullah
ABAP-E-3-2-418 Hassan Zulfiqar
ABAP-E-3-2-349 Syed Zia Ud Din Ahmed
ABAP-E-3-2-407 Wajid Yousaf
Roll Numbers Roll No.
ABAP-M-2-1-12
Student Name
Muhammad Jhanzaib
ABAP-M-2-1-208 Taimur Ul Hassan Ghouri
ABAP-M-2-1-294 Maryam Arshad
ABAP-M-2-1-310 Faisal Yasin
ABAP-M-2-1-461 Malik Omer
ABAP-M-2-1-1 Syed Ali Mubashar Kazmi
ABAP-M-2-1-85 Mughees Ahmed Mirza
ABAP-M-2-1-9 Sher Ali
ABAP-M-2-1-31 Muhammad Hamid
ABAP-M-2-1-35 Umer Munir
ABAP-M-2-1-447 Kamil Humayun Mirza
ABAP-M-2-1-148 Nadeem Saleem
ABAP-M-2-1-332 Usman Anwar
ABAP-M-2-1-43 Hafiz Muhammad Ishtiaq
ABAP-M-2-1-47 Zain Khawar
ABAP-M-2-1-50 Hamza Amjad
ABAP-M-2-1-52 Muhammad Raza Liaqat
ABAP-M-2-1-62 Hassan Arif
ABAP-M-2-1-82 Rizwan Saeed Khawaja
ABAP-M-2-1-226 Usama Azeem
ABAP-M-2-1-211 Muhammad Faizan Razzaq
ABAP-M-2-1-104 Safi Ur Rehman
ABAP-M-2-1-84 Hafiz Muhammad Naveed
ABAP-M-2-1-330 Muhammad Sumair
ABAP-M-2-1-395 Muhammad Hussain
For feedback, please write at

[email protected]

Thank you!

*To download application forms, kindly click the below link;


https://cloud.exdnow.com/s/k4Fb52tZfiMf4x5

You might also like