You are on page 1of 449

SAP ABAP

BABU

OASIS

SIDDHARTH XEROX
Behind mitryvanam,Gayatry nagar,ameerpet, HYD.
CELL:89859 28289, 9959 702469
SOFTWARE INSTITUTES MATERIAL AVAILABLE
01ERP_SAP_ABAP_Introduction.pdf 02Data_Dictionary.pdf 03Modularization techniques.pdf

04)Events_Classical_Interactive_Reports.pdf 05(2)Reports_ABAP_Queries_Fundamentals-15.pdf

06ALV_Reports-2.pdf 07Module_pool.pdf 08Files_Migration_Conversion.pdf

09Debugger_New.pdf 10Forms_Page_Layout.pdf 12Enhancements-30.pdf

14Cross_Applications.pdf 15Opportunity Processing.pdf 16OOABAP.pdf 17Project_New.pdf


BY MR. BABU (OASIS TECHNOLOGIES)

Chapter-1
SAP-ERP INTRODUCTION
Table of Contents-Chapter: 1
SAP-ERP Introduction ................................................................................................................................... 2
Enterprise Resource Planning ................................................................................................................... 2
Uses of ERP................................................................................................................................................ 3
Client Server System ................................................................................................................................. 4
SAP People ................................................................................................................................................ 5
Three Tier Architecture ............................................................................................................................. 6
Different Components of 3 Tier Architecture ........................................................................................... 9
ABAP/4 Introduction ............................................................................................................................... 11
Open and Native SQL .............................................................................................................................. 12
Some Configuration Details for ECC 6.0 Installation .............................................................................. 13
Initial Screen of SAP ................................................................................................................................ 16
Transaction Codes ................................................................................................................................... 17
ABAP Workbench .................................................................................................................................... 19
Object Navigator ..................................................................................................................................... 19

1
BY MR. BABU (OASIS TECHNOLOGIES)
SAP-ERP Introduction
SAP- Systems Applications & Products in Data processing

About SAP:

• SAP was found in June 1972 as “System Analysis and Program Development”.
• The name was later changed as “Systems Application and Products in Data processing”.
• SAP is a Germany based company. It was named as SAP-AG.
• SAP is world number one in ERP and third highest revenue independent software
provider.
• SAP is into almost all the industries such as Automobiles, Banking, Electronics etc….
• Impherical Chemical Industries (ICI) was the first customer of SAP.

Enterprise Resource Planning (ERP):

• It is used to integrate different data sources and business units.

Figure 1.1: ERP Centralized System

• In olden days Manufacturing Requirement Planning (MRP-II) and Material Requirement


Planning (MRP) are used before ERP is evolved
• MRP and MRP-II does not have integration between different business units.
• ERP is evolved from MRP-II
• MRP-II was evolved from MRP.
ERPMRP2MRP

2
BY MR. BABU (OASIS TECHNOLOGIES)
Uses of ERP:

• It is the centralized system to provide the strong integration between the different
business or functional areas.
• It provides the correct information on time to take the business decisions.
• The higher management (Directors, Managers, Leads etc…) with the knowledge of ERP
will be able to achieve their goals and targets using proper implementation of ERP.
• Better business plan and resource utilization.
• On time delivery and customer satisfaction.

Other ERP vendors:

There are more than 150 ERP vendors in market. Among them SAP is the best vendor. Few
other vendors are:

• Oracle
• PeopleSoft
• Microsoft etc….

Differences between ERP and MRP:

• In business point of view ERP is expanded from the co-ordination of the manufacturing
process to an Enterprise wide backend integration process.
• In technical point of view, ERP is expanded from the legacy implementation to more
flexible tires architecture.(Client-Server Architecture)

3
BY MR. BABU (OASIS TECHNOLOGIES)

Client- Server System:

Client:

It is a software or hardware combination which can send the requests for services from the
central respiratory system.

Server:

It is a software or hardware combination which can provide the services to a group of clients in
the shared environment.

Figure 1.2: Client- Server System

4
BY MR. BABU (OASIS TECHNOLOGIES)

SAP People:

SAP people are categorized as below:

Figure 1.3: SAP People

5
BY MR. BABU (OASIS TECHNOLOGIES)
Three Tier Architecture:
It is an arrangement of the systems or layers. There are three layers involved in SAP
architecture.

1. Presentation Layer
2. Application Layer
3. Database Layer

1. Presentation Layer:
• It is an environment from where all the requests are sent for the services from the
central respiratory system.
• The services or results are displayed in the presentation layer.

2. Application Layer:
• It receives the requests from the presentation layer to get them processed in the work
process.
• It also sends back the services to the presentation layer
• There will be more than one application layer.

3. Database Layer:
• It is a central depository of the data. It provides the data base services to a group of
clients in the shared environment.

Different Types of Architecture:

Following are different types of architectures:

a. SAP R/1  One Tier Architecture


b. SAP R/2  Two Tier Architecture
c. SAP R/3  Three Tier Architecture
d. MYSAP  For small scale industries

Here R - Real Time

6
BY MR. BABU (OASIS TECHNOLOGIES)

i. Single Tier Architecture:

• In this architecture, all the three layers are in the same system.

System

Presentation Layer

Application Layer

Database Layer

Figure 1.4: Single Tire Architecture

ii. Two Tier Architecture:

• In this architecture, there is a separate system for Presentation layer. Application layer
and Database layers are in another system.

System-1
Presentation Layer

Application Layer
System-2

Database Layer

Figure 1.5: Two Tier Architecture

7
BY MR. BABU (OASIS TECHNOLOGIES)

iii. Three Tier Architecture:

• In this architecture there is a separate system for each layer.

System-1
Presentation Layer

System-2
Application Layer

System-3
Database Layer

Figure 1.6: Three Tier Architecture

8
BY MR. BABU (OASIS TECHNOLOGIES)
Different Components of Three Tier Architecture:

• Following are different components of three tier architecture:

Figure 1.7: Different Components of Three Tier Architecture

9
BY MR. BABU (OASIS TECHNOLOGIES)
1. Presentation Layer:-

• It is an environment from where all the users requests are sent and display the results
or services.

2. Application Layer:-

• It receives the request from the presentation layer to get them processed.
• It also sends back the services (result) to a presentation layer.
• Following are the different components in application layer:
a. Dispatcher.
b. Gate way.
c. Shared Memory.
d. Work Process.

a. Dispatcher:

• It is a link between the presentation layer and the work process. It receives the request
from the presentation layer and sends them to an appropriate relevant work process to
get them processed.
• It also sends back the services (result) to the presentation layer.

b. Layer:

• It is a communication protocol of the cross application components such are RFC


(Remote Function Call), BAPI (Business Application Program Interface)..etc.
• It provides a link between two SAP systems
• (SAP R/3  SAP CRM) and a link between and non-SAP systems (SAP 
.NET/JAVA)…….etc.….

c. Shared Memory:

• It is a common main memory which can be shared by all the work process.

d. Work Process:

• It is a component to execute (process) the application or requests.


• Each work process is linked with a context which can run the application or request.
• Following are different types of work process:

10
BY MR. BABU (OASIS TECHNOLOGIES)
Background Work Process: It takes care of all the background job requests. Background
jobs are scheduled to execute the application without user interaction periodically (hours,
daily, monthly)……

Dialogue Work Process: It is used to process all kind of screen requests.

Enqueue Work Process: All the lock requests are handed by this work process.

Message Work Process: All the message requests are processed in this work process.

Spool Work Process (print): All the print requests are processed in this work process.

Update Work Process: All the database update requests are processed in this work
process.

3. Database Interface (or) Database management system:

• It converts all ABAP open SQL statements in to the database compatible statements to
access or to maintain the data in any database.

Note: SAP is database independent software because of the database interface layer in the
architecture.

Example: Database could be any oracle (or) SAP DB………….etc.

ABAP/4 Introduction:

• It is the programing language for SAP platform.


• It was founded in 1980 as ‘Generic Report Preparation Processor’.
• The name was later changed as ‘Advanced Business Application Programing’, 4th
generation language.
• It is used to develop the new application, enhance the existing application and
implement the cursor specific requirement in SAP environment.
• The open SQL statements are used in ABAP to interact with any kind of database.
• Following are some of the open SQL statements:
a. Select: To access or extract the data from the databases.
b. Modify: To modify the data in the database.
c. Delete: To delete the data from database.
d. Insert: To insert a new data.
e. Update: To update the existing data.

11
BY MR. BABU (OASIS TECHNOLOGIES)
Open and Native SQL:

• Open SQL is a set of SQL statements which can interact with any kind of database.
• Native SQL is specific to the particular database.
• The ABAP statement EXEC……..ENDEXEC are used to specify native sql.
Example: EXEC
*Native SQL
.
.
.

END EXEC

Note:
 In ABAP we mostly work with open SQL.
 The statements mentioned with in EXEC and ENDEXEC cannot be syntaxically checked.
 The table which is not available in SAP (specific to database) can be accessed using
native SQL.

Figure 1.8: Open and Native SQL

12
BY MR. BABU (OASIS TECHNOLOGIES)
Some Configuration Details for ECC 6.0 Installation:

• Hard Disk Drive – 250GB (500GB advisable)


• RAM -- 2GB and above (4GB is advisable)
• OS -- Windows Server 2003 and above
• Processor -- Dual Core and above

Steps to start the SAP server (SAPMMC):

• Double click on an icon ‘SAP Management Console’.


• Expand SAP systems by pressing an icon + if required.
• Right click on the required system name (ECC).
• Click on start.
• Enter the password. Example: india123(default password)
• Click on ‘ok’ button.

Note: Wait until the color of the system icon changes to green.
(Grey  Yellow  Green)

• Click on icon refresh to get the system status refreshed.

Steps to stop the server (SAPMMC):-

• Maximize SAPMMC window.


• Right click on the system required name (ECC).
• Click on ‘stop’.
• Click on ‘yes’ button.

Note: Wait until the color of the system icon becomes grey color.
(Green  Yellow  Gray)

• Click on ‘close’ icon to close SAPMMC.


• Click on ‘no’ button.

13
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to add the system to login pad:

• Double click on an icon ‘SAPLOGIN’.


• Click on ‘new item’ button.
• Click on ‘next’ button.
• Enter the required details; such are Description, Application server address, System
number and System ID.

Example:

Description – ( )

Application server – ( )

System number – ( )

System ID – ( )

• Click on ‘finish’ button.

Note:
 The button change item is used to change the existing system details.
 The button delete item is used to delete the unwanted system from logon pad.

Steps to logon to SAP system:

• Double click an icon ‘SAP logon’.


• Select the required system (DEV-Development system).
• Click on logon button.
• Enter the required logon credentials such are client no, username and password.
Example: Client ( )
User ( )  not case sensitive
Password ( )  case sensitive
Language ( )  default in EN-English
• Press ‘Enter’.

14
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 The client no’s will be specific for the projects in the real time. The client no could be
100/200/300…………….. But not 8* series number.
 In the real time the user names will be unique in each project. The usernames could
be the combination of our names.
Example: (NAME) or (Z50074) (up to 12char)
But not SAPUSER

Note:
 The below logon details can be used to logon to IDES (Internet Demonstration and
Evaluation System).
Client : 800
Username : sapuser
Password : india123
(For practice session only)

15
BY MR. BABU (OASIS TECHNOLOGIES)
Initial Screen of SAP:

• The initial screen of SAP is divided into the following different paths.

Figure 1.9: Initial Screen of SAP

Command Field:

• The command field on the standard tool bar is used to execute or access the transaction
codes in SAP.

16
BY MR. BABU (OASIS TECHNOLOGIES)
Transaction codes:

• The transaction codes are the commands or short cuts to execute or access the
corresponding predefined applications.
• In Sap each screen is linked with the unique transactional code.
• The transactional codes are mainly categorized in to two:
1. Standard transaction codes
2. Custom transaction codes

1. Standard Transaction Codes:

• The standard transactional code is the system provided transaction codes which are
linked with the predefined standard applications.
• The standard transaction codes could be the combination of only alphabets and the
alpha numericals.
Example: SQVI, SE11, SM30,……..etc.
SQ*  SAP Query
SE* System Engineering
SM*  System Machine

Note: The ABAP technical consultants mostly work with the transaction codes starts with SE*
and rarely work with SM*.

2. Custom Transaction Codes:-

• The custom transaction codes are maintained by the technical consultants.


• The custom transaction codes are maintained using the standard predefined transaction
code SE93.
• The custom object names should start with either ‘z*’ or ‘y*’.

Note: In most of the projects the custom object names start with ‘Z*’.

• The custom transaction codes could also be combination of only alphabets and alpha
numerals.

Example: ZCUSTCODE, ZCUST11, ZCUST-TCODE…………….

17
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
• There should not be any space or special characters in the custom object names but
can be separated with underscores (_).
Example: ZCUST _CUST ZCUSTCODE
ZCUST$CODE ZCUST_CODE
(Not preferable) (Preferable)
• The underscores (_) must not be a second character in the custom object names.
Example: Z_CUSTCODE ZCU_STCODE
(Preferable) (Preferable)

Shortcuts to work with the transaction codes:-

• The below shortcuts are used to work with the transaction codes in the system:

1) /o + transaction code + enter  to execute the transaction code in another new system.
Example: /ose11 (enter)

Note: Up to six sessions can only be opened in a system.

2) /n + transaction code + enter  to execute transaction codes on the same session.


Example: /nzcust_code (enter) or /nycust_code (enter)
3) /n + ex + enter  to exit out off the system.
Example: /nex(enter)
4) /n + end + enter  to end the system by giving conformation command.

Steps to execute the transaction code:

• Enter the required transaction code (/nse11) press enter button

18
BY MR. BABU (OASIS TECHNOLOGIES)
ABAP work bench:

• The ABAP work bench is a set of tools which can be used to develop the applications,
change the existing applications and implement the customer specific business
requirements in the SAP environment.

Following are some of the useful work bench tools:

• Data Dictionary (DDIC – SE11): To maintain central depository of the data and data
definitions. DDIC is independent to the data base.
• ABAP Editor (SE38): To maintain the different types of programs.
• Message Class (SE91): To maintain the global messages.
• Function Builder (SE37): To maintain global functions.
• Menu painter (SE41): To maintain customer specific menu items and push buttons.
• Screen painter (SE51): To maintain the screens.
• Form painter (SET1 or SMARTFORMS): To maintain the different types of forms.

Objects Navigator (SE80):-

• It is the central point of entry to work with any kind of work bench objects such as data
dictionary objects, programs, function groups……… etc.
• The transaction code or SE80 or SE84 is used to work with an object navigator.
• The object navigator look as below

Figure 1.10 Object Navigator

19
BY MR. BABU (OASIS TECHNOLOGIES)

Chapter-2
Data Dictionary
Table of Contents: Chapter-2
Data Dictionary..................................................................................................................................... 21
Database Tables ............................................................................................................................ 22
Domain.......................................................................................................................................... 25
Data Types .................................................................................................................................... 25
Currency and Quantity Fields........................................................................................................ 32
Table Maintenance Generator...................................................................................................... 33
Primary and Foreign Key Relationship .......................................................................................... 38
Technical Properties of a Table..................................................................................................... 46
Structures...................................................................................................................................... 50
Predefined Types .......................................................................................................................... 51
Include and Append Structure ...................................................................................................... 52
Search Help ................................................................................................................................... 55
Views ............................................................................................................................................. 58
Lock Objects .................................................................................................................................. 62

20
BY MR. BABU (OASIS TECHNOLOGIES)

Data Dictionary (DDIC)


Introduction:

• The data dictionary is the central and structured source of data.


• The central data definitions (metadata) are maintained in the data dictionary.
• The data objects can be referred anywhere in the system.

Figure 2.1: Data Dictionary Central Repository

• The transaction code SE11 is used to work with the data dictionary.
• Following are the different types of data dictionary objects
1. Database Tables.
2. Domains.
3. Data types
a. Data element.
b. Structure.
c. Table type.
4. Search helps
a. Elementary search help.
b. Collective search help.
5. Views
a. Database view.
b. Maintenance view.
c. Help view.
d. Projection view.
6. Lock objects.
7. Type groups.

21
BY MR. BABU (OASIS TECHNOLOGIES)
1. Database tables (Data Dictionary tables)
Introduction

• They are the small data storage components in the data base.
• Tables are the collection of fields which contain the physical data.
• The tables are made up of rows by columns.

Figure 2.2: Database Table

• In SAP tables are of three types.


1. Transparent tables.
2. Pooled tables.
3. Cluster tables.

Transparent tables:

• The transparent tables have one-one relationship with the database tables, that
means, the table names, field names and the number of fields are similar in both
data dictionary and database.

22
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 2.3: Transparent Table

Note: In the real time we mostly work with the transparent tables.

Pooled tables:

• The pooled tables have many to one relationship with the database tables, that
means one table on the data dictionary is liked with another set of tables called
TABLE POOL in the data base.
• The pool tables follow the binary search while accessing data.
• Key field names are different in DDIC and table Pool

Cluster tables:

• The cluster tables also have many to one relationship with the database tables, that
means one table in the data dictionary is stored with another set of tables called
cluster pool.
• Key field names are same in DDIC and cluster Pool

23
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 2.4: Pooled or Cluster Table

Different approaches to create the database (or) Data dictionary tables:

• There are two approaches to create the transparent database or data dictionary
tables.
1. Top down approach.
2. Bottom up approach.

1. Top down approach:

• In this approach the required data elements and domains are created while creating
the tables.

Tables Data Elements  Domains

2. Bottom up approach:

• In this approach the required domains and data elements are created first then they
can be used at the time of creation the tables or structures.

Domains  Data Elements  Tables

Note: In the real time the top down approach is advisable since the bottom up approach
take more time and difficult to remember to create a data element and domains.

24
BY MR. BABU (OASIS TECHNOLOGIES)
Domain
Introduction:

• It is also one of the data dictionary objects which can be used to maintain the
technical properties of field such are data types, length of the data……..etc.
• It can also be used to maintain the value tables to provide search help on the field.

FIELD NAME DATA TYPE DATA LENGTH


EMP_NO NUMC (numeric) 10

EMP_NAME CHAR (character) 30

Data Elements:

• It is one of the data dictionary objects.


• It is used to maintain the field tables of the fields in the tables or structures.

FIELD NAME FIELD LABELS


EMP_NO EMPLOYEE NO

EMP_NAME EMPLOYEE NAME

Hierarchy of the domains and data elements reusability:

• The domains, data elements and tables or structures can be reused as below

Figure 2.5: Hierarchy of Domains and Data Elements Reusability

Mandatory fields:

• The mandatory fields are the compulsory fields to be filled if the data.

25
BY MR. BABU (OASIS TECHNOLOGIES)
• The tick marks are appeared on the mandatory fields

Example: Mandatory field Must be filled

Optional field May or may not be filled

System provided search help:

• It is used to display all the system provided possible entities and select any one of
them.
• The function key ‘f4’ or a search help icon is pressed to display the search help
windows.

Creation of the below custom table:

FIELD KEY INITIAL DATA TYPE DATA DESCRIPTION


VALUE LENGTH
MANDT CLNT 3 Client

EMP_NO NUMC 10 Employee No

EMP_NAME CHAR 30 Employee Name

Client dependent and independent tables:

• The tables which have the field name will have MANDT (client no) are called client
dependent tables.
• The table which does not have the field MANDT is called client independent table.

Note: In the real time we mostly work with the client dependent tables.

Key fields:

• Key fields are used to maintain the unique data by avoiding the duplicate data.
• In SAP the key field check boxes are checked to make the fields as primary key fields.

Note: If there are more than one field the data will be checked row level.

Initial value check box:

• It is checked to take the default field values of the key fields for the first time.

26
BY MR. BABU (OASIS TECHNOLOGIES)
Example: integer :0

Character : space…………..etc.

Steps to create the database (data dictionary) transparent table:

• Execute the transaction code SE11.


• Enter the table name (ZB21_EMPLOYEE).
• Click on create button (F5).
• Enter short description (could be any).
• Select an appropriate delivery class (c).
• Select an option ‘Display or Maintenance allowed’ by pressing the drop down under
data browser or table view maintenance.
• Click on fields tab.
• Enter the field name MANDT’.
• Check the check boxes key and initial value.
• Enter the standard data element ‘MANDT’.
• Press the ‘Enter’ button.

Note: If a data element exist in the system, the corresponding details such are data
types, length etc. are displayed.
• Click on save icon.
• Click on local object button (F7).
• Enter the next field name ‘EMP_NO’.

Steps to Create of data element:

• Enter the data element name ( ).


• Press the ‘Enter’ button.
• Double click on data element name.
• Click on yes button.
• Click on yes button or enter.
• Enter short description (EMPLOYEE NAME).
• Click on the tab ‘Field label’.
• Enter the field labels for short, medium, long and heading.
• Press the ‘Enter’ button.
• Click on save icon.
• Click on the local object button (F7).
• Click on the tab ‘data type’.

Steps to Create of domain:

• Enter the domain name (could be same as data element name).

27
BY MR. BABU (OASIS TECHNOLOGIES)
• Press the ‘Enter’ button.

Note: If the domain is already available in the system, the corresponding details such as
data type, data length………….. Etc.

• Click on yes button in case of no active domain available message.


• Double click on the domain name.
• Click on yes button.
• Click on yes button.
• Enter short description.
• Enter the required number of characters.

Note:
 Press F4 function key to see all the system provided data types in the search help.
 The decimal places should be filled for the decimal data types such are currency,
quantity………..etc.
 The field output length is used to restrict the data output length.
 The check box sign is checked to return sign of the number.
 The check box lower case is checked to make the character fields as a case
sensitive to accept both upper and lower case letters. Since the system takes the
character data as uppercase letters by default.
Example: Data type : (NUMC)
No of characters : (10)
Decimal places : ( )
…………………………………………

• Click on save icon.


• Click on the button local object button.
• Click on check icon (ctrl + F2).
• Click on activate icon.

Note: If an object is activated directly, the corresponding object will be saved, checked
and activated.
Activate = Save + Activate

• Press the ‘Enter’ button.


• Click on an icon back (F3).
• Click on activate icon.
• Press the ‘Enter’ button.

28
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 Check the check boxes key and initial value to make the fields of the table as key
field.
 Follow the similar steps to create any number of required data elements and
domains.
(Refer ‘creation of data elements’ and ‘creation of domains’ )

• Click on technical settings button.


• Enter or select an appropriate data clause (APPLO).
• Enter the required size category ( '0’ )
• Click on save icon.
• Click on back.
• Click on the menu icon ‘extra’.
• Click on enhancement category.
• Click on yes button.
• Click on active icon.
• Click on back icon.

Steps to create the table entries (in the custom table):

• Execute the transaction code SE11.


• Enter required custom table name.
• Click on display button.
• Click on the menu icon utilities.
• Click on the table contents.
• Click on create entries.
• Enter required data.
• Click on save.
• Click on back icon.

Note: Follow the similar steps to create any number of entries.

Steps to execute a table:

• Execute the transaction code SE11.


• Enter the required table name.
• Click on display button.
• Click on the icon contents (ctrl + shift + F10).
• Click on execute icon.

29
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 The transaction codes SE16or SE16N can also be used.
 The button number of entries is used to know the total number of recordings in
the table.

Some of the useful functions or properties in the tables:

Steps to convert field names to field labels and vice versa:

• Once the table is executed ( SE11  Table name  Display  Contents )


• Click on the menu item settings.
• Click on user parameters.
• Select a radio button either field name or field label.
• Click on yes button.

Steps to change the input fields for selection:

• Execute transaction code SE16 or SE11.


• Enter the required table name.
• Click on the table contents icon.
• Click on the menu item settings.
• Click on fields for selection.
• Check or uncheck the required fields.

Note:
 Check is to add input fields and uncheck is to hide input fields.
 An icon find (ctrl + f) can be used to find the required fields.
 (Find icon  enter a field name or field label in the find string  press enter)
 An icon select all (F9) is used to select all the fields.
 An icon deselect all (shift + F2) is used to deselect all the fields.

• Click on yes button.


• Click on back icon.

Steps to choose the fields in the list:

• Once the table is executed.


• Click on the menu icon settings in the output list.
• Click on format list.
• Click on choose field (ctrl + F9).
• Click on an icon find.
• Enter the required field names or field labels to be displayed in the output list.

30
BY MR. BABU (OASIS TECHNOLOGIES)
• Press the ‘Enter’ button.
• Click on the required highlighted field name or field label (yellow background).
• Check the check box that appeared beside a fieldname.
• Click on yes button.

Note: Uncheck the check box to hide the fields.

Steps to change the output list format:

• Once the table is executed.


• Click on menu icon settings.
• Click on user parameters.
• Select the required format (AVL grid display) under output list block.
• Click on yes button.

Note: The default output list format is ‘SE16 standard list’.

Steps to download the table data:

• Once the table is displayed either in ALV list format or ALV grid format.
• Click on an icon local file (ctrl + shift + F9).
• Select the required file format such as ‘spread sheet’ or ‘rich text’ or ‘html
format’……etc.
• Click on yes button.
• Select the required directory by pressing the function key ‘F4’ or search help icon.
• Enter the file name (download_excell.xls).
• Click on back icon.

Steps to find a system generated program of the tables:

• Once the table is executed.


• Click on the menu item system.
• Click on status.
• Double click on the system generated program name to see system generated
source code.

Note: The system generated program name is appeared in the program field under SAP
data block.

31
BY MR. BABU (OASIS TECHNOLOGIES)
Currency or Quantity fields:

• In SAP the currency and quality fields are required currency key and quantity unit.
Hence, the reference table and the reference field must be specified for currency
and quantity fields.
• The data type for the currency field is ‘CURR’ and the data type for the currency key
is ‘CUKY’.
• The data type for the quantity is ‘QUAN’ and the data type for quantity key is ‘UNIT’.

Note:
 The reference table could be any table which has the currency key and quantity
unit fields.
 The same table can also be used as a reference table if it has the currency key or
quantity unit fields.

• The number of decimal places at domain level must be specified for currency and
quantity fields.
Example: <ZCUST_TAB>

Field Data type Reference Reference Description


table field
CURR_KEY CUKY Currency key

EMP_SAL CURR <ZCUST_TAB> CURR_KEY Salary key

QUANTITY QUAN VBAP MEINS Quantity


( standard
table )

Steps to work with the currency or quantity fields:

• Once the currency and quantity fields are inserted in the table or structures.
• Click on the tab currency or quantity fields.

Note: The columns reference table and reference fields are enabled for the currency and
quantity fields only.

• Specify the reference tables and reference fields as like the above example.
• Click on activate icon.
• Press the ‘Enter’ button.

32
BY MR. BABU (OASIS TECHNOLOGIES)
Example: 50,784.50 RS/USD……….

Currency value_CURR currency key_CUKY

100.50 pieces/kgs/grams……..

Quantity_QUAN Quantity units_UNIT

Table Maintenance Generator (TMG):

• It is used to maintain (create/change/delete) the custom tables and maintenance


views.
• It also must be created to check and pass the default values of the table fields while
maintaining.
• The transaction code SM30 is used to maintain the custom tables and maintenance
views.

Note: In the real time the custom tables and the maintenance views are maintained using
the transaction code SM30 only.

Steps to create TMG:

• Once the custom table or maintenance view is in change mode or in display mode.

Note: The custom table is maintenance view must be activated before Table Maintenance
Generator is created.

• Click on utilities menu item.


• Click on table maintenance generator.
• Select an appropriate authorization group (&NC&).

Note: Authorization group is used to control the user access.


• Enter the function group name (could be same as the table name).

Note: The function group must be specified. Since, the system generates the screen and
the corresponding source code for the table maintenance under the function group.
• Select the radio button one step maintenance.

33
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 In case of one step maintenance the system generates single over view screen to
maintain and display the data.
Example: In case of one step
EMP_NO EMP_NAME --------------
1 A B

2 C D
| | |
| | |
Over-view screen – 1 (display / change mode)
 In case of two step maintenance the system generates two screens to create a
single entry at a time and display to create a data in another screen. Two step
maintenance is the default option.
Example: In case of two steps

EMP_NO : _______________

EMP_NAME : _______________
|
|
|

SINGLE SCREEN

Display mode only

EMP_NO EMP_NAME --------------


1 A B
| | |
| | |

Overview screen – 1

 In the real time the option one step maintenance is preferable. Since, the multiple
entries can be maintained at a time.

• Enter overview screen number (could be any number).


• Click on create icon (F6).
• Click on save icon (package: $TMP).
• Press the ‘Enter’ button.
• Click on local object button (F7).
• Click on back icon.

34
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to maintain the custom table or maintenance view:

• Execute the transaction code SM30.


• Enter the required custom table or view name.
• Click on maintain button.
• Click on new entries button.
• Maintain the required data.

Note: Select an entry and click on delete (shift + F2) icon to delete the table / view entries.
• Click on save icon.
• Click on back icon.

Steps to change a custom table:

• Execute the transaction code SE11.


• Enter the required custom table name.
• Click on change icon (F6).
• Select the required field before which the new field to be inserted.
• Click on an icon insert row that appears just above the field column.

Note: An icon delete row is used to delete the unwanted fields.


• Add the required additional fields and make the necessary fields.
• Click on activate button.
• Press the ‘Enter’ button.

Deletion of TMG:

• If any changes are made in custom table after TMG is created then the TMG must be
deleted and recreated again without getting any run time error.

Select to delete ‘TMG’ and recreated:

• Once the custom table is in change mode.


• Click on the menu item ‘utilities’.
• Click on TMG.
• Click on delete icon (shift + F2).
• Click on yes button.
• Click on back icon.
• Select the radio button ‘one step maintenance.’
• Click on create (F6) icon.
• Click on save icon under a package $TMP (local object).
• Click on back icon.

35
BY MR. BABU (OASIS TECHNOLOGIES)
Table Adjustment:

• If the key fields are changed as non-key fields by unchecking key check boxes, the
system gives an error to convert the table.

Example: Structure change at field level.

• The table must be adjustable to avoid such kind of errors.


• The transaction code SE14 or the menu bar utilities and database utilities in SE11 can
be used to adjust the tables.

Steps to adjust the table:

• Execute the transaction code SE14.


• Enter the required table name in the object name field.
• Click on edit button.
• Click on the button ‘Active and Adjust database’.
• Click on yes button.
• Activate the table in SE11.

Steps to copy a data dictionary object:

• Execute the transaction code SE11.


• Enter the required data dictionary object name (table name).
• Click on icon copy.
• Change to table name.
• Click on yes button.
• Press the ‘Enter’ button.
• Click on local object button.

Note:
 The TMG is not copied while copying the table.
 The data of an existing table is not copied while copying the table.

• Click on change icon.


• Make the necessary changes in the copied table.
• Activate the table and create TMG.
• Click on back icon.

Steps to delete a data dictionary object:

• Execute the transaction code SE11.


• Enter the required DDIC object name.
• Click on delete icon.

36
BY MR. BABU (OASIS TECHNOLOGIES)
Note: It is not possible to delete a DDIC objects if they are already used in another
dependent objects.
• Click on yes button.

Steps to create the custom transaction code to maintain tables or maintenance views:

• Execute the transaction code SE93.


• Enter the custom transaction code name to be created.
• Click on create button.
• Enter short text (custom transaction code).
• Select the last radio button (parameter transaction).
• Click on yes button.
• Enter the transaction code SM30 in transaction field.

Note: If a checkbox step initial screen is check, an initial screen of SM30 can be skipped.
• Scroll down and check all GUI supported checkboxes.
• Maintain the default values as below.
Name of screen field Value
VIEW NAME <ZCUST_TABLE>

UPDATE X
• Click on save icon.
• Click on local object button.
• Execute the above created transaction code to maintain the table.

Indexes:

• Indexes are used to avoid the duplicate data in the table.


• They can also be used for better performance while extracting the data from the
tables.
• Indexes are of two types:
1. Primary index.
2. Secondary index.

Primary Index:

• The primary indexes are generated automatically by the system using all the key
fields of a table.

Secondary Index:

• The secondary indexes are maintained by the technical consultants.


• The secondary indexes are created using key and non-key fields of a table.
• The secondary indexes are also called custom indexes.
• Up to 9 secondary indexes can be created in a table

37
BY MR. BABU (OASIS TECHNOLOGIES)
Note: Secondary indexes cannot be defined on pooled and cluster tables.

Note: In the real time the secondary indexes are not advisable since the data is filtered at
database level for all the users.
• The indexes are represented as below.

Example: <dbtab / dbtab> ~ < PIN /ZSD>

<PIN>  Primary index

<ZSD>  Secondary index

Steps to create a secondary index:

• Once the table is in display or change mode.


• Click on the button ‘indexes’.
• Click on create icon.
• Click on create index.
• Enter the index name up to 3 characters only (ZSD).
• Click on yes button.
• Enter short description.
• Click on ‘Table Fields’ button.
• Check the required fields.
• Click on yes button.
• Click on activate icon.
• Click on back icon.

Note: An icon index is used to delete unwanted index.


• Cancel the index window.
• Click on back.

Primary and foreign key relationship or link:

• In each RDBMS (Relational database management system) all the tables are linked
together through primary and foreign key relationship.
• It is used to execute the correct data from the multiple tables by joining them.
• In SAP the master tables (primary tables) are called check tables, the child tables are
called foreign key tables.

Note: The domain name of a check table field should be similar to a domain name of the
foreign key field in the child table to create foreign key relationship, but the field name is
different.

38
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 2.6: Primary and Foreign Key Relationship

Note:
 Here domain name of EMP_NO and EMPNO should be similar.
 It is not possible to join pooled and cluster tables, since they are already set of
tables.
 A search help is displayed to see the possible entries of a check table field on the
foreign key field when the foreign key table or child table are executed.

Steps to create a foreign key relationship:

• Once the foreign key table or child table is in change mode.


• Place the cursor on the field through which the foreign key relationship to be
created.
• Click on foreign key icon that appears beside search help button.
• Enter the required check table name.

39
BY MR. BABU (OASIS TECHNOLOGIES)
• Maintain the foreign key fields and select the radio button key field or candidates as
below.

Example: Foreign key fields


Checkbox Check table Foreign key table Foreign key field

<ZCUST_TABLE> EMP_NO

|
|
|
Key fields / candidates

• Click on yes button.


• Press the ‘Enter’ button.
• Click on yes button.
• Activate the foreign key table.
• Click on back.

Different ways to check table relationships (or) link between the tables:

There are two ways to check the relationship between the tables:

1. Using the transaction code SQVI.


2. By maintaining the foreign key (child) custom tables.

1. Transaction code SQVI:

• It is used to know the relationship or joining conditions between the tables.

Steps to use SQVI:

• Execute the transaction code SQVI.


• Enter quick view name ‘YJOIN’.
• Click on create button.
• Enter title.
• Select table join under data source block.
• Click on yes button.
• Click on insert table button.
• Enter the required table name (<ZCUST_TABLE1>) or standard table name.
• Click on insert table button.

40
BY MR. BABU (OASIS TECHNOLOGIES)
• Enter the required table name (<ZCUST_TABLE2>) or standard table name.
• Press the ‘Enter’ button.

Note:
 Follow the similar steps to insert any number of transparent tables.
 The button delete table is used to remove the tables from the join.

2. To check the relationship by maintaining the foreign key table:

• Execute the transaction code SM30.


• Enter the foreign key table name (child table name).
• Click on maintain button.
• Click on new entries button.
• Enter any values in the foreign key field which does not exist in the check table.
• Click on save icon.

Note: If the system given an error message as ‘entry xxxx does not exists in the check
table’, the relationship is working fine.

Value table:

• The value is maintained at domain level to provide the possible maintained entries
as a search help.
• It does not force the user to select any one of to maintain entries in the value table
at the time of maintaining the custom table.

Steps to maintain the value table:

• Once the domain is in change mode.


• Click on the tab value range.
• Maintain the required single values or intervals or specify any value table.

Example: Single values:

FIXED VALUE Short Text


A

Intervals:
Lower Limit Upper Limit Short Text
A S

T X

41
BY MR. BABU (OASIS TECHNOLOGIES)

(or) Value table (ZCUST_TABLE2)

• Click on save icon.


• Click on back icon.
• Activate the data element.
• Click on back.

Differences between check table and value table:

Check Table Value Table


1. It is maintained at table level. 1. It is maintained at domain level.
2. If forces the user to select any one of 2. It does not force the user since it has
check table field entries. empty value by default.
3. The search help is displayed from the 3. The search help is displayed on each
check table on the foreign key field of field which is linked with the same
a foreign key table (child table). domain of the valued table.
4. Can be used to extract the data. 4. It is not possible to extract the data
since not physical table.

Standard Tables:

• They are the system provided tables.


• The standard tables can only be updated through the standard transaction codes
(applications or programs).
• The standard tables of function areas can be recognized as below.
Sales and distribution tables
Most of the SD tables start with VB* and LI*
Example:
VBAK -- Sales document Header data.
VBAP -- Sales document Item data.
VBAK – Billing Document.
VBRP – Billing Document item data.
|
|
|
LIKP – Delivery Document Header data.
LIPS – Delivery Document Item data.

Material Management (MM) tables:

• Most or the mm tables start with MA* and EK*

42
BY MR. BABU (OASIS TECHNOLOGIES)

Example:

MARA – Material Master Data.

MARC – Material Plant Data.

EKKO – Purchase Order Header data.

EKPO – Purchase Order Item data.

Finance and controlling (FI / CO) tables:

• Most of the FICO tables start with BS*, PR* and CS*

Example: BSAD – Customer accounts for cleared items.


BSAK – Vendor account for cleared items.
BSID – Customer accounts
BSIK – Vendor accounting
|
|
|
PRPS – WBS element master data.
(WBS – Work Breakdown Structure)
CSKS – cost center master data.

Note:
• In fico some of the tables are cluster tables which start with BSE*
Example: BSEG – Accounting Document Segment.
BSEC – Accounting Data Document Segment.
BSET – Tax Data Document.
…….

HR Tables (Human Resource):

• Most of the HR tables start with PA* and HRM*

Example: PA000-HR Master Record for an info type ‘0001’.

PA001-HR Master Data: Registry for serialization in ALE in bound.

43
BY MR. BABU (OASIS TECHNOLOGIES)

Customer relationship management (CRM) tables:

• Most of the tables start with BUT*

Example: BUT000 – Business Partner : General data 1

BUT001 – Business Partner : General data 2

Some of the example tables for pooled:

• Some of the pooled tables start with M-MTV*

Example: M_MTVMA – Generated pooled table for match code.

Vendor Tables:

• Most of the vendor tables start with LF*

Example: LFA1 – Vendor master table.

LFB1 – Vendor master table(company code).

Customer tables:

• Most of the customer tables start with KN*

Example: KNA1 – General Data in customer master.

KNB1 – Customer master ( company code ).

Some of the useful special tables:

a) Data Dictionary related tables:


o Most of the data dictionary tables start with DD*

44
BY MR. BABU (OASIS TECHNOLOGIES)
Example: DD02L – SAP Tables.

DD02T – SAP Table texts (to find the table names using short
description).
DD01L – Domain.
DD01T – Domain texts.
DD04L – Data elements.
DD04T – Data elements text
|
|
b) Transaction codes table:
o The standard table ‘TSTC “contains all the transaction codes in the system.

c) Repository objects table:


o The standard tables TADIR (directory of repository objects) and TRDIR
(system ABAO programs) contains all the workbench objects.

45
BY MR. BABU (OASIS TECHNOLOGIES)
Differences between Transparent, Pooled and Cluster tables:

Transparent Tables Pooled Tables Cluster Tables


1. It has one-one 1. It has many to one 1. It has many to one
relationship with the relationship with the relationship with the
data base tables. data base table. data base table.

2. Secondary indexes 2. Secondary indexes 2. Secondary indexes


can be created. cannot be created. cannot be created.

3. Can be joined with 3. Cannot be used with 3. Cannot be used with


other transparent joins. joins.
tables.

4. The table name, field 4. Table names and field 4. Table names and field
name, of fields is names are different names are different
similar in both DDIC in database. in database.
and database.

5. Both open and native 5. Open SQL statements 5. Open SQL statements
SQL can be used. can only be used. can only be used.

6. There is a similar 6. It is stored with 6. It is stored with


table in DB. another set of table another set of table
called Table pool. called Cluster pool.
7. Data can be accessed 7. It follows binary 7. It follows linear
in both linear and search. search.
binary search.
8. Foreign keys can be 8. Foreign Keys cannot 8. Foreign Keys can be
created be created since key created since key
field names are field names are same
different in DDIC and in DDIC and Cluster
Table Pool Pool

Linear and Binary search:

• In case of linear search the search criteria is started for the first record and stopped
once the required record is found.
Example: 1, 2, 3,……75,……100.
 
Linear search

46
BY MR. BABU (OASIS TECHNOLOGIES)
• In case of binary search total number of records are split in to two equal parts (n/2)
then the search criteria is started in the second half.

Note: In case of the required record id not found in the second half, a system will search in
the first half.
Example: 1, 2, 3……, 50,………., 100
 (n/2) 
Binary search

Technical properties of a table:

• Following are the different technical properties of a table.


a) Delivery class.
b) Data browser or Table view maintenance.
c) Data class.
d) Size category.
e) Buffering.
f) Enhancement category.
g) Table Maintenance Generator.

a.) Delivery class:

• It is used to specify type of the table.


• It can also control the transport of the table data.
• It is also used in the extended table maintenance.

Note: in case of delivery class ‘A’ the table or maintenance view can be maintained in any
system (Development  Quality  Production) using SM30.

b.) Data browser / Table view maintenance:

• It is used to specify an option to maintain or not maintain the table or views.

Note:
 In the real time n option display or maintenance allow is mostly used.
 In case of the option display or maintenance allowed with restrictions and display
or maintenance not allowed the custom table or maintenance views cannot be
maintained.

c.) Data Class:

• It is used to specify type of data which can be maintained in the tables.


• There are mainly three types of data.
o Master data.

47
BY MR. BABU (OASIS TECHNOLOGIES)
o Transaction data.
o Organization and customer data.

Master data:

• It is the data which can be accessed frequently and rarely changed.


• The data class for the master table is APPLO.
Example: Date of Birth, permanent address etc………

Transaction data:

• It is the data which can be frequently accessed and updated.


• The data class for transaction data is APPL1.
Example: Salary, current address etc…………

Organization and customizing data:

• This data is maintained while installing the system.


• It can be changed rarely
Example: Company codes, serial numbers etc…..

Note:
 There are two more data classes USR and USR1 which are reserved for user specific
developments.
 In the real time the data class APP0 (master data) or APPL1(transaction data) is
mostly used.

d.) Size category:

• This property is used to reserve the initial space required for the table data in the
database.
• The size categories from 0 to 7 are available from the version ecc6.
• In the real time the size category ‘0’ is mostly used (0 to 7100).

Note: If the user tries to enter a record over that the selected range, the system will
increase the size category in to a next category (0 to 1).

e.) Buffering:

• It is used to reduce the traffic in the database in case of the table is accessed by
multiple users for number of times.
• There are three buffering modes
o Buffering not allowed – The table cannot be buffered.
o Buffering allowed but switched off – Buffering allowed but not activated.

48
BY MR. BABU (OASIS TECHNOLOGIES)
o Buffering switched on – The table can be buffered. In case of this option any
one of the buffering types should be selected.
• Buffering types are of three types:
o Single record buffering.
o Generic area buffering.
o Fully buffered.

Single record buffer:

• In case of this buffering type a record by record is buffered from the database tables.

Figure 2.7: Single Record Buffer

Generic Area Buffer:

• It is used to buffer the table data based on the specified key fields.
• In case of this buffering type the number of key fields must be specified.
Example: Number of key fields: 2

49
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 2.8: Generic Area Buffer

Fully buffer:

• The entire table is buffered.

Figure 2.9: Fully Buffer

f.) Enhancement category:

• This property is used to control the table or structure enhancement.

Note: In the real time an option “can be enhanced (DEEP)” is mostly selected.

g.) Table Maintenance Generator (TMG):

• This property is used to maintain the multiple entries and validate the table data.

Structures:
Introduction:

• It is almost similar to a table but only the difference is the structures do not have any
physical data. Whereas, tables have physical data.
• The structure is filled with a single record at runtime only.
• The structure can be referred across the system.

Steps to create a structure:

50
BY MR. BABU (OASIS TECHNOLOGIES)
• Execute the transaction code SE11.
• Select a radio button data type.
• Enter the structure name (<zcust_dd_structure>).
• Click on the create button.
• Select a radio button structure.
• Click on yes button.
• Enter short description
• Enter the required field name.

Example: EMP_CITY

• Enter the data element name in the component type column.


• Press the ‘Enter’ button.

Creation of Data Element:

• Double click on data element name.


• Click on yes button.
• Click on yes button.
• Click on local object button.
• Click on yes button.
• Enter short description.
• Click on the tab ‘Field label’.
• Enter the field labels for short, medium, long and heading.
• Press the ‘Enter’ button.
• Click on save icon.
• Click on the local object button (F7).
• Click on the tab ‘data type’.

Creation of domain:

• Enter the domain name (could be same as data element name).


• Press the ‘Enter’ button.
• Click on yes button in case of no active domain available message.
• Double click on the domain name.
• Click on yes button.
• Click on yes button.
• Enter short description.
• Select an appropriate data type.

51
BY MR. BABU (OASIS TECHNOLOGIES)
• Enter the required number of characters.
• Click on save icon.
• Click on the button local object button.
• Click on checkbox lowercase to accept both lowercase and uppercase letters.
• Click on activate icon.
• Press the ‘Enter’ button.
• Click on an icon back (F3).
• Click on activate icon to activate data element.
• Press the ‘Enter’ button.
• Click on back icon.

Note: Follow the similar steps (creation of data element and creation of domain) to
create any number of required data elements and domains.
• Click on the menu icon ‘extra’.
• Click on enhancement category.
• Click on yes button.
• Click on enhancement category (can be enhanced deep).
• Click on yes button.
• Click on active icon to activate structure.
• Click on back icon.

Pre-defined types:

• They are used to created table or structure without using data element or domains.

Steps to make use of the predefined types while creating the table or structure:

• Once the table or structure is in change mode.


• Click on predefined button.

Note: The data element or component column is disabled in case of predefined types.

• Enter the required field name.


• Select an appropriate data type.
• Enter the required length and short description.
• Activate the table or structure.

Note: Follow the similar steps to make use of pre-defined types for any number of fields.

Example:
Component Component type Data Length Short description
type

52
BY MR. BABU (OASIS TECHNOLOGIES)
EMP_CITY <ZCUST_EMP_CITY> CHAR 30 Employee city

EMP_COUNTRY CHAR 25 Employee country

Differences between the tables created using data elements and using predefined types:

Using data elements Using predefined types


1. Data elements can be reused. 1. Reusability is not possible.

2. Foreign key relationship can be 2. Foreign key relationship is not be


created since it contains domains. created.

3. Field labels are displayed while 3. ‘+’ symbols are appeared while
maintaining the table. maintaining the table instead of field
labels.

Include structure and append structure:

• The table or structure can be enhanced to add additional fields using include
structure or append structure.

Include structure:

• Include structure can be used for the multiple tables or structures.


• The table or structure must be in change mode to include a structure.
• Click on yes button.

Steps to include a structure:

• Once the table or structure is in change mode.


• Select a field before which a structure to be inserted or included.
• Click on insert row icon.
• Enter “.include” under field or component column.
• Enter the required structure name under Data Element or component column.
• Press the ‘Enter’ button.
• Activate the table or structure.

Note: The structure can also be created by double clicking on the specified structure
name.

Append structure:

53
BY MR. BABU (OASIS TECHNOLOGIES)
• The append structures are specific to a table or structure. Hence, they cannot be
used for the multiple tables or structures.
• An append structures can be inserted in display mode also.

Steps to append a structure:

• Once the table or structure is in display or change mode.


• Click on append structure button.
• Enter append structure name.
• Click on yes button.
• Create the structure with the required fields.

Note: Refer creation of structure concept.


• Activate the structure.
• Click on no button in case of warnings.
• Click on back icon.

Note: Fields for include and append structure are in blue color.

Example: The custom table looks as below on the structure is appended or included.

Fields Data structure Data type Short description


|
|
.include <zcust_bdtab> STRU Structure include
|
|
EMPNAME
.APPEND STRU Append include

Steps to append a structure to a standard table:

• Once the standard table is in display mode.


• Click on append structure button.
• Click on create append icon.
• Enter append structure name.
• Click on yes button.
• Create the structure with the required fields.
• Activate the structure.
• Click on back icon.

54
BY MR. BABU (OASIS TECHNOLOGIES)
• Cancel the append structure window.

Differences between INCLUDE and APPEND structures:

INCLUDE APPEND

1. It can be used for the multiple tables. 1. It is specific to particular table or


structure.
2. Can be inserted at any position. 2. It is inserted at the end of table (or)
Structure (after the last field)
3. The table must be in change mode to 3. It can be inserted in display mode
include the structure. also
4. It is not possible for standard tables
or structures without using access 4. It is possible to insert structure for
key. standard tables (or) structure.
5. Possible to add the additional fields 5. It is not possible to add the additional
after INCLUDE structure manually. fields manually after append
structure

4.Search Helps
Introduction:

• These are used to display all the possible entries in the search help window.
• The function key (F4) or search help icon () is pressed to display the search help
window.
• The DDIC search helps are of two types.
o Elementary search help.
o Collective search help.

55
BY MR. BABU (OASIS TECHNOLOGIES)
Elementary search help:

• An elementary search help is defined using one base table or help view

Collective search help:

• It is a collection of elementary search helps.

Steps to create an Elementary Search Help:

• Execute the transaction code SE11.


• Select the radio button search help.
• Enter an elementary search help name to be created.
• Click on create button.
• Click on yes button.
• Enter short description.
• Enter the required table or help view name in the selection method field.
• Enter a search help parameter names, check the check boxes imp, exp…
• Enter L position and S position.
• Press the ‘Enter’ button.

Example:
Search help IMP EXP LPOS SPOS
parameter
NAME1 * * 2 2

NOTE:
 The checkboxes IMP and EXP must be check to import all the possible entries from
the specified table or help view and export the selected entry to the screen fields.
 The position numbers LPOS and SPOS must be filled with the same number to
position the search help window on a screen field.
 The search help exit is used to control the possible entries of a search help.

• Click on activate icon.


• Click on local object icon.
• Click on yes button.
• Click on test icon.
• Press F4 function key or search help icon to see the possible entries.
• Cancel search help window.
• Click on back.

Steps to create a collective search help:

56
BY MR. BABU (OASIS TECHNOLOGIES)
• Execute the transaction code SE11.
• Select the radio button search help.
• Enter the collective search help name.
• Click on create button.
• Select a radio button collective search help.
• Click on yes button.
• Enter short description.
• Enter the search help parameter names, check the check boxes imp, exp and enter
the data element names as below.

Search help parameter Imp Exp Data element


NAME1 * * NAME1_GP

KUNNR * * KUNNR
• Click on the tab included search helps.
• Enter the required elementary search helps.
• Place the cursor on the 1st search help name.
• Click on the button parameters assignment.
• Click on yes button.
• Click on copy button.

Note: Follow the similar steps to assign the parameters for any number of search helps.
• Click on activate icon.
• Click on local object button.
• Click on yes button.
• Click on test icon.
• Press F4 function key.
• Click on an appropriate tabs to see the possible entries.
• Cancel the search help window.
• Click on back.

Different dialog types in DDIC search helps:

1. Display values immediately:

• It is the default option to display all the possible entries immediately.

2. Dialog depends on set of values:

• In case of this option the system gives restrictions window to filter the possible
entries in the search help.

57
BY MR. BABU (OASIS TECHNOLOGIES)
Note: An icon ‘Multiple Selection’ is used to choose the different single values and range.

3. Dialog with value restrictions:

• It is almost similar to 2nd option (dialog depends on set of values).

4. Hot key:

• The hot key property is used to display the elementary search help entries. By
default in case of collective search help.

Search help assignment to table or structure field:

• The domain name of the table or structure field should be similar to the domain
name of search help parameter to assign a search help.

Steps to assign a search help:

• Once the table or structure is in chance mode.


• Place the cursor on the required field.
• Click on search help button.
• Enter the required search help name to be assigned.
• Click on yes button.
• Click on copy button.
• Activate the table or structure.
• Click on contents icon in case of table.
• Press F4 function key on the required field.

5.VIEWS
Introduction:

• Views are virtual tables which can be filled at runtime only.


• They are defined using one or multiple tables.

58
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 2.10: Views

• Views are of 4 types:


1. Data base view.
2. Maintenance view.
3. Help view.
4. Projection view.

1. Database view:

• The database views are defined by joining multiple tables.


• It creates an inner join automatically.
• It can be used to extract the data in the program.

2. Maintenance view:

• The maintenance view is defined to maintain multiple table’s data using the
transaction code SM30.

3. Help view:

59
BY MR. BABU (OASIS TECHNOLOGIES)
• It is used as a selection method in an elementary search help to provide the possible
entries from the multiple tables.

4. Projection view:

• It is used to suppress the unwanted fields of a table.


• It can be defined using one table only.

Steps to create the Database View:

• Execute the transaction code SE11.


• Select the radio button view.
• Enter database view name.
• Click n create button.
• Click on yes button.
• Enter short description.
• Enter the required table name under ‘Tables session’.
• Place the cursor on table name.
• Click on relationship button.
• Check the required relationships.
• Click on yes button.

Note: The transaction code SQVI can also be used to know the join conditions.

Example:

Tables Table Field name = Table Field name


EKKO ELKP MANDT = EKKO MANDT

ELKP ELKP EXNUM = EKKO EXNUM

• Click on view fields tab.


• Click on ‘Table Fields’ button.
• Double click on the required base table.
• Check the required fields to be inserted.
• Click on yes button.

60
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 Follow the similar steps for any number of base tables.
 The field names should not be duplicate in the tables or structures or views.

• Click on activate icon.


• Click on local object button.
• Press the ‘Enter’ button.
• Click on contents icon.
• Click on execute icon.
• Click on back.

Note:
 Follow the similar steps to create the help view by selecting a radio button help
view.
 Help views cannot be executed.

Steps to create Maintenance View:

• Execute the transaction code SE11.


• Select the radio button view.
• Enter the maintenance view name.
• Click on create button.
• Click the radio button maintenance view.
• Click on yes button.
• Enter short description.
• Enter the required table name under table session.
• Place the cursor on the table name.
• Click on relationship button.
• Check the required relationship.
• Click on yes button.
• Click on view fields tab.
• Click on ‘Table Fields’ button.
• Double click on the required base tables.
• Check the required fields along with the key fields
• Click on yes button.

Note: Follow the similar steps to select the fields for any number of tables by clicking on
‘Table Fields’ button.
• Click on maintenance status tab.
• Change the delivery class if required.
• Click on activate icon.

61
BY MR. BABU (OASIS TECHNOLOGIES)
• Click on local object button.
• Click on yes button.
• Click on utilities menu icon.
• Click on TMG.
• Enter authorization group (&NC&).
• Enter functional group name (could be same as table name).
• Select one step maintenance type.
• Enter overview screen number (could be any number).
• Click on create icon.
• Click on local object button.
• Press the ‘Enter’ button.
• Click on back icon.

Note: Transaction code SM30 is used to maintain the data in the maintenance views as
like the custom table.

Steps to create Projection View:

• Execute the transaction code SE11.


• Select the radio button view.
• Enter projection view name.
• Click on create button.
• Select the radio button projection view.
• Click on yes button.
• Enter short description.
• Enter the required base table name.
• Click on ‘Table Fields’ button.
• Check the required fields to be displayed.
• Click on yes button.
• Click on activate icon.
• Click on local object button.
• Press the ‘Enter’ button.
• Click on no button in case of warning.
• Click on contents icon.
• Click on execute icon.

6.LOCK OBJECTS
Introduction:

62
BY MR. BABU (OASIS TECHNOLOGIES)
• They are used to control the parallel access for the same data by the multiple users.
i.e., the synchronous access to the same data is provided using lock objects.
• The lock object name should start with ‘E’ followed by the table name.
Example:
E<ZCUST_DBNAME> EVBAP
Custom table standard table
• Following are different types of lock modes:-
1. Write lock.
2. Read lock.
3. Exclusive not cumulative.

1. Write lock:

• It is also called an exclusive lock. In case of this lock mode the locked data can be
accessed or processed by single user only. All other lock requests are rejected.

2. Read lock:

• It is also called a shared lock.


• The multiple users can display the same data. If ne user tries to edit the data, all
other users cannot access this data.

Note: All other write locks are rejected but read locks are accepted.

3. Exclusive but not cumulative lock:

• It can be requested only once by the given transaction codes. All other lock requests
are rejected.

Steps to create lock objects:

• Execute the transaction code SE11.


• Select radio button lock object.
• Enter the lock object.
• Click on create button.
• Enter short description.
• Click on tables tab.
• Enter the required table name in the name field.
• Select an appropriate lock mode.
• Click on activate icon.
• Click on local object button.
• Press the ‘Enter’ button.

63
BY MR. BABU (OASIS TECHNOLOGIES)
Note: The system generated two function modules one starts with ENQUEUE* and
another one with DEQUEUE* once the lock object is activated.

ENQUEUE* function module:

• It is used to request for lock.

DEQUEUE* function module:

• To release the lock.

Steps to see the system generated function modules:

• Execute the transaction code SE11.


• Select the radio button lock object.
• Enter the lock object name.
• Click on display button.
• Click on ‘Goto’ menu icon.
• Click on lock modules.

Note: The system generated function modules are appeared.


Example:
ENQUEUE – EZCUST_DBTAB  Request lock
DEQUEUE – EZCUST_DBTAB  Release lock.

Maintain locked objects:

• The transaction code SM12 is used to list out the locked objects and to delete locked
objects.

Steps to list out the locked objects and unlock them:

• Execute the transaction code SM12.


• Click on list button to see the locked objects.
• Select the required locked object to be unlocked.
• Click on delete icon.
• Click on yes button.

64
BY MR. BABU (OASIS TECHNOLOGIES)
Modularization Techniques

They are used to organize ABAP code, make the program more understandable and make use of
code re-usable to avoid the duplicate code.

Following are different types of modularization techniques:

1. Include program
2. Sub routines
3. Macros
4. Function modules
5. Message class.
6. Constants and text symbols

1. Include program: these programs are part of another include programs

→ The programs type for an include program is ‘I’.


→ Include programs cannot be executed independently.
→ The source code in the include programs can be re-used in any programs across
the system by calling them.
→ The ABAP statement “INCLUDE” is used to call or define an include program.

Syntax: INCLUDE <zrep_name_top>.

diagram:

Note: In the real time each main program should have two include programs one with *TOP and

*FORMS.

• In some of the projects there may be separate include *SEL for selection screen.

* TOP Include: It is used for global data declarations such are global types, work areas, internal
tables, variables..etc. It can also be used to specify the selection fields (input fields).

*FORMS Include: It is used for defining the sub routines.


BY MR. BABU (OASIS TECHNOLOGIES)
*SEL Include: This include is used to define the selection screen.

ex: REPORT <ZREP_NAME>

*TOP Include For Data Declaration.

INCLUDE <ZREP_NAME_TOP>

TYPES : BEGIN OF TYP_ ………..

“”

DATA : <GS_DBTAB>…..

<GT_DBTAB>……

*SEL Include For Selection Screen.

INCLUDE<ZREP_NAME_SEL>

SELECTION SCREEN BEGIN OF…

SELECT OPTIONS….

PARAMETERS…

SELECTION SCREEN END OF…

*FORMS Include For Defining Sub Routine.

INCLUDE<ZREP_NAME_FORMS>

FORM <F_SUB_NAME>………..

* Process Block

……………………….

ENDFORM.

There are two ways to create include program.


BY MR. BABU (OASIS TECHNOLOGIES)
 1st way to create incl`ude program:

→ Once the main program is in change mode.


→ Enter the abap statement include followed by the include name.

Syntax: REPORT <ZREP_NAME>…

INCLUDE<ZREP_NAME_TOP>.

→ Double click on the include name.


→ Click on ‘yes button.
→ Click on ‘yes’ button.
→ Enter the package name.
→ Click on save icon.
→ Create the ‘TR’ by pressing an icon create request.
→ Click on ‘yes’ icon.
→ Declare the required global data or define the selection screen.
→ Click on ‘pretty printer’.
→ Click on activate button.
→ Press enter.
→ Click on back icon.
→ Activate the main program.

 2nd way to create include program:


→ Execute the T-code SE38.
→ Enter the include program name.
→ Click on create button.
→ Enter title.
→ Select the program type ‘include program’.
→ Click on yes button.
→ Enter the package name
→ Click on save icon.
BY MR. BABU (OASIS TECHNOLOGIES)
→ Create the ‘TR’ if required.
→ Click on ‘yes’ button.
→ Declare the required global data or define the selection screen or sub- routine.
→ Click on pretty printer.
→ Click on activate button.
→ Click on back.

Note: once the main program is in change mode use ABAP statement

‘INCLUDE’ to call the above created include program where ever it is required.
BY MR. BABU (OASIS TECHNOLOGIES)
2. Sub Routines

They are the local modularization techniques.

→ The sub-routines are used to define the reusable functions in the programs.
→ The ABAP statement ‘PERFORM’ is used to call the sub-routines.
→ The ABAP statements ‘FORM….ENDFORM’ are used to define sub-routines.
→ Sub-routines are of two types:
1. Internal sub-routines.
2. External sub-routines.

1. Internal sub routines:

The internal sub-routines are defined and called in the same program.

Syntax to call:

PERFORM <F_INT_SUBROUTINE> [USING <ACT_PARAM1> <ACT_PARAM2>...

CHANGING <CHG_PARAM>..]

syntax to define:

FORM <F_INT_SUBROUTINE>[USING<FORMAL_PARAM1> <FORMAL_PARAM2>

CHANGING <P_CHA_PARAM>..]

*Process Block

ENDFORM.
BY MR. BABU (OASIS TECHNOLOGIES)
2. External sub-routines:

The external sub-routines are defined in one program and called in another program.

Calling program called program

REPORT<zcalling> REPORT<zcalled>

“ “

PERFORM<f_int_sub_routines> (<zcalled_prog>) F5FORM (<f_ext_subroutine>)

“ “

*next program part *process block

[F6- function key] “

WRITE: ‘……’ ENDFORM.

Note: The function key F6 is used to skip or return the subroutine definitions in the debugger.

Actual parameters:

Actual parameters are the parameters which can be called while calling the sub routines (with
PERFORM statement).

Formal parameters: Formal parameters are parameters which can be passed while defining
sub-routines (with FORM statement).

Note:

• The number of actual parameters should be similar to the number of formal parameters.
• The sub-routines definitions should not be nested (form within the form) but, the sub-
routine can be called within the sub-routine.

Ex: FORM<f_sub1>..

FORM <f_sub2>.. Wrong


BY MR. BABU (OASIS TECHNOLOGIES)
ENDFORM.

ENDFORM.

FORM <F_SUB1>

*call sub-routine

PERFORM <F_SUB1>..

“ Right

ENDFORM.

FORM <F_SUB2>

ENDFORM.

2. The statements in between 2 sub-routines definitions cannot be accessed (in between

ENDFORM….FORM)

ex: FORM<F_SUB1>.. PERFORM<F_SUB1>..

ENDFORM. WRITE Right

WRITE… Wrong PERFORM <F_SUB2>

FORM<F_SUB2>

ENDFORM.

 Steps to create sub routines:


→ Once the program is in change mode.
→ Write the ABAP statement ‘PERFORM’ followed by form name wherever it is required.

Ex: PERFORM<F_SUB1> or PERFORM<F_EXT_SUB>(<ZCALLED>).


BY MR. BABU (OASIS TECHNOLOGIES)
→ Double click on the sub-routine name (F_SUB1).
→ Click on yes button.
→ Select the *FORMS include program or the main program name.
→ Implement the required business login (process block).

 Different methods to pass the parameters.


Method Description Effect
By reference It is the default method. It The actual parameters are
passes the pointer to main impacted with the formal
memory. parameters.

By value The system allocates new The actual parameters are


memory within the sub- not impacted with the
routine definition. The formal parameters.
allocated memory is free.

By value and return It is almost similar to by The actual parameters are


value but the only changed with the formal
difference is the formal parameters.
parameter values are
returned to actual
parameters
BY MR. BABU (OASIS TECHNOLOGIES)

Note: The internal tables can also be passed to sub-routines using below syntax.

syntax:

PERFORM<F_SUB>TABLES<INT_TAB_NAME>……

FORM <f_sub> TABLES <p_int_tab_name> STRUCTURE <dbstr/dbtab/…>

LIKE <dbstr/dbtab/..>

TYPE TABLE OF <dbstr/dbtab/..>

*Process Block

ENDFORM.

Demo program on all the methods and internal and external sub-routines
‘ZINCL_SUB_ROUTINES’.
BY MR. BABU (OASIS TECHNOLOGIES)
3. Macros

They are the place holders which can be replaced with the corresponding parameter

Values at runtime.

→ The macros are used for the complex write statements and for long calculations.
→ Up to 9 place holders can only be used with a macro.
→ The ABAP statement “DEFINE……END-OF-DEFINITION” is used to define a macro.

Syntax to define a macro:

DEFINE <macro_name>

<gv_result> = &1, &2, &3…..”Place holders.

END-OF-DEFINTION.

Syntax to call macro:

<macro _name><pass_param1><pass_param2>.

Note:

• The macro definitions cannot be debugged.


• The number of place holder should be similar to number of passing parameters.

Ex: the place holders are replaced with the corresponding passing parameters as below.

&1 &2 &3.

<pass_param1> <pass_param2> <pass_param3>

Demo program on macros ‘ZDEMO_MACRO’.


BY MR. BABU (OASIS TECHNOLOGIES)

4. Function modules

→ The function modules are global modularizations objects.


→ The functions modules can be called anywhere in the same system and in another system
also.

→ The function modules are maintained in functional pool (function builder).


→ The T-code ‘SE37’ is used to work with the functional modules.
→ The functional modules should be assigned to a function group.

Function group: it is a collection of function modules.

Diagram:

→ Function modules are of three types:


1. Normal function module.
2. Remote enable module.
3. Update module.
1. Normal function module: The normal function modules can be defined and called
in the same system to reuse the central source code.
BY MR. BABU (OASIS TECHNOLOGIES)
2. Remote enabled module: The remote enabled functions are defined in one system
and can be called outside of the system (another system).
SAP R/3  SAP CRM/.NET/JAVA
3. Update module: The update function module is used for SAP LUW (Logical Unit of
Work). These FMs are triggered in case of implicit or explicit COMMIT WORK is
encountered.
• Update FMs are registered in table VBLOG

COMMIT WORK statement: It is used to make changes in data permanently


and complete current SAP LUW.

Syntax: COMMIT WORK [AND WAIT].

ROLLBACK WORK statement: It is used to terminate current SAP LUW


without making changes in database.

Syntax: ROLLBACK WORK.

Syntax to call function module:

CALL FUNCTION ‘<FUNCTION/ZFUNCTION> ‘[DESTINATION../IN UPDATE TASK]

EXPORTING

Imp..Param1 = “From Calling Program”

IMPORTING

Exp..Param1 = “To Calling Program”

CHANGING

Chg..Param1 = “Import->Change-> Export to Calling Program”

TABLES
BY MR. BABU (OASIS TECHNOLOGIES)
Int_Tab = “Import and Export Internal Tables”

EXCEPTION

Not_Found = “To Calling Program”.

Syntax to define Function Module:

FUNCTION <FUNCTION/ZFUNCTION>.

*Process Block

ENDFUNCTION.

 Different tabs or components in function modules:

Following are different tabs or components in function modules.

a. Attributes:
It contains technical properties of a function module such are type of function
module, function group.
b. Import parameters:
The import parameters are imported from the calling programs.
→ The import parameters are mandatory fields unless the optional check boxes are
checked.
→ They cannot be changed in the function modules.
c. Export parameters:
The export parameters are used to export the data from the function modules to the
calling programs.
→ The export parameters always optional parameters.

Note: It is not possible to make export parameters as mandatory.

d. Changing parameters:
The changing parameters are imported from the calling programs, changed them in
the function modules and returned to calling programs.
BY MR. BABU (OASIS TECHNOLOGIES)
e. Tables parameters:
They are used to import and export the internal tables.
f. Exception:
They are used to raise the messages in the function modules.
→ The system generates the messages automatically when CALL FUNCTION is failed.
g. Source code:
It is used to write central ABAP source code.

Note: the parameters of function module are import, export, changing tables, exceptions.

 Steps to create a function group:


→ Execute the T-code ‘SE80’.
→ Select function group under object selector.
→ Enter a function group name.
→ Press enter button or display icon.
→ Click on ‘yes’ button.
→ Enter shot text.
→ Click on ‘yes’ button
→ Enter the package name.
→ Click on save icon.
→ Click on create request icon.
→ Enter short description for TR(Transport Request) as per the project standards.
→ Click on ‘yes’ button.

 Default include programs in the function groups:


→ The system generates two ‘INCLUDE’ programs.
→ One ends with ‘*TOP’ and another with ‘*UXX’ when the function group is created.
1. *TOP include:
It can be used to declare or define global data which can be accessed in all the
function modules of function group.
BY MR. BABU (OASIS TECHNOLOGIES)
Ex: <zfun_grp>TOP
*Global data declaration
DATA: gv_var…
2. *UXX include:
It is a collection of another sub include program.
→ Each sub-include program of ‘*UXX’ include is related to the corresponding function
modules
Ex :<zbxx_fun_grp>UXX.
INCLUDE <zbxx_fun _grp>U01
“zfun_module1”.
INCLUDE <zbxx_fun_grp>U02
“zfun_module2”.

Note: The customer specific include programs can also be defined such as “*FORMS’ include for

Defining sub-routines.

 Demo on function modules:


→ Create the function module to do mathematical calculations centrally.

 Steps to create a normal function module:


→ Execute the t-code ‘SE37’.
→ Enter the function module name.
→ Click on create button.
→ Enter the existing function group name.
→ Enter the short text.
→ Click on ‘yes’ button.
→ Press ‘enter’ button.
→ Define below import parameters.
BY MR. BABU (OASIS TECHNOLOGIES)
Import
Parameter Type Associate type Default value Optional
name:
Im_input1 Type I 3000

Im_input2 Type I 3000

Note: The import parameters are optional parameters in case of the default values.

→ Click on the tab export and define the below export parameters.
Export
Parameter name Type Associate type Pass value
Ex_add Type I
Ex_sub Type I “
Ex_mul Type I “
Ex_div Type I “
Ex_rem Type I “

→ Click on ‘exceptions’ tab and define the required exceptions.


Exceptions
Exception Short text Long text
Not_found Data not found “

Note: The long text of an exception can also be maintained by clicking on button under long
Text column.
→ Click on ‘save’ icon.
→ Click on ‘source code’ tab
→ Implement the required business logic within the system generated statements within
function and end function after the system generated comments.
BY MR. BABU (OASIS TECHNOLOGIES)
Ex :
FUNCTION <ZMATH_OPS>

IF IM_INPUT1 EQ SPACE AND IM_INPUT2 EQ SPACE.
*Raise Exception
RAISE NOT FOUND
*Mathematical Calculations
EX_ADD = IM_INPUT1 + IM_INPUT2,
EX_SUB = IM_INPUT1 - IM_INPUT2,
EX_MUL = IM_INPUT1 * IM_INPUT2,
EX_DIV = IM_INPUT1 / IM_INPUT2,
EX_REM = IM_INPUT1 MOD IM_INPUT2.
ENDIF.
ENDFUNCTION.
Note: The denominators value must be checked when the division calculation is done otherwise
The program may got to short dump or runtime error in case of null value.
Ex: IF <GV_STR> NE 0 OR NE SPACE.
GV_RESULT = <GV_NUM/GV_DENOM>.
ENDIF.

→ Click on ‘pretty printer’ Button.


Note: The button function module documentation is used to maintain the documentation of
Function modules.
→ Click on activate icon.
→ Press ‘enter’ button.
→ Click on back.

 Steps to execute function module:


→ Execute the T-code ‘SE37’.
→ Enter the required function module name.
BY MR. BABU (OASIS TECHNOLOGIES)
→ Click on ‘test’ or ‘execute’ icon.
→ Fill the required imported parameters.
→ Click on execute icon.
Note: The button debugging is used to debug a function module from the 1st statement.
→ Click on back icon.

 Steps to create variant for function modules:


→ Once the function module is executed.
→ Fill the required import parameters and changing parameters.
→ Click on save icon.
→ Enter comment.
→ Click on ‘yes’ button.
→ Click on test data dictionary button.
→ Double click on the required data record number or short text.
→ Click on execute.

 Steps to search for a functional modules:


→ 1st way of using SE37:
→ Execute the T-code ‘SE37’.
→ Enter an appropriate search option.
Ex: STRING* or *REV*.
→ Press F4 function key.
→ Click on find icon.
→ Enter the required find string (reverse).
→ Press ‘enter’ button.
→ Click on found function module name.
→ Double click on the found function module name.
Note: Test the function module and make use of it in the program.
Note: The standard table ‘TFDIR’ can also be used to find FMs since it contains all the
Functional module in the system.
BY MR. BABU (OASIS TECHNOLOGIES)
 Steps to call a functional module:
→ Once the program or source code is in change mode.
→ Place the cursor where the functional module to be called.
→ Click on pattern button.
→ Enter the required function module name or search pattern.
→ Click on ‘yes’ button.
→ Uncomment the required import parameters.
→ Pass the data variables such are variables, work areas, internal tables.
→ Uncomment the exceptions.
Note:
• Uncomment the system generated messages in case of the function module called
outside the loop statements.
• Do not uncomment the system generated messages in the function module which
are called within the loop.
• The data types of the passing data variables and data types of the parameters in
the function modules should be similar.
• If any data conflict is happened the program will go to run time error (short
dump).

 Demo on functional module on changing and tables parameters:


→ Define the below changing parameters.
Parameter name Type specific Associated type
IM_EBELN-LOW TYPE EBELN
IM_EBELN-HIGH TYPE EBELN
→ Define the below tables or Export parameters.
Parameter name Type specific Associated type
ET_EKKO TYPE ZBXX_EKKO_TABLETYP
ET_EKKO LIKE ZBXX_EKKO_STRCTR
BY MR. BABU (OASIS TECHNOLOGIES)
Here ZXX_EKKO_TABLTYP is a DDIC table type and
ZXX_EKKO_STRCTR is DDIC structure name.
Note:
The elementary data types (I/P/F/C/STRING…) And the DDIC objects such are fields, data
Elements, tables, structures, table types can only be referred for defining the parameters in the
Function modules.
 Difference between sub-routine and function modules:
Sub Routines Function modules
They are local modularization objects. They are global modularization objects since
the function modules are maintained in the
function.
Cannot be executed independently. Can be executed independently using t-
code’se37’
They cannot be used outside of the system. They can be used outside of the system also
using remote enabled function (non-sap).
Exceptions are not possible. Exceptions can be raised.

 Raise statement:
This statement is used to raise the exception in function module.
Syntax:
RAISE <NOT-FOUND>.
Here <not-found> is the maintained exception.
BY MR. BABU (OASIS TECHNOLOGIES)
 Different types of data declarations:
There are two types of data declarations.
1. Global data declarations.
2. Local data declarations.
1. Global data declarations:
All the global data variables, work areas, internal tables etc. are declared after the
REPORT statement or in the “*TOP” Include programs.
→ The global data variables can be accessed anywhere in the program or function Modules

Note: In most of the projects the global data declarations should start with ‘G*’.

GV* = Global Variables

GT* = Global internal Tables.

GC*= Global Constants

………………………………….

2. Local data declarations:


The local data variables such are variables, work areas, internal tables and etc. are
declared within the sub-routine or function modules or module definitions.
→ The local data variables can only be accessed within the sub-routine or function module
or module definitions only but not outside of them.
Note: In most of the projects the local data declarations should start with”L*”.

LV* = Local Variables.

LT* = Local internal Tables.

LC* = Local Constants.

…………………………
BY MR. BABU (OASIS TECHNOLOGIES)
Note: Use the local data variables as much as possible in the real time, since the allocated

Memory is freed once the sub-routine or function module or Module is ended.

Ex: REPORT <zrep_name>.

*Top Include For Global Data Declarations.

INCLUDE <zrep_name_top>.

DATA: gv_variable……

gt_dbtab……….

PERFORM <f_sub_routine> [USING……]

FORM <f_sub_routine> [USING……]

*Local Data Declaration.

DATA: lv_variable…………

ENDFORM.
BY MR. BABU (OASIS TECHNOLOGIES)
5. Message class
Messages: They are used to give messages for instructing the users.
• The users and analyze messages and re-enter the input values.
Following are different types of messages.
Message type Description
*E-Error Gives Message with ‘X’ mark on the status bar and stops the next part
of program (Message + STOP).

*S-Success Continuous with the next part of program by giving message with tick
‘√’ mark on status bar.

W-Warning Gives message with an explanatory mark ‘!’ on the status bar and
continues with the next part of program once enter button is pressed.
Note: Warning messages can be ignored by pressing enter button.

*I-Information Gives message on information pop up with a symbol ‘I’ and continues
with the next part of program or source code once ‘YES’ button is
pressed.

A-Abort Gives message on cancel pop-up window with stop icon and exits out of
the program to an initial screen of sap once exit button is pressed.

X-eXit This message terminates the program by giving short dump or runtime
error

→ The ABAP statement “MESSAGE” is used to give the messages or raise the message.
Syntax to give message without using message class.
MESSAGE ‘<Message text>’ ‘TYPE’ ’E/I/S/W..’.
BY MR. BABU (OASIS TECHNOLOGIES)
Message class: It is used maintain the messages centrally.
→ The message classes can be used anywhere in the system.
→ The T-code ‘SE91’ is used to maintain message classes.

Note: up to 1000 (0-999) messages can only be maintained in each message class.

 Steps to maintain a message class:


→ Execute the t-code ‘SE91’.
→ Enter the message class name.
→ Enter short text.
→ Click on package name.
→ Click on save icon.
→ Create the ‘TR’ by pressing an icon create request.
→ Click on ‘yes’ button.
→ Maintain the required message text along with a place holder.

Note: The button long text is used to maintain long message text.

Ex:
Message no: Message text
001 Please provide a valid input.
002 &1, &2, &3.

→ Click on save icon.


→ Click on back icon.

 Different ways to make use of message class:


→ 1st way-using the REPORT statement addition MESSAGE-ID.
Syntax: REPORT <zrep_name> MESSAGE-ID <ZXX_MSG_CLASS>.
BY MR. BABU (OASIS TECHNOLOGIES)

*Give Message
MESSAGE E/I/S<XXX>.

Message no.
→ 2nd way-by specifying message-id:
syntax: MESSAGE E/I/S<xxx>(ZXX_MSG_CLASS).

Message class name.


Note: The place holders of message are replaced with the corresponding values at run time.
Syntax:
MESSAGE <E/I/S/001> WITH‘<TEXT>’ <S_FIELD_LOW/S_FIELD_HIGH/P_FIELD>…

6. Constants and text symbols


They are used to avoid the hard coded texts and reuse them in the program.

→ The difference between constants and text symbols is the text symbols can be translated
in different languages, but CONSTANTS cannot be translated.
Note: In the real time the hard coded text are not preferable.
Syntax for constants:
CONSTANTS: <GC_TEST> TYPE<I/C/…..> VALUE ‘<VALUE>’.
Syntax for text symbols:
TEXT-<XXX>.
Here <XXX> is the text symbol name.

 Steps to define text symbols:


→ Once the program is in change mode.
→ Write the text symbol name or use the path goto  text elements  text symbols.
→ Double click on the text symbols name.
→ Click on ‘yes‘ button.
→ Press enter.
BY MR. BABU (OASIS TECHNOLOGIES)
→ Maintain required text (up to 13 characters).
→ Click on activate.
→ Click on ‘yes’ button.
→ Press enter.
→ Click on back.
Note:
• Follow the similar steps to create or define any number of required text symbols.
• The T-code ‘SE63’ is used to translate the text elements.

Selection texts: The selection texts are used to maintain the descriptions or labels for the
Input fields of the selection screen.

 Steps to maintain selection texts:


→ Once the program is in change mode.
→ Click on goto menu item.
→ Click on text elements.
→ Click on selection texts.
→ Maintain the required instead of ‘?...’.
Note:
• The checkbox dictionary reference is enabled for the input fields which are
defined by referring data dictionary (fields or data elements)
• If the dictionary reference checkbox is checked the selection text will be copied
from the DDIC (data elements).
Ex: Name Text Dictionary reference
p_num number
p_matnr number -/

→ Click on activate.
→ Press enter.
BY MR. BABU (OASIS TECHNOLOGIES)
→ Click on back.
→ Activate the program.

 Text element translations:


The transaction code ‘SE63’ is used to translate the different types of text elements.

 Steps to translate the report text elements:


→ Execute the T-code ‘SE63’.
→ Click on the menu item translations.
→ Click on ABAP objects.
→ Click on short texts
→ Expand ABAP tests-S3.
→ Double click on the required text type (REPT-text elements).
→ Enter the object name.
→ Select the source language (EN-English).
→ Select the target language (DE-German).
→ Click on edit button.
→ Maintain the required translated text.
Note: use any translations to translate the text.
BY MR. BABU (OASIS TECHNOLOGIES)

Events
The ABAP is an event driven programming language with events are triggered in the particular
order by driver program.

An event is a process block set of line statements or collection of statements.

An event start with the event name and ends with the next event beginning.

Syntax: *Begin of an event*

INITIALIZATION

*Process block

*Begin of an event by ending previous events

AT SELECTION - SCREEN…….

*Process block

*Main program Beginning

START – OF – SELECTION “Default event”.

*Process block

NOTE: The Default event for each executable program is START -OF- SELECTION.

Classical Reports
Classical reports are the simple repots to extract the data from the data
and display the process the database table or data base view, process the extracted
data and display the processed final data using the WRITE statements within the loop
statements.

Events Associated with classical Reports:

Following are the different types of events of classical reports which are triggered in the
same order.

1. LOAD-OF-PROGRAM

2. INITIALIZATION

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
3. AT SELECTION SCREEN: A) AT-SELECTION-SCREEN OUTPUT

B) AT-SELECTION-SCREEN ON VALUE

C) AT-SELECTION-SCREEN ON REQUEST FOR

D) AT SELECTION SCREEEN ON

E) AT-SELECTION-SCREEN

4. START-OF-SELECTION

5. END-OF-SELECTION

6. TOP-OF-PAGE

7. END-OF-PAGE

NOTE: The events LOAD-OF-PROGRAM, INITIALIZATION, AT-SELECTION-SCREEN events,


END-OF-SELECTION are common events for any type of reports.

1. LOAD-OF-PROGRAM:

This event is triggered before INITIALIZATION event while loading a program.

Syntax: *trigger before INITIALIZATION

LOAD-OF-PROGRAM

2. INITIALIZATION:

This event is triggered before the selection screen or input screen is displayed.

1, it is used to clear and refresh the data variables.

2, it can also be used to pass the default values to the selection fields or input fields and data
variables.

NOTE: This event is not used in the real time.

SYNTAX: *Trigger before selection-screen

INITIALIZATION

*Clear, Refresh the data variables

PERFORM < f-clear-refresh >

*Default values

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
PERFORM < f-default-value >

FORM < f-clear-refresh >

CLEAR: < GV_VAR >,

< GT_ DBTAB>

REFRESH: < GT_DBTAB>,

ENDFORM

3. AT-SELECTION-SCREEN Event:

They are triggered while performing any action in the selection screen.

They can also be triggered after input value or data is provided in the selection screen.

Then perform any action.

The AT -SELECTION- SCREEN events are used to format the selection-screen dynamically
and validate or check the input data.

Following are some of the useful AT-SELECTION-SCREEN events.

a) AT SELECTION-SCREEN OUTPUT
b) AT SELECTION-SCREEN ON HELP-REQUEST FOR
c) AT SELECTION-SCREEN ON VALUE HELP-REQUEST FOR
d) AT SELECTION-SCREEN ON

AT SELECTION-SCREEN OUTPUT Event:

This event is triggered after INITIALIZATION event.

It can also be triggered while performing any action in the selection screen.

This event is used to format the selection screen

SYNTAX:

*Triggers after INITIALIZATION

AT SELECTION-SCREEN OUTPUT

*Format selection screen dynamically

PERFORM < F-format-screen-din >

FORM <F- format –din >

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
LOOP AT SCREEN

IF SCREEN- NAME = ‘< S_FIELD_HIGH/P_FIELD>’

SCREEN-ACTIVE =’< 1/0>’

MODIFY SCREEN.

ENDIF

ENDLOOP

ENDFORM

STANDARD STRUCTURE SCREEN:

This structure is field with all the attributes or the properties of all selection field or the input
field in the selection screen.

It behaves like an internal table since it holds each selection field properties at run-time.

Following are some of useful fields in the standard structure screen.

FIELD DESCRIPTION

1) NAME Name of the selection field or input field


2) GROUP Modification group names which are specified using
an addition ‘ MODIF ID’.
3) REQUIRED Makes the input field mandatory.

1->Mandatory

0-> Optional

4) INPUT makes the selection fields (or) input fields as input

(or) output fields

1-> Input for editable mode

2->display mode (non-modifiable mode).

5) OUTPUT makes the selection fields (or) input fields as output

(or) input fields

1->output

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
0->input

6) ACTIVE To make the selection screen fields appear (or) hide.

1->appear

2-> hide.

NOTE:

1) The ‘SELECTION-SCREEN-OUTPUT’ event is also called as process before output event


(PBO) event in reports.
2) ‘AT-SELECTION-SCREEN ON VALUE-REQUEST FOR’ event is triggered when the function
key F4 (OR) the ‘search help’ icon is pressed.
3) ‘AT-SELECTION-SCREEN ON VALUE-REQUEST FOR’ event is used to display the
populated data (possible entries) in a search help window.

AT-SELECTION-SCREEN ON VALUE-REQUEST FOR:

It is also called as PROCESS-ON-VALUE-REQUEST (POV) event in report.

The standard function module “F4IF_INT_TABLE_VALUE_REQUEST” is used to display the


search help with the populated possible entries.

SYNTAX: :

*Triggers with F4 function key (or) search help icon is pressed*

AT-SELECTION-SCREEN-ONVALUE-REQUEST FOR<S_FIELD-LOW/S_FIELD-HIGH/P_FIELD>.

*Populate possible entries and display search help*

PERFORM <F_SEARCH_HELP>.

FORM <F_SEARCH_HELP>.

EXPORTING

: RETURN

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
*get the data*

SELECT <F1>,

<F2>,

INTO TABLE <lt_shelp>

*display search help*

CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’

EXPORTING

: ret_field = <s_field-low/…………..>.

: value_org = ‘s’.

TABLES

Value_tab = <lt_shelp> “possible entries”

Return_tab = <lt_return> “selected entries”

*pass selected entry to input field*

READ TABLE <lt_return> into <ls_return> INDEX 1.

<s_field-low/s_field-high/p_field> = <LS_RETURN>-field value.

ENDFORM.

AT-SELECTION-SCREEN ON HELP REQUEST FOR:

This event is triggered when the function key F1 (or) help icon is pressed. It is used to provide

The help documentation on the screen fields.

The transaction code ‘SE61’ (or) ‘SO72’ is used to maintain the help documentation as per

The specification.

The standard function module “HELP_OBJECT_SHOW’ (WITH TECHNICAL


INFORMATION) and ‘DSYS_SHOW_FOR_F1HELP’ (WITH TECHNICAL INFORMATION) is used
to the maintained documentation.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
NOTE:

This event is also called as ‘PROCESS-ON-HELP REQUEST’ event.

SYNTAX: :

*Triggers when F1 (or) help icon is pressed*

AT-SELECTION-SCREEN ON-HELP REQUEST FOR <S_FIELD-LOW/S_FIELD-HIGH/P_FIELD>.

*Display help documentation*

PERFORM <F_HELP_DOCU>…..

FORM <F_HELP_DOC>.

*Help documentation with technical information*

CALL FUNCTION ‘HELP_OBJECT_SHOW’.

(OR)

*Help documentation without technical information*

CALL FUNCTION ‘DSYS-SHOW_FOR_F1HELP’.

ENDFORM.

AT-SELECTION-SCREEN-ON:

This event is triggered after the input values provided in the selection screen .

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
It is used to validate (or) check the input data of the selection screen.

It can be used on the particular selection field (or) input field.

SYNTAX: :

*Triggers after input data is provided on the specified input field*

AT-SELECTION-SCREEN ON <S_FIELD/P_FIELD>.

*Validate (or) check input field data*

PERFORM <F_VALIDATE_FIELD>;

FORM <F_VALIDATE_FIELD>.

*Get the data based on the input data*

SELECT……………

Into ………………..

Where <f1> in S_field.

(or)

<f2> = p_field.

IF SY-SUBRC NE 0.

*Give message*

MESSAGE ‘<message text>’ type ‘<E/S/I>’.

ENDIF.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
ENDFORM.

START-OF-SELECTION:

It is the default event and mandatory event to execute any executable program (or) report.

The main program begins with this event.

This event is triggered after all the selection screen events are processed.

It is used to specify the data extraction statements.

SYNTAX : :

*After selection screen id processed*

START-OF-SELECTION.

*Extract the data*

PERFORM <F_GET_DATA>.

FORM<F_GET_DATA>.

SELECT <f1>

<f2>

From <dbtab>

Into table <gt_dbtab>

Where <condition1> and

<condition2>……..

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
ENDFORM.

NOTE: If no one event is used in the executable program, the entire program will be triggered

(or) processed under START-OF-SELECTION since it is the default event.

END-OF-SELECTION:

It is continuous event to START-OF-SELECTION EVENT.

It is triggered after START-OF-SELECTION event is processed.

It is used to specify the data process statements.

SYNTAX: :

*Triggers after START-OF-SELECTION*

END-OF-SELECTION.

*Process extracted data populate final data*

PERFORM<F_PROCESS_DATA>.

FORM<F_PROCESS_DATA>.

LOOP AT <gt_base> INTO <gs_base>.

*read table*

READ TABLE <gt_dbtab> INTO <gs_dbtab>.

IF SY-SUBRC = 0.

*Move data to final internal table*

MOVE <gs_dbtab-f1> TO <gs_final-f1>.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
ENDIF.

*Append final internal table*

APPEND <gs_final> TO <gt_final>.

ENDLOOP.

TOP-OF-PAGE:

This event is triggered with the first ULINE (or) WRITE statement in the program.

It is used to specify the column headings for the classical reports.

SYNTAX: :

*First ULINE (or) WRITE Statement*

ULINE/WRITE………..

*Triggers with the First ULINE (or) WRITE Statement.*

TOP-OF-PAGE.

*Populate column headings(or) header*

PERFORM<F_POP_HEADER>.

FORM<F_POP_HEADER>.

WRITE’<column heading or header>’.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
:

ENDFORM.

END-OF-PAGE:

This event is triggered after the current page is ended before the new page is
displayed.

The report addition LINE COUNT must be specified to trigger this event.

It is used to display the footer details of a page such as totals……etc.

NOTE:

This event can also be triggered with an ABAP statement ‘NEW PAGE’.

The output list should have more than 67 records (or) lines to trigger this event.

SYNTAX: :

* triggers after the current page is ended before the new page is displayed*

END-OF-PAGE.

*Populate footer data*

PERFORM<F_FOOTER_DATA>.

FORM<F_FOOTER_DATA>.

WRITE’<footer data>’.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
ENDFORM.

SKELETON OF CLASSICAL REPORTS:

REPORT <ZREP-NAME> LINE-COUNT<N> MESSAGE-ID<ZMSG_CLASS>.

*Top includes for global data declarations*

INCLUDE<ZREP-NAME>-TOP.

*SEL include for selection screen*

INCLUDE<ZREP-NAME>-SEL.

*FORM include for defining sub routines*

INCLUDE<ZREP-NAME>-FORMS.

*Triggers before selection screen*

INITIALIZATION.

PERFORM<F_CLASS_REFRESH>.

*Triggers while performing any action in the selection screen*

AT SELECTION-SCREEN OUTPUT.

PERFORM<F_FORMAL_SCREEN>.

*Validate input data*

AT SELECTION-SCREEN ON <S_FIELD/P_FIELD>.

PERFORM<F_VALIDATE_INPUT>.

*Main program begins*

START-OF-SELECTION.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
PERFORM<F_GET_DATA>.

*Process extracted data*

END-OF-SELECTION.

PERFORM<F_PROCESS_DATA>.

NOTE:

1. Up to END-OF-SELECTION events are common for any type of report (or) migration.

2. Display data in the first basic list and TOP-OF-PAGE and END-OF-PAGE events are

specific to classical Reports.

*Trigger with first WRITE (OR) ULINE STATEMENT.

TOP-OF-PAGE.

PERFORM<F_DISPLAY_DATA>.

*Display footer details*

*Trigger before new page is display*

END-OF-PAGE.

PERFORM<F_DISPLAY_FOOTER>.

INNER JOINS:

It is used to extract the data from the multiple tables by joining them.

NOTE:

1. Cluster & pooled tables cannot be used with joins.

2. Up to 2 tables can only be joined.

SYNTAX: SELECT <a~f1>

<a~f2>

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
:

<b~g1>

<b~g>

Into table <gt_dbtab1_dbtab2>

From <dbtab1>as <a>

Inner join <dbtab2> as <b>

On <a~f1> = <b~f1> AND

Where <a~f2> in <s_f2> AND

<b~g1> in <s-g2>

Here ‘<a>’ is an alias name for the first database table <dbtab1>.

‘<b>’ is an alias name for the first database table <dbtab2>.

NOTE: The database name can also be used instead of alias name.

SYNTAX: SELECT <dbtab1~f1>

<dbtab1~f2>

<dbtab2~g1>

<dbtab2~g2>

FOR ALL ENTRIES Statement:

This statement is used to extract the data from the database table based on the entries of the
base internal table. It is advisable instead of joining more than two tables.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: 1.The base internal table must be checked whether it has data or not before is used with

‘FOR ALL ENTRIES’.

2. The SELECT statement extracts all the data without considering ‘FOR ALL ENTRIES’.

In case of a base internal table is empty and not checked.

SYNTAX: :

*Check base internal table*

IF NOT <gt_dntab1_dbtab2>[] is initial.

SELECT <h1>

<h2>

From <dbtab3>

Into table <gt_dbtab3>

For all entries in<gt_dbtab1_dbtab2>

Where <f1> = <gt_dbtab1_dbtab2-f1> and

<f2> IN <s-f2>………..

ENDIF.

NOTE: The ‘FOR ALL ENTRIES’ statements can also be used by inner join.

SYNTAX:

IF NOT <GT_DBTAB3> [] IS INITIAL.

SELECT <a~f1>

<a~f2>

<b~g1>

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
<b~g2>

INTO TABLE <gt_dbtab4_dbtab5>

FROM <dbtab4>AS <a>

INNER JOIN <dbtab5> AS <b>

On <a~f1> = <b~f1> AND

FOR ALL ENTRIES IN <gt_dbtab3>

WHERE <a~f2> IN <s_f2> AND

<b~g1> IN <s_g2>

ENDIF.

NOTE:

Use ‘READ TABLE’ statement within the base internal table loop.

SYNTAX:

LOOP AT <gt_dbtab1_dbtab2> INTO < gs_dbtab1_dbtab2>.

*Move data into final internal table*

MOVE : <gs_dbtab-f1> TO <gs_final-f1>,

*Read another internal table*

READ TABLE <gt_dbtab3> INTO<GS_DBTAB3> WITH KEY <a> = <gs_dbtab1_dbtab2-f1>

(OR)

READ TABLE <gt_dbtab>……………………..INDEX SY-TABIX.

IF SY-SUBRC = 0.

MOVE : <gs_dbtab-f1> TO <gs_final-f1>,

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
ENDIF.

*Read another internal table*

READ TABLE <ggt_dbtab4>………….

*Fill final internal table*

APPEND <gs_final> to <gt_final>……………

ENDLOOP.

*Display data - - - - -- *

LOOP AT <gt_final> into <gs_final>.

WRITE: / <gs_final-f1>,

CLEAR : <gs_final>.

ENDLOOP.

DESCRIBE TABLE:

This statement is used to get total number of records in an internal table.

SYNTAX:

DESCRIBE TABLE <gt_final> LINES <gv_total>.

NOTE:

The statement field sy-dbcnt holds the total no of extracted records from the
database tables (or) database views.

INTERACTIVE REPORTS
They are used to provide the detailed drill down list based on the current output list.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
An interactive between the multiple list can be provided using this concept.

Up to 20 Secondary (or) drill down lists can only be provided including basic list, the total
no. of lists are 21.

Note:-

The program goes to runtime error (or) short dump in case of more than 20 Secondary
lists are provided.

The system field SY-LSIND holds the index of next drill down list.

Events associated with interactive (or) drill down classical report :-

1. AT LINE-SELECTION.

2. TOP-OF-PAGE-DURING LINE-SELECTION.

3. AT USER-COMMAND.

4. AT PF.

AT LINE-SELECTION :-

This event is triggered when the record (or) list line is selected (click (or) double click)
in the current list.

The system field SY-LSIND holds the index of the next drill down list of the current list.

It is used to provide the detailed list based on the current list.

SYNTAX: - :

* Display Basic list.

LOOP AT <gt_basic> into <gs_basic>.

WRITE: _ _ _ _ _ _ _ _ .

* Hides selected field value.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)

CASE SY-LSIND.

* 1st drill down.

WHEN '1'.

LOOP AT <gt_first> INTO <gs_first> WHERE <f> = <gs_basic-f1> / <gv_f1>.

WRITE: _ _ _ _ _ _ _ _ _ _ .

HIDE <gs_first-g1> / <gv_g1> _ _ _ _ _.

ENDLOOP.

HIDE STATEMENT :-

The statement is used to hide the selected field / row value which can be passed to the
corresponding drill down list to filter the unwanted records.

SYNTAX :- :

:
BY MR. BABU (OASIS TECHNOLOGIES)
BY MR. BABU (OASIS TECHNOLOGIES)
AT LINE-SELECTION.

CASE SY-LSIND.

WHEN '1'.

* Get selected field value of cursor position / selection.

GET CURSOR FIELD <gs_basic-f1> VALUE <gv_value>.

PERFORM <f_display_first>.

FORM <f_display_first>.

LOOP AT <gt_first> INTO <gs_first> WHERE <f1> EQ <gv_value>.

ENDLOOP.

TOP-OF-PAGE DURING LINE-SELECTION :-

This event is triggered with First "WRITE" (or) "Value" statement of the detailed
lists (or) drill down list.

It is used to provide the column headings for the drill down list (or) secondary
list.

SYNTAX :-

WRITE / ULINE.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)

* Triggers when the record (or) field is selected in the current list.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN '1'.

WHEN '1'.

* Column headings of 1st drill down list.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
WRITE <column>.

ENDFORM.

AT PF :-

This event is triggered when the menu item (function key) is pressed.

This event is used to provide the additional functionality based of the selected menu
item.

The system field SY-PFKEY holds the selected function key of the menu.

SYNTAX :-

AT PF.

* Call the menu status.

SET PF-STATUS '<zmenu_status>'.

CASE SY-PFKEY

* Additional functionality

WHEN '<CRT>'.

* Call create T-code

WHEN '<DEL>'.

* Delete the data

ENDCASE.

SET PF-STATEMENT :-

This statement is used to call the menu status.

SYNTAX :-

SET PF-STATUS '<zmenu_status>' [EXCLUDING <gv_exclude_tab>]

Here <zmenu_status> is the custom menu status name '(Should be mentioned in uppet case)'.

- - - - EXCLUDING addition :-

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)
This addition is used to exclude(Hide) the unwanted push buttons or generic
functions (or) menu items.

NOTE :-

The T-code 'SE41' is used to work with menu painter.

AT USER COMMAND :-

This event is triggered when the push button is selected.

This event is used to provide the additional functionality based on the selected push
button.

The system field SY-UCOMM holds the function code of (FCT code) the selected push
button.

SYNTAX :-

AT USER COMMAND.

* Provide the additional interactive functionality.*

CASE SY-UCOMM.

WHEN '<DELT>'.

* Delete functionality

ENDCASE.

NOTE :-

The additional functionality can be provide using only the system fields SY-PFKEY or SY-
UCOMM without using Events 'AT PF and AT USER COMMAND.

BY MR. BABU (OASIS TECHNOLOGIES)


BY MR. BABU (OASIS TECHNOLOGIES)

REPORTS-ABAP Queries and


Fundamentals

Contents ......................................................................................................................................................
REPORTS-ABAP Queries .......................................................................................................................
Programming in ABAP Editor .........................................................................................................................
Different types of ABAP Programs ..............................................................................................................
REPORT Statement ......................................................................................................................................
Some useful additions to REPORT Statement .............................................................................................
Comments ...................................................................................................................................................
WRITE Statement ........................................................................................................................................
Some useful additions to WRITE Statement ..............................................................................................
Data Types...................................................................................................................................................
Pretty Printer...............................................................................................................................................
Elementary Data Types ...............................................................................................................................
Mathematical Operations ...........................................................................................................................
DATA Statement..........................................................................................................................................
TYPE and LIKE Statements...........................................................................................................................
MOVE Statement ........................................................................................................................................
CLEAR Statement ........................................................................................................................................
ULINE Statement .........................................................................................................................................
ABAPDOCU Transaction Code .....................................................................................................................
PARAMETERS Statement.............................................................................................................................
Some useful additions to PARAMETERS Statement ...................................................................................
Mathematical Functions .............................................................................................................................
String Operators ..........................................................................................................................................
Condition or Control Statements ................................................................................................................
Numeric Comparison Operators .................................................................................................................
String Comparison Operators .....................................................................................................................
Loop Statements .........................................................................................................................................

1
BY MR. BABU (OASIS TECHNOLOGIES)
Work Areas, Field Strings, TYPES ................................................................................................................
Internal Tables ............................................................................................................................................
Operations on Internal Tables ....................................................................................................................
SELECT-OPTIONS Statement .......................................................................................................................
RANGES Statement .....................................................................................................................................
SELECTION-SCREEN Statement ..................................................................................................................
Difference between Normal Search and Pointer Search ...........................................................................

Reports

Introduction:

Reports are used to extract the data from the multiple database tables or database views, process
the extracted data and display the processed final data in the required format

Data Extraction

Data Process

Data Display

Following are different types of reports:

1. ABAP Queries
2. Classical Reports
3. Interactive Reports
4. ALV (ABAP List Viewer) Reports
5. LDB (Logical Data Back) Reports-HR ABAP

2
BY MR. BABU (OASIS TECHNOLOGIES)

1. ABAP Queries

• It is the system provided tool to generate the reports


• ABAP Queries do not require any programing knowledge
• The T.Codes SQ03, SQ02 and SQ01 are used to work with ABAP Queries

Transaction Code SQ03:

• It is used to maintain User Groups


• User Group is a collection of Info Sets and Queries
• User groups can also be used to control the user authorizations to access the
corresponding Queries

Transaction Code SQ02:

• It is used to maintain Info sets


• The Info sets are used to specify the different data sources from which the data can be
extracted or accessed.
• Following are different data sources in the Info sets
1. Table Join using Basis Table
2. Direct Read of Table
3. Logical Database
4. Data Retrieval by Program

Note: In real time the data source option ‘Table Join using Basis Table’ is mostly used

Transaction Code SQ01:

• It is used to maintain the Queries


• The query is used to select the Input (selection fields) and Output (List Fields)

Note: The hierarchy of the User group, Info sets, and Queries is as below

3
BY MR. BABU (OASIS TECHNOLOGIES)

User
Group

Infoset-1 Infoset-2 Infoset-3

Query-1 Query-2

Demo on ABAP Queries

*****************Refer Notes**********************

Steps to Create User group:

*****************Refer Notes**********************

ABAP Programming

ABAP Editor (SE38):

• This tool is used to maintain the different types of programs


• The Transaction code SE38 is used to work with this tool.
• Following are different types of programs.

Different Types of ABAP Programs:

1. Executable Programs:

• The Executable programs can be executed directly to display the output either in the
foreground or background.
• The program type “ID” for an executable program is “1”

2. INCLUDE Programs:

• They are part of another executable program or main program.


• The program type for include program is “I”

4
BY MR. BABU (OASIS TECHNOLOGIES)
3. Sub Routine Pool Programs:

• They are collection of subroutines (from routines).


• The program type for subroutine pool is “S”.

4. Type Pool Programs:

• They are collection of TYPES.


• The program type for type pool is “T”.

5. Function Group Programs:

• It is a collection of function modules.


• The program type for function group is “F”.

6. Module Pool Programs:

• They are screen programs.


• The program type for module pool is “M”

7. Class Pool Programs:

• They are collection of classes.


• The program type for class pool is “K”

8. Interface Pool Programs:

• They are collection of Interfaces.


• The program type for type pool is “J”

Steps to create an Executable program

• Execute Transaction code SE38.


• Enter the program name (zdemo_1).
• Click on ‘Create’ button.
• Enter Title.
• Select the program type “Executable program”.
• Select the status “Customer Production Program”.
• Select an appropriate application as per the specification (Sales/Material
Management/Finance etc.)
• Enter the required package name
• Click on ‘Save’ icon
• Click on ‘Create Request’ icon

5
BY MR. BABU (OASIS TECHNOLOGIES)
• Enter the short description as per the project standards
• Click on ‘Save’ icon
• Click on ‘Yes’ button
• Write the below program after the system generated statement ‘REPORT’

Program
REPORT ZB20_DEMO1
*Enter Line Comment
WRITE ‘Welcome’. “Partial Line Comment
WRITE 5 ‘To’.
WRITE ‘OASIS’.
*Or Combine multiple statements as a single unit using the operator ‘:’
*Preferable
WRITE: ‘Welcome’, 5 ‘To’, ‘OASIS’.

• Click on ‘Save’ icon


• Click on ‘Check’ icon (Cntrl+F2)
• Click on ‘Activate’ icon (Cntrl+F3)
• Click on ‘Yes’ button (Enter button)
• Click on ‘Back’ icon

Note:
 If an object is directly activated, it will be saved, checked then activated.
 All the custom code should be written after the first system generated statement
‘REPORT’/’PROGRAM’ etc.
 The custom code can be written in either upper or lower case since ABAP is not a case
sensitive language.
 The best practice is to keep keywords in uppercase.
 There must be a space before and after the keywords in statement line.
 Each statement line must be ended with a period (.)

Steps to execute an executable Program

• Execute Transaction Code SE38.


• Enter the required executable program name and click on Execute icon (F8).

Note: Fill the required Input fields in the selection screen then execute

6
BY MR. BABU (OASIS TECHNOLOGIES)
REPORT Statement

• In ABAP executable program starts with ‘REPORT’ statement.

Syntax: REPORT <ZREP_NAME>

• Here <ZREP_NAME> is program name.

Some of useful additions to REPORT Statement:

1. ….NO STANDARD PAGE HEADING:


• This addition is used to hide the page heading in the output

Syntax: REPORT ZB20_DEMO_1 NO STANDARD PAGE HEADING

2. …LINE-SIZE:
• This addition is used to specify the width of a list in the output.

Syntax: REPORT <zrep_name> LINE-SIZE <List Width>

• Default width of basic list is 255 characters


3. ….LINE-COUNT:
• This addition is used to specify the length of the output list in a page

Syntax: REPORT <zrep_name> LINE-COUNT <List length>

4. ….MESSAGE ID:
• This addition is used to specify message classes

Syntax: MESSAGE _ID <zmsg_classes>

• Here <zmsg_classes> is a central message class name.

Comments:
• The comments are used to document each block of the program to make it more
understandable.
• The comments are of two types
1. Entire Line Comment
2. Partial Line Comment

1. Entire Line Comment: An asterisk mark ‘*’ at the left most side as a first character makes
the entire line as comment

7
BY MR. BABU (OASIS TECHNOLOGIES)
Shortcuts:

a. Select lines, then Cntrl +, (Control + ,) -> To comment multiple lines


b. Select lines, then Cntrl +. (Control + . ) -> To uncomment multiple lines

2. Partial Line Comment: It is used to comment any part of the statement line. The double
quote symbol makes rest of the line comment.

Note: The partial line comment can be used to comment entire line but the Entire comment
line cannot be used as partial line comment

WRITE Statement:
• This statement is used to display the data in the required format

Syntax: WRITE ‘<Display Data in the output list>’

• This statement can also be used to move the data from the source data variable to
destination without missing conversations.

Syntax: WRITE <gv_currency> TO < gv_dest>

In case of MOVE In case of WRITE


<gv_currency> <gv_dest> <gv_currency> <gv_dest>
5,895.50 589550 5,895.50 5,895.50

Note: In Real time use the WRITE statement to move currency and quantity fields or Data
Variables.

Some of the useful Additions to WRITE Statement:

1. WRITE/: The forward slash with WRITE statement is used to display data in a new line.
Syntax: WRITE/ ‘<Display in a new line>’.
WRITE/ ‘<next line>’.
Output: Display in a new line
next line

8
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 The position number and the no of characters to be displayed are specified with the
WRITE statement as below:
Syntax: WRITE/<n(m)> ‘<Display m number of characters from n>’.
Here <n> is the position number from which the data to be displayed.
<m> is the number of characters can be displayed.
 Only Numbers can be displayed as below
Syntax: WRITE/(<m>) ‘<Display (m) number of characters>’

2. …COLOR:

• This addition is used to display the data with different background colors.

Syntax: WRITE ‘Display with different color background>’ COLOR <n>.

Here <n> is the color code from 0-7.

Note: An addition INVERSE is used to display data in different color


Syntax: WRITE ‘<Display in different Color font> COLOR <n> INVERSE

Following are the different colors available in SAP:

Color Color Code Statement


GUI-SPECIFIC 0 COL-BACKGROUND
GRAY-BLUE 1 COL-HEADING
LIGHT GRAY 2 COL-NORMAL
YELLOW 3 COL-TOTAL
BLUE GREEN 4 COL-KEY
GREEN 5 COL-POSITIVE
RED 6 COL-NEGATIVE
VIOLET 7 COL-GROUP

3. …UNDER OTHER OBJECT DATA:

• This addition is used to display data under the previous displayed data.

Syntax: WRITE ‘<Display Column1>’.


WRITE ‘<Display Data>’ UNDER ‘<Display Column1>’.
Output: Display Column1
Display Data

9
BY MR. BABU (OASIS TECHNOLOGIES)
4. ….LEFT-JUSTIFIED/CENTERED/RIGHT-JUSTIFIED:

• These additions are used to justify (adjust) the data at left hand side, center and right
hand side.

Syntax: WRITE (100) <gr_data> LEFT-JUSTIFIED/CENTERED/RIGHT-JUSTIFIED.

5. ---CURRENCY:

• This addition is used to specify the currency keys for the currency data variables while
displaying.

Syntax: ….CURRENCY <currency_key>.

• Here <currency_key> are like USD, INR, etc….

6. …UNIT:

• This addition is used to specify the required units while displaying the quantity data.

Syntax: …UNIT <units>.

• Here <units> is the required unit like KGS/GRMS? Etc…..

7. DECIMALS:

• This addition is used to specify the required number of decimal places to be displayed in
the output

Syntax: …DECIMALS <d>.

• Here <d> is number of decimal places.

8. …EDIT MASK:

• This addition is used to display the mask instead of original data.

Syntax: WRITE <gv_data> USING EDIT MASK <****/$....>.

9. …NO-GAP:

• This addition is used to display the text data without any gaps.

Syntax: WRITE ‘<NO> ‘NO-GAP ‘<GAP>’.


OUTPUT: NOGAP

10
BY MR. BABU (OASIS TECHNOLOGIES)
10. …NO-ZERO:

• This addition is used not to display only the zeros. (Null Values).

Syntax: …NO-ZERO.

11. …NO-SIGN:

• This addition is used to hide the sign of the data variables or fields.

Note: This addition is effected for the fields or data variables which are referred to the
domains with the “Sign” Checkbox.

Syntax: ….NO_SIGN.

12. …AS CHECKBOX:

• This addition is used to display the checkboxes in the output.

Syntax: …AS CHECKBOX.

Note: The checkboxes can be displayed with another data only.

13. …AS SYMBOL:

• This addition is used to display the symbols such as hand symbol. Dollar, etc. in the
output.

Syntax: WRITE <sym_left_hand> AS SYMBOL.

Note: The standard include program <LIST> contains all the available icons, symbols, Lines
and Colors in the system.
Example: INCLUDE <LIST>.

14. …HOTSPOT:

• This addition is used to display the hand symbols on the output data when the cursor is
placed.

Syntax: WRITE ‘<hand symbol>’ HOT SPOT.

11
BY MR. BABU (OASIS TECHNOLOGIES)
DATE Format:

• The date can be formatted using the below options:

a. DD/MM/YY  02/01/14
b. MM/DD/YY  01/02/14
c. DD/MM/YYYY  02/01/2014
d. DDMMYY  020114
e. MM/DD/YYYY  01/02/2014
f. MMDDYY  010214
Syntax: WRITE <gv_data> <DD/MM/YY>.

Combine Multiple Key words or Statements:

• The symbol colon ( : ) is used to combine the multiple similar KEYWORDS or


STATEMENTS separated by coma ( , )

Example:

*Not Advisable
WRITE ‘<Display First line>’
WRITE ‘<Display Second line>’
*OR Advisable
WRITE: ‘<Display First line>’ , ‘<Display Second line>’.
Elementary Data Types:
• They are used as the reference in the program.
• Following are different data types.

Data Type Description Initial Length Max-Length Default Value


Number Type
I Integer 4 4 0
F Float 8 8 0.00…
P Packed Decimal 8 16 0.00…
Character Type
C Character 1 65535 Space-“ “
D Date 8 8 00000000
T Time 6 8 000000
N Numeric Text 1 65535 0
STRING String 1 Dynamic Space-“ “

12
BY MR. BABU (OASIS TECHNOLOGIES)
Hexa Type (Not Advisable)
X Hexa Number 4 4 0X….
XSTRING String in Binary 1 Dynamic Space-“ “
Format

Note:
 Default Date format is: YYYYMMDD
 Default Time format is HHMMSS
 Default data type is C-Char and Length is 1 (One)
 Number data types can be used for different types of calculations.
 Character or string types are used to hold character or string or Numeric data
 Hexa data types (X and XSTIRNG) are not advisable from the version ECC 6.0. Since it is
the unique code system.

Mathematical Operations:

• Below mathematical operations are used for different calculations in the programs.

Operation Using Symbol Using Statement


Addition P=a+b ADD a TO b
Subtraction P=b–a SUBTRACT b FROM a
Multiplication P=a*b MULTIPLY a BY b
Division P=b/a DIVIDE b BY a
Reminder - P = b MOD a
Numeric Division - P = b DIV a
Exponential P = a ** b P = EXP(a)

Note: In ABAP there must be a space before and after the symbol or key word
Example: P = a + b

P = ADD a TO b

***Demo program on mathematical function is ‘ZMATH_FUNCTIONS’.*****

13
BY MR. BABU (OASIS TECHNOLOGIES)
Pretty Printer:
• This function is used to align a program and convert the keywords or source code upper
or lower case.

Note: In most of the projects it would be preferable to convert the keywords into uppercase.

Convert Old Editor to New Editor and Vice Versa:

• The source code can be implemented by switching between old and new editors.

Note: The New editor is advisable than old editor from version ECC 6.0

Statement Color Identification:

Blue: The Keywords are in blue color


Gray: The comments are in grey color
Black: The user specific names such as ‘Report name’, data variable names, etc. are in black.
Green: The hard coded text is in green color.
Red: The error statement lines or preceding lines are in red color.

Syntax Error Check:

• Click on the button ‘Process Error’ in case of any errors.


• Read and understand the system given syntax error description.
• Double click on the syntax error description or row number.
• Rectify the error as per the system given description.
• Click on ‘Activate’ button.
• Press ‘Enter’ button.

Note: ABAP is a line by line compiler. Hence the syntax errors are also shown statement line
by statement line.

Steps to switch from Old Editor to new Editor

• Click on Utilities menu item Settings.


• Select Radio button “Front-End Editor (New)” under editor tab.
• Click on Yes button.

14
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to maintain the default settings for Pretty Printer

• Click on Menu item Utilities  Settings.


• Click on “Pretty Printer” tab.
• Check the check boxes ‘Index’ and ‘Convert Uppercase/Lowercase’.
• Select a radio button ‘Keyword Uppercase’.
• Click on ‘Yes’ Button.

Steps to apply the Pretty Printer Function:

• Once the program is in change mode.


• Write the ABAP source code.
• Click on Pretty Printer (shift + F1) button.
• Click on Activate icon
• Press Enter button.

Note: In the real time the pretty printer function must be applied for any source code.

Steps to select user specific editor options:

• Once the program is in display or change mode.


• Click on the options icon that appears at the right most bottom corner.
• Click on ‘Fonts and Colors’.
• Select the required font type, font size, background color etc. of the source code.
• Click on save button.

DATA Statement:
• This statement is used to declare the data variables such as variables, work areas,
internal tables, etc. in an application program.

Syntax: DATA <gv_var> TYPE <I/F/P/C/STRING/…Data Element/dbtab_field/dbview_field>

TYPE and LIKE Statements:


• These statements are used to refer the elementary data types or data dictionary objects
such as Data Elements, Fields, tables, Structures, dbviews, etc.

15
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax:

DATA: <gv_var> TYPE <I/F/P/C/STRING/…Data Element/dbtab_field/dbview_field>.


<gv_field> LIKE <dbtab_field/dbstr_field/dbviews_field>.
<gv_ref> LIKE <gv_var>.
Here <dbtab> is Database table name
<dbstr> is Database structure name
<dbview> is Database view name
<Data Element> is the Data Element.
<I/F/P/C/….> are Elementary Data Types.

Note: The fields of a table or structure or dbview can be referred using the symbol ( - )
Hyphen.
Example: <dbtab/dbstr/dbview-fieldname>

• The ABAP statement “TYPE” is used to refer both elementary data types and DDIC
objects. It does not copy the properties of DDIC objects.
• The ABAP statement “LIKE” is used to refer only the data objects. It copies the
properties of a data object.

Note: In Real time use ‘TYPE’ statement as much as possible, since the system allocates more
Memory for ‘LIKE’.

….VALUE Addition:

• This addition is used to pass the default values into the data variables.

Syntax:

DATA: <gv_char> VALUE ‘<A>’. “Default TYPE and Length


<gv_string> TYPE STRING VALUE ‘<OASIS>’.
<gv_chars(len)> TYPE C.

Note:
 The default data type is “CHAR” and the length is “1”
 The “CHAR” data variable length is fixed, where as the “STRING” variable length is
dynamic. (Any number of Characters)

16
BY MR. BABU (OASIS TECHNOLOGIES)
MOVE Statement:
• This statement is used to move the data from source to destination data variables.

Note: The Symbol “=” can also be used to move the data.

Syntax: MOVE : <gv_source> TO <gv_dest>


(Or)
<gv_dest> = <gv_source>

CLEAR Statement:
• This statement is used to clear (remove) the contents of the data variables and reset to
the initial default value.

Syntax:

CLEAR: <gv_var>,
<gv_string>,
<gv_dbtab>.

Note: In the real time it would be better to clear the data variables before they are used.

Steps to rename the program name:

• Execute the transaction code SE38.


• Enter the program name to be renamed.
• Click on program menu item.
• Click on Rename (Cntrl+F6).
• Change target program name

Example: Source Program: ZSOURCE_PROG


Target Program: ZTARGET_PROG

• Click on Rename button.


• Check all the check boxes.

Note: Change the Include program names if required.


• Click on Yes button

17
BY MR. BABU (OASIS TECHNOLOGIES)
• Create T.R by pressing ‘Create Request’ icon.
• Click on ‘Yes’ button.

ULINE Statement:
• This statement is used to display the horizontal lines in the output.

Syntax: ULINE

Note: The pipeline symbol ( I ) with the WRITE statement can be used to display the vertical
lines in the output.

Example: ULINE.

WRITE: ‘1’ , ‘Display Box’ , ‘1’.


ULINE.

Auto Write Statements in ECC6.0:-

 The button “TAB” is pressed to get the keyword written automatically while displayingit.

Steps To Write The Keyword Automatically:-

 Once the program is in change mode.


 Start writing the required keyword.
 Then press tab button to get it written automatically.

NOTE:- Use the short cut “ctrl+Space ‘ ’ to get all the relevant keywords then select appropriate
keyword.

Find and Replace Function:-This function is used to find for the required strings to be replaced
with the new strings.

Steps To Use Find And Replace Function:-

 Once the program is in change mode click on find icon(ctrl+f).


 Enter the required find string.
 Enter the check the check box replace with and enter new string.
Eg:- find Gv_m

Replace with gv_mul

 Select a radio button in main program.


 Click on yes button.

18
BY MR. BABU (OASIS TECHNOLOGIES)
 Check the check box that appears beside the program name.
 Place a cursor on font location from which the string to be replaced.
 Click on the button “from cursor everything without dialogue”.

Note:- An icon replace(shift+f5)is used to replace string by string.

 Click on save icon.


 Click on back icon.

 Activate the program name.

Help Documentation:

• It is used to know more details about the particular keywords or fields, examples and
additions.
• It can also be used to know the technical information of the screen fields.
• The Help documentation window is displayed when the function key “F1” (or) an icon
[?] is pressed.

Steps to get help Documentation:

• Once the program is in display or change mode.


• Place the cursor on the required keyword or screen field.
• Press “F1” key.
• Double click on the required keyword.

Note:
 The corresponding keyword help documentation is displayed.
 Go through the system given documentation, additions and make use of the examples

ABAPDOCU Transaction Code:

• This Transaction Code is used to analyze the system given example programs.
• It can also be used to get the keyword help documentation.

Steps to work with ABAPDOCU Transaction Code:

• Execute the Transaction Code ABAPDOCU.


• Expand the required Hierarchy and their sub-hierarchies.
• Double click on the required example program.
• Analyze the system given source code, execute and debug.

19
BY MR. BABU (OASIS TECHNOLOGIES)

Figure 4.1: ABAPDOCU Transaction code

Steps to get keyword help using ABAPDOCU:

• Execute Transaction Code ABAPDOCU.


• Double Click on the item “Keyword Help”.
• Enter the required ABAP keyword (Example: MOVE).
• Press ‘Enter’ button.
• Double click on the relevant keyword.

Note: The corresponding help documentation is displayed to make use of additions and
Examples.

Steps to get the keyword return automatically from ECC 6.0:

• Once the source code (program) is in change mode


• Start writing the keyword with their initial alphabets.
• Press “TAB” button on keyboard to get it return automatically when the keyword is
displayed just above the statement line.

PARAMETERS Statement:
• This statement is used to define the single input fields, check boxes, radio buttons, list
boxes etc. in the selection screen (Input Screen).

20
BY MR. BABU (OASIS TECHNOLOGIES)
• The default system generated screen number for selection screen is 1000
Syntax: PAREMETERS: <P_NUM1> TYPE <I/C/data element/dbtab_field>.

Some of the useful additions to PARAMETERS Statement:

1) ….OBLIGATORY:

• This addition is used to make the Input Fields as Mandatory.


Syntax: PAREMETERS: <p_input> TYPE/LIKE <data_element/db_field> OBLIGATORY.

Note: The system gives an error message as “Fill in all the required entry fields” if the
OBLIGATORY input field is empty.

2) …...DEFAULT:

• This addition is used to pass the default values to the selection fields or Input fields.
Syntax: PAREMETERS: ……….. DEFAULT <def_value>.

3) …...AS CHECKBOX:

• This addition is used to define the check boxes in the selection screen.
Syntax: PAREMETERS: <p_chk> AS CHECKBOX.
<p_chk1> TYPE C AS CHECKBOX.

Note:
 The parameter LENGTH and TYPE should be a single character to define the
checkboxes.
 The selected parameter of the check box contains the value ‘x’.

4)…..RADIOBUTTON GROUP:

• This addition is used to define the radio buttons in the selection screen
Syntax: PAREMETERS: <p_rad1> TYPE C RADIOBUTTON GROUP <grp>,
<p_rad2> RADIOBUTTON GROUP <grp>,
• Here <grp> is a Radio Button Group Name.

Note:
 The parameter LENGTH and TYPE should be a single character to define the
checkboxes and Radio Buttons

21
BY MR. BABU (OASIS TECHNOLOGIES)
 The selected parameter value of the check box and Radio Button is ‘X’.
 An additional statement DEFAUL with value ‘X’ is used to make the check boxes or
radio buttons as Default.
Example: PARAMETES: <P_RAD1> RADIOBUTTON GROUP <GRP> DEFAULT ‘X’

Difference between CHECKBOX & RADIOBUTTON

CHECKBOX RADIO BUTTON


1 It is optional 1 At least one Radio Button must be selected
2 Single check box can also be defined 2 Set of Radio Buttons(2) must be defined
3 By default the checkbox is not selected 3 By Default the First Radio Button is selected.

5) …..VISIBLE LENGTH

• This addition is used to specify the required visible length of the Input fields or selection
Field.
Syntax: ....VISIBLE LENGTH <N>

6) …...VISIBLE LENTH…….AS LISTBOX:

• This addition is used to define a Drop down list boxes in the selection screen. This
addition must be used with VISIBLE LENGTH only.
Syntax: …VISIBLE LENGTH <N> AS LISTBOX.
7) …...MATCHCODE OBJECT:

• This addition is used to specify DDIC search help to the selection fields or Input fields
Syntax: ....MATCHCODE OBJECT <DDIC_SERARCH HELP>.

8)….. LOWER CASE:

• This addition is used to make the Input fields as case sensitive to accept both upper and
lower case letters.
Note: Effect of their addition is similar to Lower case Check Box at Domain level.

Syntax: PAREMETER: <p_param> TYPE <matnr> LOWER CASE

9) …...MODIF ID:

22
BY MR. BABU (OASIS TECHNOLOGIES)
• This addition is used to assign all the screen elements to the modification Group to
modify the selection fields dynamically.
Syntax: PAREMETER: <p_param> TYPE <C/I/…./dataelement/dbtab-field/..> MODIF ID <mid>.
• Here <mid> is modification id
System Fields:
The system fields are used to access the system provided data such as system date, time, user
name etc. in an application program.

 The standard structure “SYST” contains all the system provided fields.

 The standard structure “SYST” is filled with a single record at run time.

 The fields from the structure “SYST” can be refered as below.

Eg:- SYST-<field> (or) SY-<field>.

Eg:- SYST-DATUM (or) SY-<datum>.

There are around ‘171’ system fields .following are some of useful system fields.

FIELD DESCRIPTION

INDEX Index of the loop

DATUM Current system date

UZEIT Current system time

SUBRC Written code of the ABAP keywords.

Note:- If it contains ‘0’ , the statement


(or)keyword is success. other than ‘0’
keyword is failed.

Eg:- if sy-subrc eq 0->success.

PAGNO Current list page number

TABIX Index of an internal table

TFILL Row number of an internal table

DBCNT The number of extracted records from

23
BY MR. BABU (OASIS TECHNOLOGIES)
the DB

FDPOS Font location in character string.

LINCT The specified line count (page length).

LINSZ Line width of list

LINNO Current line in list

LILLI Selected list line

LSIND Index of the detailed list

LISTI Index of displayed list.

LOOPSI Visible lines of a step loop

LANGU System login language

BATCH Program is running in the back ground

DYNNR Current screen number

DYNGR Screen group of current screen

CPAGE Current page number of a list

DBNAM Logical data base of an executable


program

MANDT Client no.of the system

FNKEY Function key

PRIM Print immediately

PDEST Output device name

PLIST Name of spool request

DBSYS Central database system

SYSID Current system id

OPSYS Operating system of the server

24
BY MR. BABU (OASIS TECHNOLOGIES)
PFKEY Current GUI status

TCODE Current transaction code

UCOMM Function code of the selected push


button

SLSET Use selection screen variant

UNAME Login user name

ABCDE Alphabets from A to z

LISEL Contents of the selected list line

ULINE Horizontal line

VLINE Vertical line

CPROG Calling program

MSGID Message class name

MSGTY Message type

MSGNO Message number

MSGV1-MSGV4 Message variables

HOST Name of current application server

REPID Current program name.

NOTE:-The default format of the system field SY-DATUM (date) is YYMMDD.

The default format of the system field SY-UZEIT (time) is HHMMSS.

Variants: - The variants are used to save a input data for further execution in the selection
Screen.
 They can also be used to avoid the data entry errors and schedule a program in the back
ground.

Note:-The standard table “VARI” contains all the created variants in the system.

25
BY MR. BABU (OASIS TECHNOLOGIES)
Note:-The system provided fields “SLSET” of the standard structure “SYST” holds the selected

Variant

Eg:- SYST-SLSET(or) SY_SLSET

Steps to Create Variants:-

 Once the program (or) t-code (or) table (or) application is executed.
 Fill the required fields.
 Click on save icon.
 Enter variant name meaning (could be any)
 Click on save icon.

Note:-An icon “get variant” is appeared beside an execute icon in case of a program (or) T-code
has variants.

 Click on get variant icon (shift+f5).


 Double click on the required variant name.
 Click on execute icon.

Execution Modes: - There are two types of execution modes to execute a program (or)
transaction code.

1) Fore ground.

2) Back ground.

Fore Ground Execution Mode: - It is used to execute the program (or) transaction codes
directly by pressing execute icon (or) F8 function key.

 This execution mode requires user interactions.


 To provide input data and see the output.

Back Ground Execution Mode:- This execution mode is used to execute the programs (or)
transaction codes periodically such as hourly ,daily, weekly, monthly etc. in back ground.

 It does not require any user interaction to provide the input data.
 The variants must be created before the programs are scheduled in back ground.
 The T-code SM36 and SM37 are used to work with the back ground jobs.

Note:-The standard system provided function modules

JOB_OPEN -> to open back ground job,

26
BY MR. BABU (OASIS TECHNOLOGIES)
JOB_SUBMIT->to submit job in back ground,

JOB_CLOSE->to close scheduled job.

Are used to schedule the programs in back ground through source code.

T-code SM36:- It is used to define the back ground job.

T-codeSM37:-It is used to check the status (or) overview of the back ground jobs.

Note:-The menu bar program ->execute->background Can also be used to work with the back
ground jobs.

Steps to Define Back ground Jobs:-

 Execute the T-code SM36.


 Enter the job name (ZBACK_JOB).
 Click on start condition button.
 Click on Date (or) Time button.
 The button immediate is used to schedule a back ground job immediately.
 Provide the scheduled start Date and Time.
 The back ground job can be stop at the specified Date and Time in the no start after
field.
 Check the check box periodic job.
 Click on period values button.
 Click on an appropriate period value such as hourly (or) daily (or) weekly (or) monthly
(or) other.
 Click on save icon.
Eg:-Scheduled start dates 03:06:2014 Time 09:38:30
No start after date
 Click on save .To start Date &Time.
 Click on save icon to save back ground job.
 Enter the required ABAP program name (ZPROGRAM).
 Enter (or) select the required variant.
 Click on save icon.

Note:-1.The system generates unique spool request number for each back ground job.

2. The transaction code SP01 and SP02 are used to work with spool request (print
Request).

3. An icon delete is used to delete the back ground job from the data base.

27
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to Check or Over view of Back ground Jobs:-

 Execute the T-code “SM37”.


 Enter the job name.

Note:-Enter ‘*’ for all the jobs.

 Check all the job status such are scheduled, released, ready, active, finished.

Note:- Change job start condition date to check any jobs.

 Click on execute button to check the job status.


 Check the required job.
 Click on spool button.
 Click on ABAP list icon that appears beside the system generated spool numbers.

Steps to Copy Program:-

 Execute the transaction code SE38.


 Enter the program name to be copied.
 Click on copy (ctrl+F5).
 Change the target program name.
 Click on ‘yes’ button.
 Click on select all icons (F8).
 Click on ‘yes’ button.
 Enter the package name.
 Click on save icon.
 Click on create request icon (F8).
 Enter short description as per the project standards.
 Click on save icon.
 Click on yes button.
 Click on change button.
 Make the necessary changes in the copied program.

Mathematical Functions:-

28
BY MR. BABU (OASIS TECHNOLOGIES)
 Mathematical functions are used on the decimal and numeric data variables.

Following are the different types of mathematical functions.

FUNCTION DESCRIPTION
SIGN It returns sign of the number such as ‘-1’ and ‘1’.

ABS It returns an absolute value of an argument


without considering sign.
TRUNC
It returns an integer part of an argument.

FRAC It returns the decimal part of an argument.

CEIL It returns the smallest integer which is not smaller


than an argument.

FLOOR It returns the largest integer which is not larger


than an argument.

SQRT It returns the square root value of an argument.

Syntax:- <gv_result> = SIGN/ABS/FLOOR/TRUNC…(<gv_arg>).

***Demo program on mathematical function is ‘ZMATH_FUNCTIONS’.*****

ULINE statements:-This statement is used to display the horizontal lines in the output.

Syntax:- ULINE.

String Operators:- They are used on the string (or) character data variables.

Following are the different types of string operators.

OPERATOR DESCRIPTION
STRLEN It returns the number of characters in the string.
Syntax:-<gv_length> = STRLEN(gv_string>).

CONCATENATE It contains the multiple strins into a single target


string.
Syn:-CONCATENATE<gv_s1>gv_s2>…into
<gv_target>[separated by space/#].

29
BY MR. BABU (OASIS TECHNOLOGIES)
SPLIT It splits the string into the different strings at the
specified symbol (or)character.
Syntax:-SPLIT<gv_target>AT< comma/space/…>
Into <gv_s1><gv_s2>…
Note:-an addition into table is used to handle any
no.of
Splitters.
Syntax:- SPLIT<gv_target>AT<comma/space/..>
INTO TABLE <gt_itab>.

FIND It finds the required character (or) string in the


source string.
Syntax:- FIND<gv_find>IN<gv_source>.
Note: - An addition “MATCH OFFSET” is used to get
Position of a found character.

Syntax:FIND<gv_find>IN<gv_source>MATCHOFFSET
<gv_pos>.

Note:- System Field “SY-SUBRC” holds ‘0’ in


Case of a character is founds.

It replaces the required string with the new string.


REPLACE Syntax:- REPLACE<gv_old>with<gv_new>into
<gv_source>.

TRANSLATE It translates the string into upper (or) lower case.


Syntax:- TRANSLATE<gv_string>UPPER/lower case.

CONDENSE It compresses the string without any gaps.


Syntax:-CONDENSE<gv_string>no-gaps.

SHIFT It shifts a specified no.of places at left (or)right


(or)circular.
Syntax:-SHIFT<gv_string>BY<n>PLACES
right/left/circular.

***Demo program on mathematical function is ‘ZSTRING_OPERATIONS’.*****

30
BY MR. BABU (OASIS TECHNOLOGIES)
Conditions:

• The condition statements are used to control the program flow.


• Following are the different types of conditions.
1. IF----------condition statement
2. CASE------condition statement

1. IF------condition statement:

• It is used to check all the specified conditions and process the corresponding process
block of satisfied condition
Syntax: IF <cndition1> AND <condition2>
* Process block1
ELSE IF <condition3> OR <condition4>
*process block 2
|
|
|
ELSE
*ELSE BLOCK
|
|
|
END IF

2. CASE-------condition statement:

• It is used to cross the process block of the specified data variables or field variable of the
specified condition.
• This statement does not check all the data variables/field variables.
Syntax: CASE <gv_var/field>
WHEN <value1> AND <value2>
* Process block 1
|
|
WHEN <value3> OR <vaue4>
*process block 2
|
|
WHEN OTHERS
*other process block
END CASE.

31
BY MR. BABU (OASIS TECHNOLOGIES)
Note: In the real time use ‘case….condition’ statement than ‘if.…conditions’ as much as
possible since the case statement does not check the unwanted values (faster).

Numeric comparison operators:

• They are used to compare numeric (or) Number data variable and fields.
• Following are the different types of numeric comparison operators.

Constants and Text Symbols:

• They are used to avoid the “hard coded texts” in the programs.
• ABAP statement ‘CONSTANTS’ is used to define the constants.

Name/Operator Symbol Statement

Equal to = EQ
Not Equal to <> NE
Less Than < LT
Less than/Equal to <= LE
Greater Than > GT
Greater Than/Equal To >= GE

**Demo program on numeric (or) number comparison operators ‘ZNUMC_COMPARISION’**

String comparison operators:

• They are used to compare character/string data variables and fields.


• Following are the different types of string comparison operators

OPERATORS DESCRIPTION
CA-contains Any The condition becomes true in case of the some string
contains any one of the character in the target string.
NA-Contains Not Any The condition becomes true in case of a string comparison
operator CA is false(opposite to CA)
CO-Contains Only The condition becomes true in case of the source string
contains only the similar string in the target
CN-Contains Not Only The condition becomes true in case of the string comparison
operator CO is false(opposite to CO)
CS-Contains String The condition becomes true in case of the source string
contains similar string in the target in both upper &lower

32
BY MR. BABU (OASIS TECHNOLOGIES)
case(not a case sensitive)
NS-Contains NO String The condition becomes true in case of a string operator CS is
false(opposite to CS)
CP-Contains Pattern The condition becomes true in case of the source string
contains the specified pattern in the target string
NP-Contains Not Pattern The condition becomes true in case of the logical expressions
with a string operator CP is false(opposite to CP)

**Demo program on numeric (or) number comparison operators ‘ZNUMC_COMPARISION’**

LOOPS

They are used to process stamen block or Process block multiple times.

Following are the different types of Loops

1) DO ….. ENDDO

2) WHILE ….ENDWHILE

3) SELECT …..END SELECT

4) LOOP……. ENDLOOP.

DO…END DO:- This loop is also called un conditional loop. It can be used to process the loop for
any no.of times any one of the loop termination statements such as “EXIT” and “STOP” should
be used to come out of this loop.

>Syntax:-DO

*Process block

*loop termination to come out of Loop

IF<condition>……

EXIT/STOP.

ENDIF.

ENDDO.

NOTE:-This loop statement can also be used to process for the specified number of times.

Using an addition times

33
BY MR. BABU (OASIS TECHNOLOGIES)
>DO<n>Times

*process block Loops Process

ENDDO. <

WHILE ….ENDWHILE:- This loop statement is also called condition loop.

>WHILE<condition1><condition2>

*process block

ENDWHILE

Comes out of loop in case of conditions are false.

NOTE:- The conditional loop(WHILE ….ENDWHILE) is preferable than unconditional


loop.(DO….ENDDO)science the conditional loop checks the conditions first where as the
unconditional loop process a loop for at least one time to check the conditions.

***Demo program is ‘ZUNCOND_COND_LOOPS’****

Loop Termination And Continue Statements:- They are used to come out of the loop
statements and continue with the next loop process.

 Following are the different types of loop termination and continue statements.

1) EXIT

2) STOP

3) CONTINUE

4) CHECK.

EXIT statement:- This statement is used to come out of the loop statement and continue with
the next statement line out side of the loop statements in the program.

34
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE:- If this statement is used outside of the loop statement, the program will be stop and
display the output.

DO.

IF<condition>.

*exits out of loop

EXIT.

ENDIF.

ENDDO.

>WRITE <out side of loop>.

STOP Statement:- This statement is used to stop the loop process along with the next part of
the loop statement.

NOTE:- It does not make any difference inside of the loop statements and outside of the loop

statements.

DO

IF<condition>

*stops loop and programs

STOP

ENDIF.

END DO.

*next statement line

WRITE<outside of loop>

>Output list.

CONTINUE Statement:- This statement is used to stop the current loop process and continue
with the next loop process.

>Syntax:-

35
BY MR. BABU (OASIS TECHNOLOGIES)
DO…..

*stops current loop process and continue with the next loop process.

CONTINUE.

WRITE:…………..

ENDDO. <

CHECK Statement:- This statement is used to check the specified conditions and continue with
the next loop process (or) next program part.

>Syntax:-

DO

*check and continue

CHECK <condition>

WRITE…..

ENDDO. <

Eg:- CHECK = CONDITION + CONTINUE.

3.SELECT ….ENDSELECT loop statement:-

This loop statement is used to extract record by record from the database tables (or)
database views into a work area (or) variable.

36
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax:- SELECT *

FROM <db tab>

INTO<gs_dbtab/(gv_var1,gv_var2…)> “ Work area / Variables

*INTO TABLE gt_itab “Internal table

WHERE <condition1> AND

<condition2>..

*process extracted data…

END SELECT.

Comes out of this loop after last record is extracted and processed.

Here <dbtab> is the database table name.

<gs_dbtab>is work area.

NOTE: In the real time this loop statement is not advisable as it fits the database for each

Records (lack of performance)

SELECT Clause:-It is used to specify the required fields to be extracted from the database tables
(or) database views.

SELECT * is used to extract all the fields data.

Syntax:-

* Not advisable

* SELECT *

* Advisable

SELECT <f1>

<f2>

<f3>

NOTE: - In the real time SELECT * is not advisable unless all the fields are required.

37
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: - It is advisable to specify the required fields in the similar order of the data base tables
(or) database views as per the specifications.

FROM Clause: - It is used to specific source of the data. Such as database tables (or) data base

Fields.

Syntax:- SELECT <f1>

<f2>..

FROM <dbtab/dbview>….

INTO … (OR) INTO TABLE Clause:- It is used to specify the data structure variable (Work area),
variables and internal tables (holds multiple records) for holding the extracted data from
database tables (or) database views.

Syntax:- SELECT <f1>

<f2>

<f3>

FROM <dbtab/dbview>

INTO <gs_dbtab/gv_f1….>”holds single record/Field

*INTO TABLE <gt_dbtab> “holds multiple records.

WHERE Clause: - It is used to filter the data while extracting from the database tables (or)

Database views.

Syntax: - SELECT <f1>

<f2>...

FROM < dbtab /dbview>

INTO <gs_dbtab/(gv_var1,gv_var2..)>

*INTO TABLE <gt_itab> “ Internal table

WHERE <condition1> AND

<condition2>…

38
BY MR. BABU (OASIS TECHNOLOGIES)
Functionality of SELECT..ENDSELECT Loop:

******************Refer Notes********************

WORK AREAS
Introduction:

• Work areas are the local structures in the programs.


• They are used to hold single record at a time

Syntax:
DATA: <Gs_dbtab> TYPE <typ_dbtab/dbtab/dbstr…..>
* OR
DATA: <WA_dbtab> LIKE LINE OF <gt_dbtab>

• Here <typ_dbtab> is a ‘TYPE’ which contains required fields


• <gt_dbtab> is an Internal Table

TYPES Statement:
• This statement is used to declare or define the local types in an application program.
• The TYPES can be used as a reference to declare the Data variables such as Variables,
Work Areas, Internal Tables etc….

Syntax:
*Single Field
TYPES: <gv_ret> TYPE <Dataelement/dbtab_field/…..>
*With Multiple Fields
TYPES: BEGIN OF <typ_dbtab>,
<f1> TYPE <dataelement>,
<f2> TYPE <dbtab_f1/dbstr_f1>,
………….END OF <typ_dbtab>

Note: The entire structure of the table or DDIC structure can be included along with the
additional fields as below

TYPES: BEGIN OF <typ_dbtab>,


<f1> TYPE <dataelement>,

39
BY MR. BABU (OASIS TECHNOLOGIES)
<f2> TYPE <dbtab_f1/dbstr_f1>,
*INCLUDE Structure
INCLUDE STRUCTURE <dbtab/dbstr>
TYPES: END OF <typ_dbtab>

INCLUDE STRUCTURE Statement:

• This statement is used to include the entire structure of the data dictionary table or
DDIC structure to the local types.

TYPE GROUP:

• It is one of the data dictionary objects


• The TYPE GROUPS are used to define the central types, internal tables, constants etc.,
which can be referred across the system.
• The ABAP statement TYPE-POOLS is used to call DDIC “TYPE-GROUPS”.
• The TYPES and Data Variable names in the TYPE GROUPS should start with the TYPE
GROUP name.

Steps to create a TYPE GROUP:

• Execute T.Code SE11.


• Select the radiobutton “Type Group”.
• Enter the type group name (“ZTYPG”) upto 5 characters.
• Click on create button.
• Enter short text and press Yes button.
• Enter package name.
• Click on save icon.
• Create T.R number by pressing Create Request icon (F8).
• Click on Yes button
• Define or declare the required Central Types, Constants etc. after the system generated
statements TYPE-POOL.

Example:
TYPE-POOL ztypg.
*TYPES
TYPES: BEGIN OF ztypg_ekpo.
ebelp TYPE ekpo_ebelp.
……
*INCLUDE STRUCTURE

40
BY MR. BABU (OASIS TECHNOLOGIES)
INCLUDE STRUCTURE VBAK.
TYPES: END OF typ_ekpo.
END OF ztypg_ekpo.

Field Strings:

• They are used to declare or define Work Areas and Internal Tables.
• Field Strings are Outdated.

Note: In Real time TYPES are preferred than Field Strings

Syntax:
DATA: BEGIN OF <gs_dbtab>,
<F1> TYPE <dataelement/dbtab_F1/dbstr_F1>,
------
END OF <gs_dbtab>

Differences between TYPES and FIELD STRINGS:

TYPES FIELD STRINGS


1. Do not hold the data since they are 1. Holds data since they are data objects
not data objects. or data variables.
2. They can be used as a reference for 2. They can be used to declare Work
Work Areas, Internal Tables. Areas and Internal Tables directly.
3. ABAP statement TYPES is used to 3. ABAP statement DATA is used to
declare or define TYPES. declare or define FIELD STRINGS
4. They are advisable 4. They are outdated

FIELD SYMBOLS:

• FIELD SYMBOLS are the pointers which use the address


• The ABAP statement FIELD-SYMBOLS is used to declare or define the FIELD SYMBOLS.
• FIELD SYMBOLS must be specified within the angle brackets “< >”
• They can be declared as TYPE ANY to hold any type of data at runtime.

Syntax:
FIELD-SYMBOLS: <<fs_dbtab>> TYPE ANY
<<fs_any>> TYPE ANY

41
BY MR. BABU (OASIS TECHNOLOGIES)
<<fs_dbtab>> TYPE <typ_dbtab/dbtab/dbstr>
ASSIGNING Statement:

This statement is used to assign the field symbols to the internal tables.

Syntax:
-----ASIGNING <<fs_dbtab>>.
UNASSIGN Statement:

This statement is used to anassign the field symbols.

Syntax:
UNASSIGN <<fs_dbtab>>.

Differences between Work Area and Field Symbols:

Work Area Field Symbol


1. It is a data structure variable 1. It is a pointer using address
2. ABAP statement DATA is used to 2. ABAP statement FIELD-SYMBOLS is
declare or define Work Areas used to declare or define Field Symbols
3. No Need to specify with in angle 3. Must be specified within angle brackets
brackets
4. It cannot be declared as TYPE ANY 4. It can be declared as TYPE ANY to hold
any type of data at runtime
5. ABAP statement INTO is used to process 5. ABAP statement ASSIGNING is used to
record by record through a Work Area process the data through a Field
Symbol

Internal Tables:
Introduction:

• They are the intermediate tables which can be filled with the multiple rows at runtime.
• The data of an internal table can be processed in an application program or source code.
• The Internal Tables can be categorized as 2 tables as below:
1. Index Tables
2. Non-Indexed Tables

42
BY MR. BABU (OASIS TECHNOLOGIES)

Internal Tables

Non-Index
Index Tables
Tables

Standard Sorted Hashed


Internal Table Internal Table Internal Tables

Figure 4.2: Categories of Internal Tables

Note: In real time the Standard Internal Tables are mostly used and the Sorted Internal Tables
are rarely used.

Standard Internal Tables:

• The default index table is the Standard Internal Table.


• The Standard Internal Tables are filled using the ABAP statement APPEND/INSERT.
• The Standard Internal Tables can be accessed using their index or key fields.

Syntax:
DATA: <gt_dbtab> TYPE STANDARD TABLE OF <typ_dbtab/dbtab/dbstr/ztypg_dbtab>.
(Or)
<gt_dbtab> TYPE TABLE OF <typ_dbtab/dbtab/dbstr/ztypg_dbtab>.

Sorted Internal Table:

• They are used to sort the data while filling or updating.

43
BY MR. BABU (OASIS TECHNOLOGIES)
• The ABAP statements “APPEND/INSERT” is used to fill Sorted Internal Tables.
• They are accessed based on Index and Key Fields.
• An additional statement with UNIQUE or NON_UNIQUE Key must be used to declare or
define Sorted Internal Tables.

Syntax:
DATA: <db_dbtab> TYPE SORTED TABLE OF <dbtab/typ_dbtab/ztyp_dbtab/dbstr> with
UNIQUE/NON UNIQUE KEY <K-F1>

Note:
 The Sorted Internal Tables cannot be sorted explicitly where as Standard Internal
Tables can be sorted.
 The program goes to run time error (short dump) in case the Sorted Internal Table
when it contains any duplicate data.
 Specify all the key fields of the data base tables using an addition “WITH UNIQUE KEY”
to declare or define Sorted Internal Tables.

Hashed Internal Tables (or) Non-Index Tables:

• They are the Non Index Tables.


• The Hashed Internal Tables hold huge amount of data then Standard & Sorted internal
tables since they follow “Hashed Algorithm”.
• The additional ABAP Statement “WITH UNIQUE KEY” must be used to declare (or) define
Hashed Internal Tables.

Syntax:
DATA: <gt_dbtab> TYPE HASHED TABLE OF <dbtab/dbstr/typ_dbtab/typg_dbtab> WITH
UNIQUE KEY <K-F1><K-F2>….

44
BY MR. BABU (OASIS TECHNOLOGIES)
Functionality of Internal Table:

Figure 4.3: Functionality of the Internal Tables.

Note:
 Internal Tables can also be declared with Header line but not advisable.
 DATA : <gt_dbtab> TYPE TABLE OF <typ_dbtab/dbtab/dbstr/ztypg_dbtab> WITH HEADER
LINE.
Note:
 Hashed Internal tables consume some static process time while accessing first and last
record since they follow Hash algorithm
 Indexed Internal Tables can hold upto 2GB of data.
Note: Internal tables can also be declared using “OCCURS” addition statement but not advisable
Syntax: DATA: <gt_dbtab> LIKE <dbtab/dbstr> OCCURS <n>
*<n> is a number to allocate required space.

TABLE TYPES:

45
BY MR. BABU (OASIS TECHNOLOGIES)
• They are one of the dictionary objects
• They are used to define central internal Table Types (internal tables).
• Table Types can be referred across the system.

Steps to create TABLE TYPES:

• Create DDIC structure with the required fields.


• Execute T.Code SE11.
• Select a radio button “Data Type”.
• Enter table type name to be created Example: zb25_table_type.
• Click on Create button.
• Select radiobutton “Table Type”.
• Click on Yes button.
• Enter Short Text.
• Enter required structure name. Example: zb25_struct_ekpo.
• Click on “Initialization and Access” tab.
• Select an appropriate table access type such as “Standard Table, or Sorted Table, or
Hashed table”.

Note: Default access type is “Standard Table”.

• Click on activate icon.


• Enter package name.
• Click on save icon.
• Create T.R by pressing “Create Request” icon.
• Click on Yes button.
• Press Enter button.
• Click on back icon.

Note: Data dictionary object Table Types can be referred to declare Internal tables and work
areas.
Syntax: <gt_itab> TYPE <ZDDIC_TABLE_TYPE>. “Internal Table
<gs_line> LIKE LINE OF <gt_itab>. “Work Area.

Operations on Internal Tables:


1.) Data Filling:

a.) Pointer Search (or) INTO TABLE:

46
BY MR. BABU (OASIS TECHNOLOGIES)
It is used to extract all required data item from database tables or database views into an
internal table body.

Syntax: SELECT <f1>


<f2>
FROM <dbtab/dbview>
INTO TABLE <gt_dbtab>
WHERE <condition1> AND <condition2>….

b.) APPEND STATEMENT

This statement is used to append record by record from a Work Area (or) Header line (or) Field
Symbol into an Internal Table body.

Syntax: APPEND <gs_dbtab> TO <gt_dbtab>. “Through Work Area.


(or)
APPEND <gs_dbtab> TO [<gt_dbtab>]. “Through Header Line.
(or)
APPEND <<fs_dbtab>> TO <gt_dbtab>. “Through Field Symbol.

c.) ….APPEND LINES:

This statement is used to append multiple lines of an internal table into another target internal
table at the end

Syntax:
APPEND LINES <gt_source> TO <gt_target>

d.) …INSERT:

This statement is used to insert a new record at any position of an internal table.

Syntax:
INSERT <gs_final> INDEX <n>? SY-TABIX

e.) …INSERT LINES:

This statement is used to insert multiple lines of a source internal table into a target internal
table at any position.

Syntax:

47
BY MR. BABU (OASIS TECHNOLOGIES)
INSERT LINES OF <gt_dbtab> INTO <gt_final> INDEX <n>/SY_TABIX

f.) COLLECT Statement:

This statement is used to compare character (or) string fields data and summarize (or) collect
numeric fields data.

Syntax: COLLECT <gs_source> INTO <gs_collect>

Note: Difference between “APPEND” and “COLLECT” statement is APPEND statement


appends new record into target internal table without comparing any character fields data
but COLLECT statement compares character fields data and summarizes or collects numeric
fields data.

Figure 4.4: APPEND and COLLECT Statement Functionalities

2.) Copy Internal Table:

Internal tables can be copied from body of source internal table into the body of target internal
table.

48
BY MR. BABU (OASIS TECHNOLOGIES)
Example:
*Advisable
<gt_target>[] = <gt_source>[]

*Not Advisable
LOOP AT <gs_source> INTO <gs_source>
------
<gs_target>=gs_source>,
APPEND <gs_target> to <gt_target>
------
END LOOP

3.) Internal Table Data Process:

a.) Loop----END LOOP Statement:

This loop statement is used to process record by record of an internal table through its header
line or work area or field symbol.

Syntax:
*Using Work Area
LOOP AT <gt_final> INTO <wa_dbtab> WHERE <CONDITION1> AND….
*Process Data
Loop Process
WRITE: ….
-------
END LOOP
Comes out of loop after last record is processed.
*[OR] Using Field Symbol
LOOP AT <gt_final> ASSIGNING <<fs_final>>

*Process record by record of an Internal Table Loop Process


------
END LOOP

Comes out of loop after last record is processed.

b.) READ TABLE:

This statement is used to read or access record by record of an Internal Table

49
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax:
SORT <gt_dbtab2 >
LOOP AT <gt_base> into <gs_base>
------
*Read Another Internal Table Data.
READ TABLE <gt_dbtab2 > INTO <gs_dbtab2 > WIH KEY
<f1> = <gs_base_f1> [BINARY SEARCH]
IF SY-SUBRC EQ 0
*Process 2nd Internal Table data
-----
END IF
-----
*Read 3rd Internal Table
-----END LOOP.

NOTE:
 The Internal Tables must be sorted before an additional statement “BINARY SEARCH”
is used.
 In real time, use an addition “BINARY SEARCH” while reading the internal tables for
better performance
 Comparison operator statement cannot be used with READ TABLE statement since the
symbol ‘=’ should only be used.
 The Index Internal tables can also be read using their indexes.
Example:
*Read Internal Table using Index.
READ TABLE <gt_dbtab2 > INTO <gs_dbtab2 >
INDEX <n>/ SY-TABIX

c.) MODIFY Statement

The ABAP statement MODIFY is used to modify an internal table with new data.

Syntax: …MODIFY <gt_dbtab> FROM <gs_dbtab> [INDEX] [TRANSPORTING <f1><f2>…].

Note:
 An additional statement “TRANSPORTING” is used to modify an internal table data
with the specified fields.
 No need to use “MODIFY” statement to modify same internal table using “FIELD
SYMBOLS”
3.) Delete Internal Table Data:

Below statements are used to delete and refresh the table.

50
BY MR. BABU (OASIS TECHNOLOGIES)
a.) DELETE Statement:

This statement is used to delete internal table data.

Syntax: DELETE <gt_dbtab> WHERE <cond-1>.

Note: It is advisable to delete internal tables or database tables outside of loop statements
for better performance.

b.) DELETE ADJACENT DUPLICATES:

This statement is used to delete adjacent duplicates or corresponding duplicate records from
the internal table.

Note: Internal table should be sorted before using this statement

Syntax: SORT <gt_dbtab> BY <f1> <f2>.

DELETE ADJACENT DUPLICATES FROM <gt_dbtab> COMPARING <f1> <f2>.

c.) REFRESH Statement:

This statement is used to remove contents of internal tables.

Syntax: REFRESH: <gt_dbtab> [].


Here [] refers to body of the internal table.

d.) FREE Statement:

This statement is used to free contents of an internal table along with allocated memory.

Syntax: FREE <gt_dbtab>.

e.) CLEAR Statement:

This statement is used to clear or remove contents of work areas, header lines and variables.

Syntax: CLEAR: <gt_dbtab>,


<gv_var>.

f.) SORT Statement:

51
BY MR. BABU (OASIS TECHNOLOGIES)
This statement is used to sort internal table’s data either in ascending order or descending
order.

Syntax: SORT <gt_dbtab> BY <f1> <f2>…”Default-Ascending order.


SORT <gt_dbtab> BY <f1> <f2> ASCENDING “Ascending order.
SORT <gt_dbtab> BY <f1> <f2> DESCENDING “Descending order.
SORT <gt_dbtab> BY <f1> ASCENDING <f2> DESCENDING. “Combination.

Difference between Work Area and Internal Table:

Work Area Internal Table


It holds single record at a time It holds multiple records
It doesn’t have body It has body
Record by Record of an internal table can be Record by Record of an internal table can be
processed through Work Area processed through a header line of an
internal table in case of “WITH HEADER LINE”

SETECT-OPTIONS Statement:

• This statement is used to define the range input fields and single input fields in the
selection screen.
• The system generates an internal table with the below fields for ranges or “SELECT-
OPTIONS”

Filed Description
SIGN I-Include
E-Exclude (Sign of input data)
OPTION EQ-Equal To
BT-Between (Option of Input Data)
LOW Lower Limit of Range or Select-Options
HIGH Higher Limit of Range or Select-Options

Note:
 Standard structure “SELOPT” is referred for SELECT-OPTIONS or ranges implicitly or
explicitly.
 The ‘OPTION’ field of the RANGE Internal Table holds ‘EQ’ in case of only lower limit is
filled.
 The ‘OPTION’ field would be ‘BT’ in case of both the lower and upper limits are filled.
 The SELECT statement extracts all the records in case of the SELECT-OPTIONS or
RANGE is empty(optional input field)
 If only upper limit is filled, the data will be extracted from the initial record to
specified upper limit.

52
BY MR. BABU (OASIS TECHNOLOGIES)
 The lower limit of the range input field should always be less than the upper limit.
Otherwise the system will throw an error message.
Syntax:
*Specify Tables
TABLES: <dbtab>
SELECT-OPTIONS: <s_range> FOR <dbtab_field>

Note:
 In real time, the tables statement is not advisable since it creates unnecessary work
area as like specified table name
 The “TABLES” statement can be avoided by declaring or defining the required data
variable.
Syntax:
DATA: <gv_field> LIKE <dbtab_field>
SELECT-OPTIONS: <s_range> FOR <gv_field>
Example:
DATA: gv_ebeln LIKE ekpo_ebeln
SELECT-OPTIONS: s_ebeln FOR gv_ebeln

Note:
 The ABAP Statement FOR is used to refer the data variables or table abd structure
fields for SELECT-OPTIONS or RANGES.
 The ABAP statement IN is used to make use of “SELECT-OPTIONS” or RANGES in
WHERE condition while extracting data.
Syntax:
SELECT <f1>
<f2>
--------
FROM <dbtab>
INTO TABLE <gt_dbtab>
WHERE <f1> EQ <parameter> AND
<f2> IN <s_option>…

53
BY MR. BABU (OASIS TECHNOLOGIES)
SELECT-OPTIONS Screen:

The SELECT-OPTIONS are appeared in Selection Screen as below:

Figure 4.5: SELECT-OPTIONS appearance

Steps to use the Multiple Selection Button of the SELECT-OPTIONS:

• Once the report or Transaction code or table is executed, click on Multiple Selection
Button.
• Enter the required single values under “Select Single Value” Tab
• Click on Copy icon (Execute)

Note:
 The tab “Select Ranges” is used to specify multiple ranges
 The tab “Exclude Single Values” is used to exclude single values or ranges
 An icon “Import from File” (Shift+F11) can be used to import the input data from the
text file.
 Click on ‘Copy’ icon(Execute)

Some of the useful additions on SELECT-OPTIONS:

1. ….DEFAULT…TO:

It is used to pass the default values to Lower and Upper limits of the “SELCT-OPTIONS”

Syntax: SELECT-OPTIONS: <s_selopt> FOR <gv_var> DEFAULT <dt_low> TO <dt_upper>

2. ….NO EXTENSION:

This addition is used to hide the multiple selection buttons of the SELECT-OPTIONS

3. …NO INTERVALS:

This addition is used to hide the upper limit of the SELECT-OPTIONS.

Syntax: …..NO INTERVALS

54
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 The Select Options should only be used to define optional single input fields using the
additions NO-EXTENSIONS and NO-INTERVALS.
Syntax:
SELECT-OPTIONS: <s_selopt> FOR <gv_var> NO EXTENSION NO INTERVAL “Optional Single
input field

Note:
 The SELECT statement does not extract all the records in case of optional single input
field using PARAMETERS statement since it is considered as EQ space.
 The SELECT statement extracts all the records in case of SELECT OPTIONS single input
field since it is considered as *
 In real time, use “Parameters” statement for defining checkboxes and radio buttons
and use “SELECT-OPTIONS” statement for defining single and range input fields in the
selection screen.
 Refer PARAMETERS statement additions for MODIFID, OBLIGATORY, etc. which has
similar functionality.

Differences between PARAMETERS and SELECT-OPTIONS:

PARAMETERS SELECT-OPTIONS
1. It is used to define Check boxes, Radio 1. It is used to define Single and Range
buttons and Single input fields input fields
2. It is used as an input data variable 2. It is system generated internal table
with the fields SIGN,OPTION,HIGH and
LOW
3. ABAP statements TYPE or LIKE is used 3. ABAP statement FOR is used
to refer Data types or Data Objects
4. The operator RQ or symbol ‘=’ is used 4. The ABAP statement IN is used to
in WHERE condition make use of SELECT-OPTIONS in
WHERE condition
5. In case of optional, the SELECT 5. It extracts all the data in case of Single
statement does not extract ant data Input field

RANGES statement

• This statement is used to define the range internal tables


• It is almost similar to SELECT-OPTIONS. The only difference is the SELECT-OPTIONS are
displayed in the selection screen whereas RANGES do not appear in the selection
screen.

Syntax: RANGES: <r_range> FOR <gv_var>

55
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 In real time RANGES statement is not advisable. Use RANGE INTERNAL TABLES instead
of RANGES.
Example:
DATA: r_range TYPE RANGE OF ebeln
 The RANGE table can be populated and used ad below
Syntax:
RANGES: <r_range> FOR <gv_var> “Not Advisable
DATA: <r_range> TYPE RANGE OF <field>
*Populate range table
r_range – Sign = I
r_range – Option = ‘BT’
r_range – Low - <3000>
r_range – High - <5000>
SELECT
….
<BUKRN> IN <r_range>

SELECTION-SCREEN Statement:

• This statement is used to format the selection screen

• The default screen number for the selection screen is 1000.

• Following are some of useful additions

Some useful additions to SELECTION-SCREEN

1. ….BLOCK WITH FRAME:

This addition is used to define the selection screen blocks with frames

Syntax:
SELECTION-SCREEN BEGIN OF BLOCKS <blk> WITH FRAME
PARAMETERS…
SELECT-OPTIONS…
SELECTION-SCREEN END OF BLOCK <blk>

• Here <blk> is the selection screen block name.

56
BY MR. BABU (OASIS TECHNOLOGIES)
2. FRAME TITLE:

An addition TITLE with the selection screen FRAMES is used to define TITLES for the selection
screen FRAMES

Syntax:
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE Text_h01.

Note:
 TEXT SYMBOLS should only be used with the addition TITLE.
 In real time the selection screens must be defines with FRAMES along with TITLES.

3. …PUSHBUTTON:

This addition is used to define the push buttons in the selection screen.

Syntax:
SELECTION SCREEN: PUSHBUTTON 2(8) <but 1> USE-COMMAND CLIL,
PUSHBUTTON 12(10) <but 2> USER-COMMAND <cmd>.

• Here n(m)/2(8) is size of push button.

Note:
 The TAB STRIP control can also be defined in the selection screen using an addition
TABBED BLOCK
Syntax:
SELECTION-SCREEN: BEGIN OF TABBED BLOCK <tabname> FOR <n> LINES,
TAB (20) <button1> USER-COMMAND <cmd1>,
TAB (20) <button2> USER-COMMAND <cmd1>,
END OF BLOCK <tabname>.

4. …ULINE:

It is used to display the horizontal lines in the selection screen

Syntax:
SELECTION-SCREEN ULINE

5. …SKIP:

It is used to keep the blank lines in the selection screen.

Syntax: SELECTION-SCREEN SKIP <n>.

57
BY MR. BABU (OASIS TECHNOLOGIES)

Note: The ABAP statement SKIP is used to keep blank lines in the output.
Syntax:
SKIP <n> (Here <n> is no of lines to skip)

6. …LINE:

This addition is used to define the input fields, radiobuttons, push buttons, check boxes etc. in
the same line.

Syntax:
SELECTION SCREEN: BEGIN OF LINE,
PARAMETERS: <p_rad1> RADIOBUTTONGROUP <grp1>
<p_rad2>
….
END OF LINE

7. …COMMENT:

This addition is used to provide labels or comments for the selection screen or input fields.

Syntax:
SELECTION-SCREEN COMMENT <comment/label>.

Differences between Normal Search and Pointer Search:


(SELECT…END SELECT and INTO TABLE)
Normal Search Pointer Search
1. It hits the database table for each 1. It hits the database table once to
record since it is a loop statement. extract all the required data since it is
a plain statement.
2. ABAP statement APPEND must be 2. No need to use APPEND statement
used to append record by record into while extracting the data.
an internal table.
3. It is not advisable due to lack of 3. It is advisable since it extracts the data
performance and database load. faster and has good performance.
4. It may give runtime error short term 4. It doesn’t give ant runtime error
while debugging

58
BY MR. BABU (OASIS TECHNOLOGIES)
Conversion Routines:

• The conversion routines are used to convert the data from internal format to external
format and external format to internal format.
• The conversion routines are maintained at the domain level of a field.
• The standard function module which ends with “*INPUT” and “*OUTPUT” are attached
to the maintained at conversion routines.

*INPUT Function Module:

• It is used to convert the field data from external to internal format.

Example: 4970000000….4970.

*OUTPUT Function Module:

• It is used to convert the field data from internal to external format.

Example: 00000……49704970.

Steps to find Conversion routine:

• Execute t-code se11.


• Enter the required table name/domain name.
• Click on display button.
• Double click on the required data element name.(vbeln_va).
• Double click on domain name.

NOTE: The conversion routine name is appeared in the conversion routine field at domain level

• Double click on conversion routine name to find the attached conversion routine
function modules (*input, *output).
• Click on back.

Note: 1. The ABAP statement UNPACK can also be used to convert data from Internal to External and

External to Internal format

UNPACK <gv_var/gs_dbtab-f1> TO <gv_var/gs_dbtab-f1>.

2. The ABAP statement WRITE can also be used to convert date, time, currency and Quantity formats

Ex: WRITE <sy-datum/gs_dbtab-currency> TO <gv_char>.


BY MR. BABU (OASIS TECHNOLOGIES)

Menu Painter
It is used to maintain the menu statuses for defining push buttons and menu painter.

The transaction code SE41 is used to work with menu painter.

The ABAP statement 'SET PF STATUS' is used to call (or) define the menu statuses.

Syntax: SET PF_ STATUS <Z MENU_STATUS> [EXCLUDING <GT_EXTAB>].

Here exclude is used to hide the unwanted pushbuttons and menu items.

Steps To Create A Menu Painter:

1) Execute the transaction code SE41.

2) Enter the required program name.

3) Enter the menu status name to be created.s

EX: Program name: zprogram_name.

Status : ZMENU_STATUS.

4) Click on create button.

5) Enter the short text.

6) Click on yes button.

7) Expand the user interface (APPLICATION TOOL BAR).

8) Enter the function codes for the required items ( EX: CALL .....ETC).

Note: At run-time the system field SY-UCOMM holds the function code when the corresponding push
Buttons and menu items are selected.

9) Double click on the function code.

10) Click on yes button.

11) Enter function text.

12) Select an appropriate icon if required.

13) Enter info text.

14) Click on yes button.


BY MR. BABU (OASIS TECHNOLOGIES)
15) Double click on appropriate function key.

Note: The function type 'T- call a transaction' is used to call a required transaction code directly without
writing CALL TRANSACTION statement but the function code of push button (or) menu item should be
same as the transaction code.

16) Enter icon text (CALL_SELL).

17) Enter info text.

18) Click on enter button.

19) Enter the function text.

Note: Follow the similar steps to create any no of push buttons and menu items.

20) Compress the expanded UI (Application Tool Bar).

21) Expand an UI function keys.

22) Enter the function codes for the standard bar icons.

ICON FUNCTION CODE

BACK

EXIT

CANCEL

23) Click on activate icon.

24) Press enter buttons.

25) Click on 'TEST STATUS' ICON (F8) to test menu status.

26) Press enter button.

27) Click on yes button.

28) Click on back icon.

Steps To Copy Menu Status & Add Additional Items:

1) Execute the transaction code SE41.

2) Click on 'COPY STATUS' button.

3) Enter the source & target program name & menu statuses.
BY MR. BABU (OASIS TECHNOLOGIES)
EX:

FROM:

PROGRAM: ZPROGRAM1.

STATUS : ZSTATUS1.

TO:

PROGRAM: ZPROGRAM2.

STATUS : ZSTATUS2.

4) Click on yes button.

5) Press enter button.

6) Click on change button.

7) Expand required UI.

8) Create the additional push buttons (or) menu items by double clicking on the function code.

9) Activate the menu status.

CALL TRANSACTION Statement: It is used to call transaction codes from program or Source code

Syntax: CALL TRANSACTION ‘<TCODE>’ [AND SKIP FIRST SCREEN].

SUBMIT STATEMENT:-

This statement is used to call (or) submit another executable program.

SYNTAX:- REPORT <ZCALLING_PROGRAM>.

*Call another program*

SUBMIT <ZCALLED_PROGRAM>.

:
BY MR. BABU (OASIS TECHNOLOGIES)
:

Some Of The Useful Additions:-

1) ....................VIA SELECTION SCREEN:-

It is used to call an executable program VIA its selection screen.

SYNTAX:-

SUBMIT <zcalled_ program> VIA SELECTION_SCREEN.

2) ............WITH SELECTION SCREEN:-

This addition is used to pass the input data from the calling program into the called program
using range internal table.

SYNTAX:-

.........................WITH SELECTION-TABLE<gt_range>.

3) ...............................USING SELECTION-SET:-

This addition is used to pass the created variant from the calling program into the called
program.

SYNTAX:-

.........................WITH SELECTION-SET<variant-name>.

MEMORY Concept:-

This concept is used to access the data across internal (or) external sessions.

There are two types of memory.

1) SAP memory

2) ABAP memory

SAP memory:-

It is used to access the data from one sessions to another session through parameter (or) SAP
memory ID.
BY MR. BABU (OASIS TECHNOLOGIES)
The ABAP statements 'SET 'PARAMETER ID' & 'GET PARAMETER ID' is used to work with SAP
memory.

SET PARAMETER ID Statement:-

This statement is used to pass the field (or) variable value from an application program into the
specified SAP memory ID (or) parameter ID.

SYNTAX:-

SET PARAMETER ID 'PID' FIELD .'<gv_var/gs_str-field>'.

GET PARAMETER ID Statement:-

This statement is used to get the data from the specified memory 'ID' (or) parameter ID into
variable (or) field of an application program (or) source code.

SYNTAX:-

GET PARAMETER ID 'PID' FIELD .'<gv_var/gs_str-field>'.

Here 'PID' is the parameter 'ID' (or) SAP memory 'ID'.

NOTE:-

The parameter 'ID' (or) SAP memory 'ID' are maintained at data element level.

PROGRAM:-

:
BY MR. BABU (OASIS TECHNOLOGIES)
Transaction Code

SAP Memory
ID

FIELD1 4970
SET/GET Parameter
ID ↔ ↔
FIELD2
4970 :
:

ABAP MEMORY:-

It is used to access the data across internal sessions. The ABAP statements EXPORT AND IMPORT are
used to work with ABAP memory.

EXPORT Statement:-

It is used to export the data into the specified ABAP memory ID from the program.

SYNTAX:-

EXPORT <gv/var/gs_tab-field> to MEMORY ID <AMD>.

IMPORT Statement:-

It is used to import the data from the specified ABAP memory ID into data variable.

SYNTAX:-

IMPORT <gv/var/gs_tab-field> FROM MEMORY ID <AMD>.

NOTE:-

Calling function modules is an example to work with an external session.

EX:-

PROGRAM:-

EXPORT .................TO MEM ORY ID <AMD>.


BY MR. BABU (OASIS TECHNOLOGIES)
:

* Call function*

CALL FUNCTION '<func_name>'.

source code

IMPORT...........FROM MEMORY ID <AMD>.

Control-Break Statements:

1) They are used to control the data flow of an internal table.

2) The control break statements starts with 'AT' and ends with 'ENDAT'.

3) They must be used within the loop statement only.

Following Are The Different Types Of Statements:

 AT FIRST.

 AT NEW.

 AT END OF.

 AT LAST.

1) AT FIRST:-

This statement is triggered with the first record of internal tables.

Syntax:

LOOP At<GT_ITAB>.....

*Triggers with first record*


BY MR. BABU (OASIS TECHNOLOGIES)
AT FIRST.

*Process block*

END AT.

ENDLOOP.

2) AT NEW:-

This statement is triggered when the specified field contains a new value.

LOOP AT <gt_itab>....................

*triggers with each new value

AT NEW <F1/F2>.

*Process block

END AT.

ENDLOOP.

3) AT END OF:-

It is triggered at the end of each new field value.

It can be used to display (or) process the sub totals.

SORT <gt_itab> by <f1>,<f2>..............

LOOP AT <gt_itab>…..

*triggers at end of each new value*.

AT END OF <F1/F2>.. ....

*Process block*.

*Subtotals*.

SUM.

END AT......

ENDLOOP.
BY MR. BABU (OASIS TECHNOLOGIES)
Note:

* An internal table must be sorted before AT NEW and AT END OF statement are used.

* Control break statements AT NEW and AT END OF considers the preceding fields values also

In case of END AT ON F1. In case of END AT ON F2.

GT_ITAB GT_ITAB

F1 F2 F3 F1 F2 F3
1 A P 1 A P
2 A Q 1 A Q
2 : : 2 B R

4) AT LAST:-

This statement is triggered with the last record of an internal table.

It can be used to display (or) process the totals.

SYNTAX:-

LOOP AT <gt_itab>.....

*Triggers while processing last record*.

AT LAST.

*Process block*.

SUM.

END AT…..

ENDLOOP.

NOTE:-

In case of the control-break statement the original work areas (or) field values are impacted by
replacing with '* * * * * *'. This issue can be overcome by copying the original work areas into
temporary work area before the control-break statements are used.

SYNTAX:-

LOOP AT <gt_itab> INTO <gs_itab>…


BY MR. BABU (OASIS TECHNOLOGIES)
*Copy work area.*

<gs_itab> = <ls_itab>.

AT NEW..............

WRITE <gs_itab-f1>........

END AT.

ENDLOOP.

SUM Statement:-

This is used to summaries the numeric data such as currency, Quantity etc.

This statement must be used only in between the control-break statement

AT NEW, AT END OF,AT LAST.

SYNTAX:-

LOOP AT gt_itab..............

AT END OF <F1>.

SUM.

<gv_total> = <gv_total> + <gs_final-curr/quan>.

END AT.

ENDLOOP.

ON-CHANGE OF Statement:-

This statement is almost similar to 'AT NEW' control-break statement but only the difference is
the 'ON-CHANGE OF' statement can be used within the loop statement & outside of loop statements
also whereas 'AT NEW' statement must be used within the loop statement only.

It can be also be used with SET operator on the multiple fields.

SYNTAX
BY MR. BABU (OASIS TECHNOLOGIES)
LOOP AT <gt_final> into <gs_final>..….

* trigger when anyone of the specified values are changed.*

ON CHANGE OF <gs_final-f1> or <gs_final-f4>.

* Process block*

END ON.

ENDLOOP.

Difference Between 'AT NEW' & ‘ON CHANGE OF' Statements:-

AT NEW ON CHANGE OF

1. They must be used within the loop It can be used within the loop statement &

Statement only. Outside of loop statements

2. This statement considers the preceding this statement considers the preceding fields values

Also. Fields values also.

3) The original work areas (or) field values It doesn't impact the original work areas.

Are impacted by replacing with '* * * * * *'.

4) It can't be used be on more than one It can be used be on multiple fields using

Field using SET operator 'OR' SET operator 'OR'.

ALV-ABAP List Viewer Reports


• ALV stands for Abap List Viewer.

• The system provided standard function module which starts with 'REUSE' is used to
work with ALV Reports.

• The standard type-Group 'SLIS' contains all the Types, Constants and Internal tables
which are related to ALV Reports.
BY MR. BABU (OASIS TECHNOLOGIES)
• The system provides the generic function (or) push buttons, to sort the data, change
the layout, and Download the data….etc in case of ALV reports.

Following are the different types of ALV reports.

1) ALV list display

2) ALV grid display

3) Blocked ALV

4) Hierarchical ALV

1. ALV List Display:

• The standard ALV display function module 'REUSE_ALV_LIST_DISPLAY' is used to


display the populated final internal table data in ALV list format.

• The field values cannot be edited in case of ALV list format.

• Logos (or) images cannot be displayed in ALV list format.

2. ALV Grid Format:

• The standard ALV display function module 'REUSE_ALV_GRID_DISPLAY' is used to


display the populated final internal table data in ALV grid format.

• The field values cannot be edited in case of ALV grid format.

• Logos (or) images can be displayed in ALV grid format.

NOTE: In real time, ALV grid format are mostly used & the default report format is ALV Grid

Grid Format

→ Generic Function
Pushbutton

HEADER LOGO −−−− → Logo/Image


BY MR. BABU (OASIS TECHNOLOGIES)
...........
...........
.
COL1 COL2 COL3 COL4 COL5
100 AB 20 C RS −−−−− → Can be changed

3) BLOCKED ALV:

• They are used to display the data from the multiple internal tables as separate
block in the Output.

The below standard function module of ALV reports are used to work with blocked ALV'S.

1. REUSE_ALV_BLOCK_LIST_INIT: It is used to initialize the different blocks in the output.

2. REUSE_ALV_BLOCK_LIST_APPEND: It is used to append internal tables as separate blocks.

3. REUSE_ALV_BLOCK_LIST_DISPLAY: It is used to display the appended blocks in the output.

Blocked ALVs

Block-1 --> Header data -->


Gt_header
F1 F2 F3 F4
10 P Q M
: : : :
: : : :

Block2 --> Item data -->


Gt_item
G1 G2 G3
100 AB RS
: : :

4) Hierarchical Alv:

• It is used to display the header & the corresponding item details in Hierarchical
format.

• The standard ALV display function module 'REUSE_ALV_HIERSED_LIST_DISPLAY', is


used to display the header & the corresponding item details.
BY MR. BABU (OASIS TECHNOLOGIES)
Head- Head- Head-
col1 col2 col3 → Col heading to Headers

Item- Item- Item-


col1 col2 col3 → Col heading to Item

2 EF GH → Header Record '1'


10 P A
20 Q B → Item of Header record '1'
30 R C

2 EF GH →Header record '2'


10 A E
20 C F → Item of Header record '2'
30 D G

Steps To Develop An Alv Report Without Populating Field Catalogue:

1. Create DDIC structure with the required fields.

2. Extract the required data from the database tables (or) database views based on the given

input.

3. Populate the final internal tables.

4. Use an appropriate ALV display function module either 'REUSE_ALV_GRID_DISPLAY' (or)

'REUSE_ALV_LIST_DISPLAY' to display final data by exporting data dictionary structure name &
the final internal table.

NOTE: The below parameters can be passed.

1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'/'REUSE_ALV_LIST_DISPLAY'.

EXPORTING

i_callback_program = 'SY-REPID'. "current program name".


BY MR. BABU (OASIS TECHNOLOGIES)
i_structure_name = '<z*****_****>' "DDIC structure name".

……………….

TABLES

t_outtab = '<gt_final>' "Must be standard internal table".

Some Of The Useful Types In The Type Group 'SLIS':

1) SLIS_T_FIELDCAT_ALV: It is used to format the columns in ALV reports such as populate

Column headings, edit the columns, display hand symbols etc.

Following Are The Some Of The Useful Fields In Field Catalogue:

FIELD DESCRIPTION

Col_pos column position.

row_pos row position.

fieldname field name.

NOTE: Field name must be in uppercase.

Tab name Final internal table in upper case.

Seltext_s/m/l column heading are short, medium (or) long.

Edit To edit the field values in the output in grid column

CField name field with currency/currency field.

Ctab name Reference table name for currency field.

currency key currency key field

quantity quantity units field

qfieldname quantity field name

qtab name Reference table name for quantity field.

emphasize stripped pattern (Zebra colors)

do_sum sum up the numeric data


BY MR. BABU (OASIS TECHNOLOGIES)
data type DDIC data type

Inttype elementary data type

intlen length of the data type

Ref_fieldname data dictionary reference field name

Ref_tabname data dictionary reference table name

Different Ways To populate Field Catalogue:

There are 2 ways to populate field catalogue.

1. Using ALV function module(REUSE_ALV_FIELDCATALOG_MERGE).

2. Manual population.

NOTE: In the real time, the field catalog is populated manually.

Steps To Populate The Field Catalog Using The Function Module:

1. Define data dictionary structure (or) internal table with the required fields.

2. Call ALV function module 'REUSE_ALV_FIELDCATALOG_MERGE’ to populate a field catalog

From the DDIC structure (or) internal table.

NOTE: The below parameters can be passed.

*CALL FUNCTION ' REUSE_ALV_FIELDCATALOG_MERGE'.

i_program_name = SY-REPID.

* i_structure_name = '<STRUCTURE NAME>'. 'DDIC STRUCTURE'

CHANGING:

ct_fieldcat = <gt_fcat>.

EXCEPTIONS:

inconsistent_interface = 1.
BY MR. BABU (OASIS TECHNOLOGIES)
program_error = 2.

others = 3.

TABLES

t_outtab = <gt_final> ''internal table".

Note: 1.Fields of the internal table must be declared using the keyword LIKE only.

2. No of characters in each statement line should not exceed 72.

3. Modify the specified field catalog internal table 'GT_FCAT' as per the specification if required.

EX:-

LOOP AT <gt_itab> into <gs_itab>.

CASE <gs_itab>-fieldname.

WHEN '<field>'.

<gs_fcat>-seltext_s = '<doc no>'.

'<gs_fcat>'-edit = 'X'…….

MODIFY <gt_fcat> from <gs_fcat> transporting <seltext_s>............<edit>.....

ENDCASE.

ENDLOOP.

4. Pass the filled field catalog internal table to an export parameter 'IT_FIELDCAT' of the ALV

Display function modules.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.

OR

'REUSE_ALV_LIST_DISPLAY'….

EXPORTING

…………

it_fieldcat = 'gt_fcat'. " populated field catalogue"


BY MR. BABU (OASIS TECHNOLOGIES)
Steps to insert Border Line for 72 Characters :

1. Once the program is in change mode.

2. Click on utilities --> Settings --> Check the check box “Downwards comp the length (72).

3. Click on 'Yes' button.

Note: One red color vertical border line is inserted at 72 character position.

Steps to populate field catalogue manually

1. Populate field catalogue interal table (gt_fcat type slis_t_fieldcat_alv)


With required field values.
2. Pass the populated field catalogue internal table (gt_fcat) to an export parameter of alv display
function module (it_fieldcat)

EX :

Data : <gt_fcat> type slis_it_fieldcat_alv,

<gs_fcat> like line of <gt_fcat>,

* Populate field catalogue

Perform <f_pop_fieldcat>.
.
.
.
Form <f_pop_fieldcat>.
*First field

<gs_fcat> - field name = ‘<field>’ . “uppere case only


<gs_fcat> - tab name = ‘<gt_final>’ . “ upper case only
<gs_fcat >- seltext-m = <colu heading>.
.
.
<gs_fcat> - col-pos = ‘<1>’.
.
.
APPEND <gs_fcat> TO <gt_fcat>.

*2nd field
BY MR. BABU (OASIS TECHNOLOGIES)
CLEAR <gs_fcat>.
<gs_fcat> - field name = ‘<field2>’.
<gs_fcat> - col_pol =’<2>’.
.
.
ENDFORM.

Note: Duplicate block of code to populate afield catalogue can be avoided using subroutine as below.

EX :

Data : <gt_fcat> type slis_t_field_alv’

<gs_fcat> like line of <gt_fcat>.

*Populate field catalogue

Perform <f_pop_fieldcat>.
.
.
.
FORM <f_pop_fieldcat>.

*First field

PERFORM <f_fcat_pop> USING ‘<field1>’’<gt_final>’ ‘<colum heading1> ‘<1>’.

*2nd field

PERFORM <f_cat_pop> USING ‘<field2>’ ‘<gt_final>’ ’ <colum heading >’ ‘<2>’.


.
.

ENDFORM.

FORM <f_cat_pop> using <f_field> <f_tab> <f_label>.

<gs_fcat> - fied name = <f_field>.

<gs_fact> - tabname = <f_tab>.

<gs_fcat> - seltext-m = <f_label>.

<gs_fcat> - col-pos = <f_pos>.

.
BY MR. BABU (OASIS TECHNOLOGIES)
APPEND <gs_fcat> TO <gt_fcat>.

ENDFORM.

2.Slis _layout_alv :

• It is used to format entire layout in alv reports such as display data in different data in color
Confirmation prompt _ _ _ etc.

Following are some of useful fields in table:


fields descrption
1. Col_width optimize - to optimize the colum width as per the data length

2. total_only - show totals only

3. box_fieldname - to select multiple rows in the output

4. confirmation _prompt - confirmation prompt confirmation message when leving in output

5. detail_popup - show details in popup

6. info_fieldname - field name for colours

Note:

• The populate structure variable of the type slis_layout_alv should be passed to an export
parameter of ALV display function module.

Ex :

CALL FUNCTION ‘REUSE_ALV_GRID_DISPALY’ (OR) ……. LIST …….

EXPORTING

I_call back _program = sy_repid.

* i_structure _name = ‘zdb_struc_ekpo’ “ddic structure

It_fieldcat = gt_fcat “populated field catalogue

Is_layout = gs_layout “ populated layout


BY MR. BABU (OASIS TECHNOLOGIES)
Steps to display each row in diff color in alv reports :
1. Define (or) add four character field to the final internal table (gt_final) from which the data
should be displayed.
2. Increase the color code and calculate the populate color code field.

EX :

C <X> <Y> <Z>

<X> - color code from 0 to 7.

<Y> - intensity either 0 (or) 1.

<Z> - inverse either 0 (or) 1.

3. Pass color code field name to the field ‘info_fieldname’ off the layout data structure
variable (work area - gs_layout)

EX :

.
.
• Add color code field

TYPES: BEGIN OF <typ_final>.

<col (4) > TYPE c,

END OF <typ_final>.

• Populate colour code dynamically


.
LOOP AT <gt_base > INTO < gs_final>.
.
• Populate color code dynamically
.

CONCATENATE ‘C’ <lv_col> ‘<1> ‘ ‘<1/0>’ into <gs_final_col>. “ c<x><y><z>- - -

<1- 7><1><1>

• Increase color code

<lv_col> = <lv_col> + 1.
BY MR. BABU (OASIS TECHNOLOGIES)
• Reset color code
IF<lv_col> = 7.

Clear <lv_col> (or) lv_col = 0.

ENDIF.

• Append final internal table


APPEND <gs_final> TO <gt_final>.
.

ENDLOOP.

• Pass color field name to layout


.
<gs_layout> info _fieldname = ‘<COL>’.

3.slis_t_event :
 It is used to populate an alv event
 This type contains following fields

Field name description.

1. Name - name of alv event


2. Form - dynamic subroutine name of the corsponding event.

Events in alv reports :


 There are 17 events in alv report.

Following are some of useful events in alv reports.

Eventname description

1. Top_of_page - to populate the header data and display the header


data and loges .

Note:

• Logos OR Images can only be displayed in alv grid format.


BY MR. BABU (OASIS TECHNOLOGIES)

2. Pf_status_set - the call menu status for adding menu ite and push buttons in
alv reports.
3. User_command - to provide an interactive functionalaity based on the
selected record are push button are men itom in alv reports.

4. End_of_list - it is to display the footer details in alv list format.

Different ways to populate events in alv reports

They are 3 ways to populate alv reports.

1. Manual population
2. By using alv function madule (reuse_alv_event_get)
3. Using call back parameters

1. Manual population steps :

Steps :
1. Populate an internal table of the type “slis_t_event” with the required events and their
corresponding dynamic subroutine.
2. Define the dynamic subroutine of an event with the required functionality or business logic.
3. Pass the populated events internal table to export, import parameters of alv display function
module it_event.

EX :

DATA : <gt_event> TYPE slis _it_event,

<gs_event> LIKE LINE OF <gt_event>.

*Populate alv event

PERFORM <f_pop_events>.

FORM <f_pop_events>.

<gs_event> - name = ‘TOP_OF_PAGE ‘. “Event name

<gs_event > - form = ‘ f_top_page ‘ . “Dynamic sub routines


BY MR. BABU (OASIS TECHNOLOGIES)
APPEND <gs_event> TO <gt_event> .…

ENDFORM.

*Implement required functionality (or) business logic

FORM <f_pop_of_page>.

*Populate header and display

ENDFORM.

FORM <f_user_command>------

ENDFORM.

*Pass populate events internal table to ALV display function module

CALL FUNCTION ‘REUSE_ALV_LIST/GRID/HIER--------’.

EXPORTING

It_fieldcat = <gt_fact>.

Is_layout = <gs_layout>.

It_events = <gt_event>. “Populate events table

Second way to populate alv events:

The standard ALV function module ‘REUSE_ALV_EVENT_GET’ is used to populate all the ALV events.

Note:

• The dynamic subroutine for each event can be populated with in the loop of event internal
table.

Ex:

• Populate dynamic subroutines

LOOP AT gt_event INTO gs_ event.

CASE gs_event -name.


BY MR. BABU (OASIS TECHNOLOGIES)
WHEN ‘TOP_OF_PAGE’.

Gs_event from = f_top_of_page . “ dynamic subroutine name”

Modify gt_event from gs_event transporting form.

WHEN ‘ USER_COMMAND’.

ENDCASE.

ENDLOOP.

Note:

• Pass the populate event internal table (gt_event) to an export parameter (it_events ) of alv
display function module.

3 . 3rd way to handle events:

The call back export parameter can also be used to specific the dynamic subroutine name
of alv events in alv display function modules.

EX:

Call function ‘ REUSE_ALV_GRID/LIST_DISPLAY’

Exporting

I_call back_progarm = sy_repid.

I_callback_top_of_page = “f_top_of_page” “dynamic subroutine”

Note :

• call back parameters i_callback_top_of_page is not available.


• For alv list format hence is should be populated separately.
• In an internal table gt_event of type slis_t_event

I_callback_pf_status_set = f_pf_status_set.
I_callback_user_command = f_user_command.

Steps to work with an alv event TOP_OF_PAGE :

 Populate ALV event ‘TOP_OF_PAGE’ with the corresponding dynamic subroutine name
(f_top_of_page) into an internal table of the type (slis_t_event ) (gt_event).
Note: Call back export parameter “ i_callback_top_of_page” can also be used to specify
BY MR. BABU (OASIS TECHNOLOGIES)
Dynamic subroutine name in alv grid format. But not possible in List format

 Populate the required header data into an internal table of the type (slis_t_listheader)
in b/w the definition of dynamic subroutine .
 Use the standard ALV function module “REUSE_ALV_COMMENTARY_WRITE” to display
the populated header data and logos.

Note :

• Logos or images can be displayed in alv grid format only.


• Logos or Images can be uploaded using t-code ‘OAER’
• Logos or Images

4. Type slis_t_list header :


 It is used to populate the different types of header data to be displayed in the header part
of in alv report.

Following are the fields in this type :

Field description

1.type - type of the header data (H – Header, S – Selection, A - Action)

2.key - key information of the report

3.info - information text of the header

Example: populate top-of-page and into routine

…………………….

………………………

Perform <f-pop-events>

…………………………………..

……………………………………

Form <f-pop-events>.

<gs_event>-name = ‘top-of-page’

<gs_event>-form = ‘<f_top_of-page>’
BY MR. BABU (OASIS TECHNOLOGIES)
Append <gs_event> to <gt-events>

…………............

………………………

Endform.

<gs-header>-typ = “H / S / A”

<gs-header>-key = <key information up to 20 char>

<gs-header>-into = <heder data up to 60 char>

Append <gs-header> to <gt-header>.

Call function ‘reuse_alv_commentary_write’

Exporting

It-list-commentary = <gt-listheader>

i-logo = <logo_name> “ Upload using t-code OAER

…………………………….

Endform.

Steps To Work With PF_STATUS_SET:-

1) Copy the system provided generic functions (push button) from the standard program ‘SAPLSALV’
and the status 'STANDARD' into the required custom program and menu status.

2) Add additional customer specific 'push buttons' and generic functions to copied status.

3). Populate an ALV event PF_STATUS_SET and its dynamic sub routines into an internal table 'gt_event'

Of the type 'SLIS_T_EVENT'.

EX:- FROM:

PROGRAM : SAPLSALV.

STATUS : STANDARD.

TO:
BY MR. BABU (OASIS TECHNOLOGIES)
PROGRAM : ZALV_REPORT.

STATUS : ZMENU_STATUS.

Call the copied menu status using the ABAP statement 'SET_PF_STATUS' within the definitions of the
dynamic sub routine 'PF_STATUS_SET'.

EX: :

FORM <F_POP_EVENT>.

*TOP_OF_PAGE*

*PF_STATUS_SET EVENT.*

<gs_event-name> = 'pf_status_set'.

<gs_event-form > = <'f_pf_status_set'>.

APPEND gs_event to gt_event.

ENDFORM.

FORM <F_>PF_STATUS_SET> USING <FT_EXTAB> TYPE SLIS_T_EXTAB.

*Exclude unwanted push buttons*


BY MR. BABU (OASIS TECHNOLOGIES)
<ls_extab>-tcode = <'ECRB'>.

APPEND <ls_extab> to < ft_extab>.

*Call menu status*

SET PF_STATUS '<ZMENU_STATUS>' [ EXCLUDUNG <FT_EXTAB> ].

ENDFORM.

NOTE:-Above same steps can be explained in case of a question as ' Steps to add custom generic
functions ' push buttons in ALV reports.

TYPE : SLIS_T_EXTAB :-

It is used to populate the function codes of the unwanted generic functions (or) push
buttons to be excluded in ALV reports (or) output.

This type has a field 'FCODE' which can be filled with the unwanted function code of the
push buttons.

Steps To Work With ALV Events USER_COMMAND (Or) Steps To Provide Interactive Functionality:-

1. Populate an ALV event user_command & its dynamic sub routine (F_USER_COMMAND) into an
internal table (gt_event) of the slis_t_event.

2) Provide the required interactive functionality such as 'to call another transaction code'(or) to display
another ALV drill down report (or) call another program or form when the push buttons are selected (or)
the current record (or) field value is clicked (or) double-clicked in ALV output.

EX:-

BUT
BY MR. BABU (OASIS TECHNOLOGIES)
F1 F2 F3 F4 F5 F6
4970
: FIELD1
:
: FIELD2
: :
:

CALL ANOTHER T-
CODE
DRILL DOWN

BUTTON2

F1 F2 F3 F4 F5
10
20

INTERACTIVE ALV
:
:
:
:
NOTE:- Function code for the double click functionality in ALV reports ‘&IC1’ and in Interactive classical

Report is ‘PICK’

Sample Code:-

FORM <F_POP_EVENT>.

*TOP_OF_PAGE * -> 'HEADER' *

:
BY MR. BABU (OASIS TECHNOLOGIES)
:

*PF_STATUS_SET* -> PUSH BUTTONS*

*USER_COMMAND* -> INTERACTIVE FUNCTIONALITY*

<gs_event-name> = 'USER_COMMAND'.

<gs_event-form > = <'F_USER_COMMAND'>.

APPEND gs_event to gt_event.

ENDFORM.

FORM <F_USER_COMMAND> USING <F_UCOMM> TYPE SY-UCOMM <FS_SELFIELD>,

TYPE SLIS_SELFIELD.

*Interactive functionality*

CASE F_UCOMM.

*Double click functionality (or) interactive ALV reports*

WHEN '&IC1'.
BY MR. BABU (OASIS TECHNOLOGIES)
*Interactive functionality.....................*

CALL TRANSACTION......../SUBMIT..............

*Display another ALV report*

DELETE <gt_first> WHERE <F1> NE <fs_selfield>-value.

*display <gt_first> in ALV format*

NOTE:- Copy internal table,

*Interactive functionality based on selected push button*

WHEN '<BUT>'.

CALL TRANSACTION ....................

ENDCASE.

6) TYPE:- SLIS_T_SELFIELD:-

It is used to capture the selected row (or) line value in ALV reports.

NOTE:-

FOLLOWING ARE THE SOME OF THE USEFUL FIELDS

FIELD DESCRIPTION

1) Tab name Final internal table name of the selected row.

2) Tab index Index of the selected row (or) line.

3) Field name Field name of the selected field value.

4) Field value Field value of the selected field.


BY MR. BABU (OASIS TECHNOLOGIES)

Steps To Change The Layout By Selecting A Variant [Format Variant]:-

Use a selection screen event AT SELECTION SCREEN ON VALUE REQUEST FOR on the change
layout variant input field.

pass an input field name to a field VARIANT of the structure variable of the type DISVARIANT.

Use an ALV function module REUSE_ALV_VARIANT_F4 to provide a search help to choose a


change layout variant to be passed to an ALV display function modules.

Pass the populated structure variable of the type DISVARIANT to an export parameter
IS_VARIANT of ALV display function module either list (or) grid.

EX:- :

*Provide search help in layout variant*

AT SELECTION SCREEN ON VALUE REQUEST FOR <FVAR>.

PERFORM F_LAYOUT_SHELP.

FORM <F_LAYOUT_SHELP>.

*Pass data for variant*

<wa_variant> -report = SY-REPID.

<wa_variant>-variant = <p_var>

*pass search help on change layout variant*

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'.

EXPORTING

IS_VARIANT = <wa_variant>

I_SAVE = 'A' 'save layout'.

IMPORTING

ES_VARIANT = <wa_variant_c>.

:
BY MR. BABU (OASIS TECHNOLOGIES)
:

FORM <f_display_alv>.

* call ALV display function*

EXPORTING

IS_VARIANT = <WA_VARIANT_C>.

8) TYPE: SLIS_KEYINFO_ALV:-

It is used to populate the key fields information to display header and the corresponding
item data in (hierarchical format) hierarchical ALV.

FOLLOWING ARE THE SOME OF THE USEFUL FIELDS:-

FIELD DESCRIPTION

HEADER01-HEADER05 Header key field

Item01-Item05 Items key fields

NOTE:-

The below parameter should be passed additionally to an ALV function module.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'.

EXPORTING...............

I_TABNAME = '<GT_VBAP>' 'internal table name'

TABLES

T_OUT TAB = <gt_vbap>. 'internal table data'

NOTE:-

The below parameter should be passed additionally to an ALV function module


'REUSE_ALV_HIERSEQ_LIST_DISPLAY' incase of hierarchical ALV.
BY MR. BABU (OASIS TECHNOLOGIES)
CALL FUNCTION "REUSE_ALV_HIERSEQ_LIST_DISPLAY".

EXPORTING.

I_TABNAME-HEADER = <GT_VBAK>. header internal table name.

I_TABNAME-ITEM = <GT_ITEM> . item internal table name.

IS_KEYINFO = <GS_KEYINFO>. key field information.

TABLES

T_OUTTAB_HEADER = GT_VBAK . header internal table data.

T_OUTTAB_ITEM = GT_VBAP. item internal table data.


BY MR. BABU (OASIS TECHNOLOGIES)
Module Pool Programming (Or) Screen Painter (Or) Dialog Programming

 This concept is used to maintain different types of screens and corresponding flow logic.
 This concept contains mainly two parts
1. Module pool program.
2. Screen painter.

Module pool program:-

 The module pool programs are used to define the modules of the flow logic in screens.
 The program type for module pool is ‘M’.
 The transaction code SE38 is used to maintain module pool program
 It can have 4 Include programs such are * TOP, *F01, *I01 and *O01

*TOP Include: It is used to declare global data declarations which can be accessed across screen

* F01 Include: It is used to define sub routines which can be used in module definitions

* O01 Include: It is used to define PBO(Process Before Output) Modules

* I01 Include: It is used to define PAI (Process After Input) Modules

Note:-The module pool program must be created first before the screens are designed.

Syntax:- MODULE <module-name> INPUT/OUTPUT.

*Data declarations
|
|
*Business logics
|
|
PERFORM <f_subroutine>……..
ENDMODULE.

Note:- The module pool name and screen program name must be similar.
BY MR. BABU (OASIS TECHNOLOGIES)
Screen painter:-

 This workbench tool is used to maintain different types of screens.


 The transaction code SE51 is used to work with screen painter.
 Following are different types of screens.
a) Normal screen
b) Sub screen
c) Dialog screen
d) Selection screen

a) Normal screen:-

The normal screens or main screens which can be called through transaction
codes or using ABAP statement ‘CALL SCREEN’.

b) Sub screen:-
 The sub screens are part of main screens which can be main screen (normal).
 The sub screens can’t be executed independently.
 The flow logic ABAP statement ‘CALL SUBSCREEN’ is used to call the sub screen
areas in the normal screen.

Note:-

• The pushbuttons (or) menu status is not possible on the subscreen.


• It is not possible to call sub screen with in the sub screen.

c) Modal dialog screen:-

It is used to populate (or) display the data on popdialog box with some genric
functions.

d) Selection screen:-
 The selection screen is reserved for reports (or) executable programs.
 The screen number 1000 is reserved for selection screen
BY MR. BABU (OASIS TECHNOLOGIES)

NORMAL SCREEN
NORMAL SCREEN

TAB1 TAB2
Sub Screen
SUB SCREEN

Push Button
BUTTON BUTTON

F1 F2 F3

10 A B

20 C D Modal Dialogue Window

ICON1 ICON 2

Different components in screen painter:-

Following are different components in screen painter

i. Attributes
ii. Element list
iii. Flow logic
iv. Layout

Attributes:-

It contains the technical details of the screen such are type of the screen, next screen
number, package etc………
BY MR. BABU (OASIS TECHNOLOGIES)
Element list:-

It contains the screen elements, attributes and properties of the screen elements in the
normal screen and sub screen and attributes such are general attributes, texts or input output
templates, special attributes, display attributes, modification groups

Note:- Make a input list as drop down list by selecting option under the tab input or output.

 This component is used to make the screen elements visible, invisible change the
dimensions and etc..

Note:- The modification groups which can be used to format the screen dynamically are

Specified by using modification groups.

Layout:-

 It is used to design the screens with different screen elements.


 Following are different types of screen elements.
a) Text fields:-
To define the text fields for screen field labels on the screen.
b) Input / output field:-
It is used to define input or output fields on the screen.
c) Checkbox:-
To define the check box on the screen.
d) Push button:-
It is used to define the push button on the screen.
e) Tab strip control:-
To define the tab strip control to work with the different subareas on the screen.
f) Tab strip (with wizard):-
 It is used to define the tab strip control using the wizard.
 The system generates the basic source code (or)program incase or wizard.
g) Subscreen area:-
It is used to define the subsreen areas on the main screen (or) on the tabstrip
control.
h) Table control:-

It is used to define the tablecontrols to maintain multiple line items (or) records on
the screen.

i) Table control with wizard:- wizard:-


 It is used to define the table controls using wizards.
BY MR. BABU (OASIS TECHNOLOGIES)
 The system generates the basic source code (or) program which is related to table
control.
j) Custom control:-
 It is used to define the custom controls in the screens.
 The custom controls must be created in OOABAP ALV reports.
k) Status icon:-
It is used to define the status icons on the screen.

l) Box: It is used to define boxes around screen elements in the screens

TEXT FIELD
CUSTOM GBB

INPUT/OUTPUT

TAB 1 TAB 2 F1 F2 F3 F4

FIELD 1

FIELD 2

TTab

 CHECK BOX

o RADIO BUTTON 1
o RADIO BUTTON 2

BUTTON 1 BUTTON 2
BY MR. BABU (OASIS TECHNOLOGIES)

Screen Painter Attributes:-

They are used to maintain different attributes or setting of a screen elements such are
function code, function type, dropdown list etc……..

a) Drop down:- These are two types of drop down options:-


i. List Box:- To list out only the values.
ii. List box with key:- To list out the values with corresponding keys when the
drop down icon is pressed.

Note:- There must be foreign key relationship between value and text fields of a text
table.

b) Groups:- They are used to specify the radio button group name (or) modification
group name.
c) FCT code:- Function code of a push buttons or menu items.
d) Dictionary Attributes:-
 It is used to maintain the attributes of the data dictionary objects such are table
(or) structure fields.
 Some of the dictionary objects are: data format, search help, conversion exit
etc….
e) Program Attributes:-
 It is used to maintain the different attributes of input (or) output fields.
 Following are different types of inputs:
i. Required:-
To make the screen input field as mandatory.

ii. Possible:-
It is default action to accept the input values at runtime.
iii. Not possible:-

In case of this option input is not possible but the field can be used as output field.

iv. Recommended:-
To make the input fields as optional. The symbol question mark is appeared in the
input or output field.

Note:- Check the checkbox output only to restrict the input data.

v. Display Attributes:-
BY MR. BABU (OASIS TECHNOLOGIES)
To maintain different attributes such are invisible, output styles, 2d display etc…….

4) Flow logic:-

 This component is used to provide the link between the module pool program and screens
 It can also be used to control the data flow between the screens.
 The screen related ABAP statements such are modules, MODULE, CALL
SUBSCREEN, CHAIN etc… statements can be used in flow logic.
 Events associated with screen painter (or) module pool program are
1. PROCESS BEFORE OUTPUT (PBO).
2. PROCESS AFTER INPUT(PAI).
3. PROCESS ON HELP-REQUEST (POH).
4. PROCESS VALUE-REQUEST (POV).
1. PROCESS BEFORE OUTPUT (PBO):-
 This event is triggered before the screen is displayed.
 It can also be triggered while performing any action on the screen.
 This event is used to provide the input data on the screen fields (default values).
 It can also be used to format the screen elements dynamically.

Syntax:-

PROCESS BEFORE OUTPUT

*pass default values

MODULE <def_val>

*FORMAT screen

MODULE <format-screen>

Module pool program

MODULE <def_val> OUTPUT

SELECT
BY MR. BABU (OASIS TECHNOLOGIES)
|

<screen-field> = <def_val>.

ENDMODULE.

MODULE <format_screen> OUTPUT.

LOOP AT SCREEN.

IF screen-name = ‘<screen field>’.

Screen-active = ‘1/0’.

MODIFY SCREEN.

ENDLOOP.

ENDMODULE..

2. PROCESS AFTER INPUT (PAI):-


 This event is triggered after the input values are provided in the screen and perform any
action on the screen.
 This event is used to validate the input data on the screens.
 It can also be used to process the screen data based on the performed action (pressed push
button menu item etc……)
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax:- |

PROCESS AFTER INPUT

*validate input field

CHAIN

FIELD : <SCREEN-FIELD1> MODULE <validate-field1>,

<SCREEN-FIELD1> MODULE <validate-field1>.

ENDCHAIN.

*process input data.

MODULE <process-data>

Module pool program

MODULE <validate-field1> INPUT.

SELECT……………

WHERE <field1> = <screen-field1>

IF sy-subrc NE 0.

MESSAGE ……………..

ENDIF.

ENDMODULE.
BY MR. BABU (OASIS TECHNOLOGIES)
*module <process-data> pool program.

MODULE <process-data> INPUT.

*data process and update database tables

CASE SY-UCOMM

WHEN ‘<DELT>’

DELETE <dbtab> FROM <wa_dbtab>…………

WHEN ‘<UPDT>’

MODIFY <dbtab> FROM <wa_dbtab>.

ENDCASE.

ENDMODULE.

3. PROCESS ON HELP-REQUEST (POH):-


 This event is triggered when the F-Key ‘F1’ (or) help icon(?) is pressed.
 This event is used to provide the help documentation on the screen fields.
 The transaction code ‘SE61” or ‘SO72’ is used to maintain help documentation.
 The standard function module ‘HELP_OBJECT_SHOW’ (with technically) and function
module ‘DSYS_SHOW_FOR_F1HELP’ (with-out technical information) are used to
display the maintain help documentation.
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax:-

FLOW LOGIC

PROCESS ON HELP-REQUEST

*help documentation

FIELD <screen-field> MODULE <help-doc-field1>

Module pool program:-

MODULE <help-doc-field1> INPUT.

*F1 help with technical information

CALL FUNCTION ‘HELP_OBJECT_SHOW’

EXPORTING

DOCUMENT NAME = ‘<ZHELP_DOC>’ “maintained in SE61 or SO72.

(or)

*F1 help without technical information

CALL FUNCTION ‘DSYS_SHOW_FOR_F1HELP’.

EXPORTING

DOCUMENT NAME = ‘<ZHELP_DOC>’. “maintained in SE61 or SO72.

ENDMODULE.
BY MR. BABU (OASIS TECHNOLOGIES)
4. PROCESS ON VALUE-REQUEST:-
 This screen event is triggered in case of function key F4 (or) search help icon is
pressed.
 This is event is used to populate and display the custom search help on screen input
fields.
 The standard function module “F4IF_INT_TABLE_VALUE_REQUEST” is used to
display the populated interval table data as search help.

Syntax:- FLOWLOGIC

PROCESS ON VALUE-REQUEST

*search help

FILED <SCREEN-FIELD1> MODULE <search_help>.

Module pool program:-

MODULE <search_help> INPUT

*Data declaration

*populate data for search help

SELECT <field1>

FROM <dbtab>

INTO TABLE <lt_help>

*function to display search help.

CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’

|
BY MR. BABU (OASIS TECHNOLOGIES)
TABLES

Value-tab = <lt_shelp>

Value-tab = <lt_return>

ENDMODULE.

Module Pool program, Flow logic and screen elements communicate as below

Module Pool Program Flow Logic Screen


Program <ZMOD_PROGRAM> PROCESS BEFORE OUTPUT. SCREEN APPLICATION

MODULE<dep_value>OUTPUT. *Default values & format screen. SCREEN

*Default value and format screen. MODULE <def_format> SCREEN FIELD 123

| PROCESS AFTER INPUT SCREEN FIELD

| *Validate & process screen i/p Press F1 Press F4


field
END MODULE |
MODULE<Validate_process>
MODULE
<validate_process>INPUT. PROCESS ON HELP_REQUEST. BUTTON

*Validate i/p data and process *HELP documentation.


data.
MODULE<help_doc>.
|
PROCESS ON VALUE_REQUEST.
End module.
*Search help
MODULE<search_help>INPUT

*Display help documentation

END MODULE.

MODULE<search_help>INPUT
MODULE<Search_help>
*Display search help.

END MODULE.
BY MR. BABU (OASIS TECHNOLOGIES)

Module screen flow statement:-

This statement is used in flow logic to call the define process module pool programs.

Syntax:-

[FIELD <screen-field1>] MODULE <module-name>.

Some of usefull additions:-

i. ……..AT EXIT-COMMAND:-
This command is used to trigger the dialogue module in case of push button (or)
menu item with the function type ‘E’ exit is pressed.
Syntax:-
…….. AT EXIT-COMMAND.

ii. …….AT CURSOR-SELECTION:-


 this addition is used to trigger the corresponding module when the cursor is placed on
the input field of a screen.
 It can also be used to trigger corresponding module in case of a pushbutton (or) menu
item with F-type ‘S’ (system) (or) ‘CS’ (cursor selection) is pressed.

iii. CHAIN……..ENDCHAIN:-
 This statement is used in flow logic to define the process chains.
 It can be used to make all the screen input fields enables to enter input data.

Note:-

The screen validations without CHAIN…..ENDCHAIN statements make the screen


input fields greyed out (display mode).

Syntax:- CHAIN.

FIELD <screen-field1> MODULE <validate-field1>.

FIELD <screen-field2> MODULE <validate-field2>.

ENDMODULE.
BY MR. BABU (OASIS TECHNOLOGIES)
Usefull additions to CHAIN….ENDCHAIN statements:-

i. MODULE ON CHAIN-REQUEST:-

The module with ON CHAIN-REQUEST is used to trigger the corresponding module


on the specified screen fields (in the sequence).

ii. MODULE ON CHAIN INPUT:-


The module ON CHAIN INPUT is used to check the individual conditions of the
screen fields in the sequence.

Syntax:-

CHAIN

FIELD <screen-field1> MODULE <mod-name> ON CHAIN-REQUEST

FIELD <screen-field2> MODULE <mod-name2> ON CHAIN-INPUT

ENDCHAIN.

Field statement:-

 This statement is used in flow logic to trigger corresponding module on the specified
field.
 It can also be used to combine multiple screen fields in to process chains.

Sysntax:-

FIELD <screen-field1> MODULE <mod-name>.

*or

CHAIN

FIELD : <screen-field1>

|
BY MR. BABU (OASIS TECHNOLOGIES)
ENDCHAIN.

Creation of the below screen to update the customer master data:-

MENU. . . . . . . . . .

CUSTOMER DATA
TEXT FIELD

TETECCXC

CUSTOMER NO.

CUSTOMER NAME I/O FIELD

CITY

COUNTRY PUSH BUTTON

DISPLAY UPDATE DELETE

EXIT

Steps to create module pool program

 Execute the transaction code ‘SE38’.


 Enter the module pool program name.
 Click on create button.
 Enter title.
 Select program type module pool (M).
 Select an appropriate status and applications.
 Click on yes button.
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter the required package name.
 Click in save icon.
 Create the tr by pressing create request icon.
 Click ion yes button.
 Activate program.

Steps to create a screen:-

 Enter transaction code ‘SE51’.


 Enter created module pool program name.
 Enter screen number.
 Click on create button.
 Enter short text.
 Click on layout button.
 Click on text field screen element.
 Place it on screen.
 Adjust screen element size and position by drag and drop.
 Enter the name (customer) and required text.
 Click on dictionary / program fields window (F6).
 Enter required table / structure.
 Press enter button.
 Select the required fields as per specifications.
 Click on yes button.
 Place it on screen at an appropriate position by pressing left mouse button.

Note:- Adjust the screen fields by drag and drop.

 Click on push button and place it on screen at the required position.


 Increase or adjust the push button by holding at corners.

Note:- The screen elements are in pink color background until the required information or
fields are filled.

 Double click on push button and fill the required fields such are name, text, function
code…

Note:- Select an appropriate icon if required.

 Cancel the screen attributes window.

Note:- Follow the similar steps for any number of push buttons.
BY MR. BABU (OASIS TECHNOLOGIES)

TEXT FCT CODE

Display DISP

Update UPDT

Delete DELT

Exit EXIT

‘ ‘

‘ ‘

 Click on activate icon and press enter.


 Close the screen painter.
 Click on flow logic button.
 Uncomment the system generated PBO module.

Steps to create a module:-

 Double on click on module name.


 Click on yes button.
 Select an appropriate include or main program.
 Click on yes button.
 Press enter button.
 Uncomment system generated ‘SET PF-STATUS’.
 Enter the menu status name
Ex:- SET PF-STATUS ‘<ZMODULE_STATUS>’
 Double click on menu status name.
 Click on yes button.
 Press enter button.
 Enter short text.
 Click on yes button.
 Expand function keys under user interface.
 Enter function codes for back, exit, cancel icons.
BY MR. BABU (OASIS TECHNOLOGIES)

Ex:-
Function code Icons

BACK

EXIT

CANCEL

 Click on activate icon.


 Press enter button.
 Click on back icon.

Note:- Uncomment the system generated statement ‘SET-TITLE BAR’ and provide title.

 Click on pretty printer button.


 Click on activate icon.
 Press enter and back icons.
 Uncomment the system generated PAI module ‘USER_COMMAND_0500’.

Note:- Define customer specific modules also.

 Double click on the PAI module name (USER_COMMAND_0500).


 Click on yes button.
 Select an appropriate include program *IO1 (or) main program.
 Click on yes button.
 Press enter button.
 Implement required business logic for each push button (or) menu item.
 Activate the module pool program.
 Click on back.

Steps to create a T-code for screens:

 Execute T-code SE93.


 Enter transaction code name.
 Click on create button.
 Enter short text.
BY MR. BABU (OASIS TECHNOLOGIES)
Note: make your first radio button is selected.

 Click on yes button.


 Enter the required module pool program name.
 Enter the required screen number
Ex: program: < >.
Screen no: < >.
 Check all the GUI supports.
 Click on save icon and enter the required package name.
 Click on save icon and press enter.

Database Manipulation Statements:

1. Database Update: the below statements are used to update the database tables.
i. MODIFY Statement:
 This statement is used to create (or) modify the data in the database tables.

Syntax: MODIFY<dbtab> FROM <gs_dbtab>.”single record”.


(or)
MODIFY<dbtab> FROM <gt_dbtab>.”multiple record”.

MODIFY = UPDATE + INSERT

Note: The modify statement modifies the data in case of entry available in DB tables.

 The modify statement creates (or) inserts a new record in case of an entry is not available
in the DB Tables.

ii. UPDATE Statement: This statement is used to update dbtab with new data.
Syntax: UPDATE <dbtab>FROM <gs_dbtab>.”single records.”
(or)
UPDATE <dbtab>FROM <gt_dbtab>.”multiple records.”

Note: This statement can also be used with an addition ‘SET’ statement.

Syntax: UPDATE <dbtab> SET <f1> = <gs_dbtab-f1>

<f1> = <gs_dbtab-f1>

[where<condition>…]
BY MR. BABU (OASIS TECHNOLOGIES)

iii. INSERT Statement: This statement is used to insert a new record into dbtab.
Syntax: INSERT <dbtab>FROM <gs_dbtab>.”single records.”
(or)
INSERT<dbtab>FROM <gt_dbtab>.”multiple records.”

2. DELETE Statement:
The ABAP statement DELETE is used to delete the data from the dbtab.
Syntax: DELETE <dbtab>FROM <gs_dbtab>.”single records.”
(or)
DELETE<dbtab>FROM <gt_dbtab>.”multiple records.”

[Where<conditions>…]
IF sy-subrc = 0.
*commit the changes.
COMMIT WORK.
ELSE.
*revert the changes.
ROLL BACK WORK.
ENDIF.

Note:

• User database multiplication statements outside of loop statements as much as possible


for better performance.
• The ABAP statement UPDATE cannot be an internal table.
• The ABAP statement APPEND cannot be database tables.

COMMIT WORK:

 This statement is used to commit the changes in database tables.


 This statement completes current ‘SAPLUW’ and opens the new one.

Syntax: MODIFY <dbtab>….

or

UPDATE <dbtab>….

or

DELETE <dbtab>….
BY MR. BABU (OASIS TECHNOLOGIES)
IF sy-subrc = 0.

COMITT WORK[AND WAIT].

ENDIF.

Note: An additional statement ‘WAIT’ is used to wait until the high property or update task
or SAPLUW requests are finished.

ROLL BACK WORK:

 This statement is used to revert the changes from update work process.
 This statement is used to close the current SAPLUW (database-logical unit of work)
And opens a new task.

Syntax: MODIFY <dbtab>….

or

UPDATE <dbtab>….

or

DELETE <dbtab>….

IF sy-subrc = 0.

ROLLBACK WORK

ENDIF.
BY MR. BABU (OASIS TECHNOLOGIES)
Tab Strip Control

It is a set of tab pages and used to place different sub screens of application on single screen.

Each tab page contains title and its page area.

Below steps to be performed to work with tab strip control

 Create tab strip control with title on Main screen


 Assign sub screen area to the corresponding tab
 Make the necessary code changes in flow logic
 Write processing logic in Module Pool Program.

Example:-

a) Flow Logic:

PROCESS BEFORE OUTPUT.


...
CALL SUBSCREEN <sub_area> INCLUDING [<prog>] <sub_screen_no>.
...

PROCESS AFTER INPUT.


...
CALL SUBSCREEN <sub_area>.
...

b) Process Logic-MPP

CONTROLS <ctrl> TYPE TABSTRIP.

*Pass function code of selected tab or button to make it as active tab

<tab_control>-activetab = ‘<FCT_CODE>’.

Note: Define Tab strip control using wizard since it generates the necessary flow logic and
Process logic in MPP
BY MR. BABU (OASIS TECHNOLOGIES)

Scenario on tab strip control through SE80

Note1: Push buttons can't be defined on sub screen areas


Note2: sub screens can't be called inside another sub screen

Steps to create Tab-strip control using wizard:

-> Execute T-Code 'SE80'.


-> Select program under Object selector
-> Enter Program name [ex: ZB23_TAB_STRIP]
-> Press enter button
-> Click on yes button
-> Enter TOP include name [ex: ZB23_TAB_STRIP].
Note: uncheck the checkbox with TOP INCL for executable programs
-> Click on yes button
-> Enter TOP include name [ex: ZB23_TAB_STRIP_TOP]
-> Click on yes button
-> Click on Yes button
-> Enter required package name
-> Click on save icon
-> Create TR by pressing create request icon.
-> Click on yes button
NOTE: Right clicks on Includes folder then click on create to create any number of include
programs
Such as *F01 , *O01, *I01.

Creation of screen:
-> Right click on MPP name [ex: ZB23_TAB_STRIP]
BY MR. BABU (OASIS TECHNOLOGIES)
-> Click on create
-> Click on screen
Note: different modules can be defined directly by right clicking on Module pool program
name.
-> Enter screen number [ex: 0100]
-> Click on YES button
-> Enter short text
-> Click on layout button
Note: Define text field for screen title and define input, output screen fields using an icon
'Dictionary or program fields' OR using screen elements input or output field.

Creation of Tab strip using Wizard:


Click on screen element tab strip with wizard
-> place it on screen at the required position by adjusting size
-> Click on continue button
-> Enter Tab strip name[ex: TAB_STRIP]
-> Click on continue button
-> Enter tab texts
Ex:
tab strip
Vendor
-----------
Customer
-> Click on continue button
Note: System proposes sub screen numbers and function codes for tabs they can be changed
if required
-> Click on continue button
-> Enter Include program names for data, PBO and PAI modules.
Ex: Include for Data: ZB23_TAB_STRIP_TOP
" PBO: ZB23_TAB_STRIP_O01
" PAI: ZB23_TAB_STRIP_I01
-> Click on continue button.
Note: in completed step is appeared with RED color traffic light , completed steps with green
color traffic light
-> Click on complete button
-> Create or define required push buttons on main screen and complete screen design
-> Click on activate icon
-> Click on yes button
-. Close screen painter window
-> Click on flow logic and make necessary changes if required
Note: System generated code is in change/Edit mode to add additional functionality

Design of sub screens:


-> Expand screens folder
-> double click on system generated sub screen
BY MR. BABU (OASIS TECHNOLOGIES)
Note: Make sure… screen type "sub screen" is selected
-> Click on layout button
-> Click on dictionary or program fields window
-> Enter required table or structure [ex: LFA1]
-> Press enter button
-> Select required fields
-> Click on 'YES' button
-> place it on sub screen area and adjust sub screen area if required
-> Click on activate button
-> press enter button
-> Close screen painter window
Note: follow similar steps for any number of required steps

Code Changes [Tab strip screen - 0100]


uncomment PAI module [ex: user_command_0100] and define with below logic

'
'
'
CASE SY-UCOMM.
WHEN 'DISP'.
PERFORM f_get_data. " get data from LFA1,KNA1.
'
'
'
ENDCASE.
Vendor sub screen
Uncomment PBO module [STATUS_0101] and define with required business logic.
'
'
'
MOVE-CORRESPONDING gs_lfa1 TO lfa1.
'
'
'
Customer sub screen:
Uncomment PBO module[STATUS_0102] and define with required business logic.
'
'
MOVE-CORRESPONDING gs_kna1 TO kna1.
'
'
BY MR. BABU (OASIS TECHNOLOGIES)

Creation of Transaction code:


-> Right click on MPP name [ex: ZB23_TAB_STRIP]
-> Click on create
-> Click on transaction
-> Enter T-code name [ex: ZB23_TAB-STRIP].
-> Click on YES button
-> Enter MPP name.
-> Enter main tab strip screen [0100].
-> Click on save icon
-> Enter package name
-> Click on save icon…after all GUI support options checked.
• Demo Program and T-code on Tab strip control is ZB23_TAB_STRIP

Table Control:

It is used to maintain multiple entries in tabular format. Multiple rows are processed using
Loop with control.
• It can be resized to display, change and save data.
• System provides Vertical, Horizontal strollers
Below steps are used to work with table control
 Define or declare tab strip control in Module Pool program
 Define or create Table control on screen by filling all necessary fields
 Make necessary code changes in flow logic and write process logic in MPP

Example:-
a) Module Pool Program

CONTROLS:<Table_control> TYPE TABLE VIEW USING SCREEN <xxx>.

Flow Logic
PROCESS BEFORE OUTPUT.
*Process each row of table control with control
LOOP AT <gt_itab> INTO <gs_itab> WITH CONTROL <table_control>
CURSOR <table_control>-current_line.
………………….
ENDLOOP.

PROCESS AFTER INPUT.


*Process each row of table control
LOOP AT <gt_itab>.
………………….
BY MR. BABU (OASIS TECHNOLOGIES)
ENDLOOP.

Note: Define table control using wizard since system generates all necessary flow logic
and process logic in MPP

Scenario on creating Table Control with Wizard from executable program

Steps to create screen:


-> Once the program is in change mode
-> Write ABAP statement CALL SCREEN <screen numb> [ex: CALL SCREEN 0100]
-> double click on screen number.
-> Click on yes button
-> Press enter button to save program
-. Enter short text.
-. Click on layout button.
Creation on table control with wizard:
-> Click on screen elements … Table control with Wizard
-> place it on screen at the required position
-> Adjust table control size by holding left mouse button on screen
-> click on continue button
-> Enter name of table control [ex: TABLE_CONTROL]
-> Click on continue button.
-> Select radio button… internal program table to make use of internal table.
Note: An option dictionary table can be used for database or data dictionary tables.
-> Enter/Select required internal table name [ex: GT_CSKS].
-> Check the check box table work area and select/enter required work area [GS_CSKS].
-> Click on continue button.
Note: make sure module pool program name or executable program name is activated before
screen is created or table control is created.
-> Click on continue button..After required fields are selected.
-> Select radio button input control to make fields of table control editable
Note: by default an option 'Output only' [Display mode] is selected
-> check the check box scroll.
-> Click on continue button.
BY MR. BABU (OASIS TECHNOLOGIES)
-> enter required include program names …such as *TOP,*O01,*I01 and * F01.
-> Click on continue button
-> Click on complete button.
-> Click on activate icon … to activate screen.
-> Click on yes button.
-> Close screen painter after design is completed.
-> Click on flow logic.
Note: Loop statement must be used under PBO and PAI to process multiple rows of table
control…before it is displayed and after any action is performed.
Note: make any additional required changes in flow logic if required.
-> activate screen logic
-> Click on back icon
BY MR. BABU (OASIS TECHNOLOGIES)
File Handling Techniques
Introduction:

• These techniques are used to upload the data from the specified file path from legacy
system into an internal table of the programs.
• They are also used to download data from an internal table of program into the
specified file path of Legacy system.
• There are 2 types of file handling techniques:
a. Front End System/Local PC
b. Application Server -AL11

a. Front End System/Local PC:

Upload: The System provided standard function modules GUI_UPLOAD/WS_UPLOAD/UPLOAD


is used to upload data from the specified path of Local PC into an internal table of programs.

Download: The standard function modules GUI_DOWNLOAD/WS_DOWNLOAD/DOWNLOAD is


used to download the data from an internal table into the specified file path of the front end
system (Local PC).

Note:
 Files from Local PC cannot be processed in back ground since standard FMs give run
time errors.
BY MR. BABU (OASIS TECHNOLOGIES)
 The function module which starts with GUI* are advisable since it has a Delimiter
parameter (Has field separator) and support any format from ECC6.0
 The function modules UPLOAD and DOWNLOAD are outdated.
 The standard function module “ALSM-EXCEL_TO_INTERNAL_TABLE” is used to upload
the excel file data into an internal table.

F4_FILENAME Function Module:

• It is used to provide the search help to select the required file path of the Front end
system/Local PC.
Example:
AT SELECTION SCREEN ON VALUE-REQUEST FPR <P_FILE>.
CALL FUNCTION ‘F4_FILENAME’
EXPORTING
Program_name = sy-repid.
Dynpro_number = sy-dynnr.
Field_name = <‘P_FILE’> “only in uppercase
IMPORTING
file_name = <P_FILE>

Here <P_FILE> is a parameter to enter file path.

MOVE-CORRESPONDING and INTO CORRESPONDING Statements:

• This statement is used to move corresponding field data from the source to the
destination work areas or field symbols and internal tables.

Syntax: MOVE-CORRESPONDING <wa_source> TO <wa_destination>. “ While processing
SELECT <f1>
<f2>
…..
INTO CORRESPONDING FIELDS OF TABLE <gt_itab> …. “ While Extracting

Figure: Source to Destination


BY MR. BABU (OASIS TECHNOLOGIES)
Note:
 In the real time these statements are not advisable since it consumes more time to
search for the relevant similar field in destination structure or internal table

Demo Program on handling files in presentation server is “ZFILE_HANDLING_PC”

b. Application Server:

• It is used to maintain files securely.


• The Transaction Code ‘AL11’ is used to work with Application Server.
• It can be used to handle files in background.

Download / Transfer:

• The below ABAP statements are used to transfer the data from an internal table into the
specified file path of application server (AL11).
1. OPEN DATASET FOR OUTPUT….
2. TRANSFER …..TO
3. CLOSED DATASET…

1. OPEN DATASET ….FOR OUTPUT:

• This statement is used to open the required files in write mode in Application server.
Syntax:
OPEN DATASET <p_file> FOR OUTPUT IN TEXT/BINARY MODE ENCODING DEFAULT [MESSAGE
<gv_msg_text>]
2. TRANSFER Statement:

• This statement is used to transfer the concatenated data (String Line-gv_line) into the
opened file.
Syntax:
LOOP AT <gt_final> INTO <wa_final>.
*Convert numeric data into Character.
<gv_char> = <gv_numeric>. “ Convert Number type
WRITE <wa_final-currencyt> TO <gv_amnt_c>. “ Convert Currency data type
*Concatinate the data
CONCATENATE <wa_final.field> ----<gv_char> <gv_amnt_c>
INTO <gv_line>.
BY MR. BABU (OASIS TECHNOLOGIES)
*Transfer the concatenated data
TRANSFER <gv_line> TO <P_File>.
CLEAR <gv_line>.
END LOOP.
3. CLOSED DATASET Statement:

• It is used to close the opened file in the server.


Syntax:
*Open File
…..
*Transfer File
…..
*Close Opened File
CLOSE DATASET <P_File>

Upload:

• The below ABAP Statements are used to read or upload data from the file in an
application server into an internal table of the program.
1. OPEN DATASET.. FOR INPUT
2. READ DATASET
3. CLOSE DATASET

1. OPEN DATASET …FOR INPUT:

• This statement is used to open files in read mode.


Syntax:
OPEN DATASET <P_File> FOR INPUT IN TEXT/BINARY MODE [ENCODING DEFAULT MESSAGE
<gv_msg.text>]

Note:

1. An additional statement ENCODING DEAFAULT must be used encode file format in


ECC6.0 since it is Unicode system.
2. An additional statement ‘MESSAGES’ is used to capture the messages (errors) into a
string variable.

2. READ DATASET:
BY MR. BABU (OASIS TECHNOLOGIES)
• This statement is used to read record by record (line by line) from the opened file in
Application Server.

Syntax:
DO.
*Read Record by record.
READ DATASET <P_File> INTO <wa_final>.
IF sy-subrc EQ 0.
*Append Internal Table
APPEND <wa_final> TO <gt_final>.
ELSE.
*Exit out of the loop.
EXIT.
ENDIF.
CLEAR: <wa_final>.
ENDDO.

3. CLOSE DATASET:

• This statement is used to close the opened file.

Demo Program on handling files in application server is “ZFILE_HANDLING_SERVER”

Providing Search Help on the Application Server(AL11):

• The standard function modules “F4-DXFILENAME_TOPRECURSION” (or)


“/SAPDMC/LSM-F4-SERVER-FILE” is used to provide search help to choose the file path
in an application server.

The Functionality of File Handling in the server is as below:

1. Download or Transfer:
BY MR. BABU (OASIS TECHNOLOGIES)

2. Upload:

Steps to open the file in an application server (AL11):

• Execute the transaction code AL11.


• Double click on the appropriate required directory.
• Double click on the required transferred filename to see the data.

Download the files from an application server:

• The transaction code CG3Y is used to download the files from an application server into
the presentation server or front end system or local pc.

Steps to download the file from an Application Server:

• Execute the transaction code CG3Y.


• Enter the source file name (example: download.txt) in an application server.
• Select the target file name on the front end system by pressing ‘F4’.
• Click on download icon (Shift+F1).
• Click on cancel (F12).

Upload the files into an Application Server:

• The transaction code ‘CG3Z’ is used to upload files from the presentation server / front
end system / Local PC into an application server (AL11).

Steps to Upload:

• Execute the transaction code ‘CG3Z’.


• Enter the source file name on the front end system.
• Enter the target file name in an application server.
• Select the required data format (BIN/ASC).
BY MR. BABU (OASIS TECHNOLOGIES)
• Click on upload icon (shift + F2).

Note:
 Make sure the directory in an application server is not opened while writing /
transferring the data.
 The transaction code ‘FILE’ is used to maintain logical and physical file paths.
 The standard function module ‘FILE_GET_NAME’ can be used to get the logical file
path of the physical file.

Steps to maintain the physical and logical file paths:

• Execute the transaction code ‘FILE’ and click ‘Yes’ button.


• Double click on the folder ‘Assignment of Physical Paths to Logical Paths’.
• Click on ‘New Entries’ button.
• Maintain logical and physical path details.
• Example: Logical File – ZFILE_NAME
Physical File – D:/USR/SAP/ECE…….-Path from AL11.
• Click on ‘Save’ icon.
• Create the ‘T.R’ if required.
• Click on ‘Yes’ button.

Data migration/conversion
Introduction:

• This concept is used to migrate or convert a flat file data from the legacy system into sap
data base.
• Following are the different methods or techniques to migrate or convert the
Flat file data.
1. LSMW (Legacy system migration work bench).
2. BDC (Batch data communication).
3. Using standard BAPI (Business application programming interface).
4. Direct input method using standard programs.

The functionality of data migration/conversion is as below:

[DIAGRAM]-Refer Notes
BY MR. BABU (OASIS TECHNOLOGIES)
SD Flow and MM flow:

Refer Notes

LSMW (Legacy system migration work bench):

• It is the system provided tool to migrate/convert a flat file data from the legacy system
into sap data base.
• The legacy system data can be imported in different import methods using LSMW.
• The T-code LSMW is used work with LSMW
• Following are different import methods:
a) Standard batch or direct input.
B) Batch input recording.
c) Business object method (BAPI).
d) IDOC (Intermediate document).

NOTE:
 An import method batch input recording is mostly used with LSMW.

Steps to work with LSMW

• Execute the t-code LSMW.


• Click on yes button.
• Enter project name, subproject name, object name.
• Click on create entry icon.
• Click on yes button.
• Click on create entry icon.
• Enter short description for project.
• Press ‘Enter’ button.
• Enter short description for sub project.
• Press the ‘Enter’ button.
• Enter name for object.
• Click on yes button.
• Click on execute icon.

NOTE: All the process steps can be performed (14-17) are appeared.

STEP-1: Maintain Object Attributes:


BY MR. BABU (OASIS TECHNOLOGIES)
• This step is performed to select any one of the different import methods. Such are,
batch input recording /BAPI/IDOC,etc.

Steps to perform Maintain Object Attributes:

• Click on execute icon.


• Click on display/change button.
• Select radio button “batch input recording”.
• Enter the recording name.
• Click on recordings over view icon that appears beside the recording field.
• Click on create recording.
• Enter the recording name.
• Enter short description.
• Click on yes button.
• Enter the required transaction code as per the specification.

NOTE: In the real time the functional transactional codes screen fields recordings can be done
By functional consultants.
• Click on ‘Yes’ button.
• Enter valid from ____ to _____ .
• Enter cost center.
• Press ‘Enter’ button.
• Fill all the required mandatory fields such are: name, person responsible, hierarchy area,
company code and profit center.
• Click on save icon.------- Related to “ks01”.
• Click on save icon to save the recording.
• Double click on the screen field(csksz-kokrs).
• Remove the default values.
• Enter the field name.
• Click on yes.

NOTE: Follow the similar steps for any number of screen fields to which the data to be
Transferred from the flat file.
Example:
Screen field Default value Name
Csksz-kokrs Kokrs
Csksz-kostl Kostl
Csksz- 18:03:2014
dbtab_anb
Csksz-ktext Kyext
BY MR. BABU (OASIS TECHNOLOGIES)
Csksz-verak Verak.

• Click on save.
• Click on back.
• Click on back.
• Click on save icon to save maintain attributes step.
• Click on back.

STEP-2:Maintain Source Structures:

• This step is preformed to maintain the structure name of the flat file.

Steps to perform:

• Click on execute icon.


• Click on display/change icon.
• Click on create structure icon.
• Enter the source structure name and description.
• Click on yes button.
• Click on save.
• Click on back.

STEP-3: Maintain Source Fields:

• It is performed to maintain the fields of the source structure to hold the flat file data.

Steps to perform:

• Click on execute icon.


• Click on display/change icon.
• Place the cursor on source structure name.
• Click on create field icon.
• Enter field name (kostl), field length, field type.
• Click on yes button.

NOTE:
 Refer the given flat file (or) DBTAB to know field type and length.
 The field type “character” is mostly used to define the source fields.
BY MR. BABU (OASIS TECHNOLOGIES)

NOTE: Follow the similar steps for any number of source fields.

Source fields Data type Length


Kokrs C 4
Kostl C 4
Ktext C 6
Verak C 6
Prctr C 4

• Click on save icon.


• Click on back icon.

STEP-4: Maintain Structure Relations:

• This step is performed to maintain the relationships with the BDC structure.

NOTE: This step is performed by the system automatically, hence no need to perform this
Step manually.

STEP-5: Maintain Field Mapping and Conversion Rules:

• This step is performed to map the fields and maintain the conversations.

Steps to perform:

• Select a radio button “maintain field mapping and conversation rules”.


• Click on execute icon.
• Click on display/change button.
• Place the cursor on the regarding screen field.(KOKRS)
• Follow the similar steps to map any number of source structure fields of the flat file to
the screen fields of recording.

Recording
ZB_REC_KS01
BY MR. BABU (OASIS TECHNOLOGIES)
Ktext Source structure
Kokrs ZB_SOURCE_STRCTR
Kostl Kokrs
Verak Ktext
prctr Prctr
Kostl
Verak

NOTE: ABAP source code can also be written in “LSMW” using the change icon that appears
besides recording structure field.

• Click on save.
• Click on back.

STEP-6: Maintain Field Values, Translations, User defined Routines:

• It is performed to maintain default values, transactions and user defined routines for
the screen fields of the recording.

NOTE: This step can be skipped in case of not required to maintain any fixed values and
Translations.

STEP-7: Specify Files:

• It is performed to specify the flat file and the data separators from which the data to be
migrated.

Steps to perform:

• Select a radio button ‘Specify files’.


• Click on execute icon.
• Place the cursor on the required file location or directory.
• Click on display/change icon.
• Click on create icon select the required flat file by pressing f4.
• Click on open button.
• Enter flat file name.
• Select an appropriate “delimiter” such are: coma,tabular,blanks,……
• Click on yes button.
BY MR. BABU (OASIS TECHNOLOGIES)
• Double click on the imported and converted data to reduce the file length in case of file
length exceeds 45 characters.

NOTE: Length of the file under imported and converted data should not exceed 45 characters.

• Click on save icon.


• Click on back.

STEP-8: Assign Files:

• This step is performed to assign the flat files to the source structure.

NOTE: This step is performed by the system automatically hence it can be skipped.

STEP-9: Read data:

• It is performed to read the data from the uploaded flat file.


Steps to perform:

• Select the radio button “read data”.


• Click on execute icon.
• Click on execute.
• Click on back.
• Click on back.

STEP-10: Display Read Data:

• It is used to display the uploaded data of a flat file.

Steps to perform:

• Select a radio button “display read data.


• Click on execute icon.
• Click on yes button.
• Click on back after displayed data is cross checked with the flat file.

STEP-11: Convert Data:

• It is performed to convert the uploaded data of the flat file.

Steps to perform:
BY MR. BABU (OASIS TECHNOLOGIES)
• Select a radio button “convert data”.
• Click on execute icon.
• Click on execute.
• Click on back.
• Click on back.

STEP-12: Display Converted Data:

• This step is performed to display the converted data of a flat file.

Steps to Perform:

• Select a radio button “Display Converted Data”.


• Click on execute icon.
• Click on yes button.
• Click on back.

STEP-13: Create Batch Input Session:

• This step is performed to create a batch input session which can be processed to
migrate the converted flat file data into data base tables through screens.

Steps to Perform:

• Select a radio button “Create Batch Input Session”.


• Click on execute.

NOTE: The check box “Keep Batch Input Folders” can be checked to keep the processed
session in the system, otherwise the processed session is deleted by the system
automatically.

• Check the check box “keep batch input folders”.


• Click on execute icon.
• Click on yes button.

STEP-14:Run Batch Input Session:

• It is performed to run the Created batch input session to migrate or update the data
through the screens of the t-codes.
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to Perform:

• Select a radio button “Run Batch Input Session”.


• Click on execute icon.
• Select the created batch input session name.
• Click on process button.

NOTE: The button “log” is used to analyze the created log file while migrating the data.

• Click on process button again.


• Keep on processing enter until all the records of the flat file are migrated.
• Click on session overview button.

NOTE: Tick mark is appeared for all the processed sessions under status column.

BDC(Batch Data Communication):

• It is a utility to develop programs /reports to migrate or convert the flat file data into the
data base tables.
• The BDC has two methods.

a)Session method.
b) Call transaction method.

Session Method:

• In case of session method the data is updated in synchronous mode only.


• The standard function module “BDC_OPEN GROUP”, “BDC_INSERT”,
“BDC_CLOSE_GROUP” are used to work with session method
• The system generates one log file while processing the created batch input session.
• The t-code SM35 is used to check or process the over view of the batch input session.

1) BDC_OPEN_GROUP Function Module:

• This function module is used to create or open the batch input session which can be
processed using the t-code SM35.
• The below parameters can be passed:
CALL FUNCTION ‘BDC_OPEN_GROUP’
EXPORTING
*client = sy-mandt “system client number.
Group = <p_group> “session name to be created in SM35.
BY MR. BABU (OASIS TECHNOLOGIES)
keep = ‘X’ “Xkeep the processed session in SM35.
*user = sy_uname “user name who executed the program .
*prog= sy_cprog “ system program name.

* indicates optional.

2)BDC_INSERT Function Module:

• This function module is used to insert the screen table data of the structure ”BDCDATA”
with Transaction into session.
• The screen table (GT_BDCDATA) can be processed to migrate the corresponding data
into data base tables through the specified t-code by processing the created session.
• The below parameters can be passed:
CALL FUNCTION ‘BDC_INSERT’
EXPORTING
T-code = ‘<t-code>’ “required functional t-code.
*CTUPARMS =<wa_ctu_parms> “handles screen resolution of table control in session.
TABLES
Dynprotab =<gt_bdcdata> “screen table of type bdc data with flat fuile data.

NOTE: An export parameter “CTUPARMS” is used to handle the screen resolution in case of
table control to process the multiple line items in session method.

3) BDC_CLOSE_GROUP Function Module:

• This function module is used to close the opened batch input session.
• No need to pass any parameters to this function module.

4) Call Transaction Method:

• It is used to update / migrate/ convert the data in both synchronous and asynchronous
mode from flat file into data base tables through screens.
• This method is faster than the session method.
• The ABAP statement “CALL TRANSACTION” is used to work with this method.

Synatx:
CALL TRANSACTION ‘<TCODE>’ USING <GT_BDCDATA> MODE
BY MR. BABU (OASIS TECHNOLOGIES)
<A/N/E>UPDATE<S/A>[messages into <gt_bdcmsgcoll>].
Here:

• <TCODE> is the required transaction code through which the flat file data to be
migrated/converted.
• <gt_bdcdata> is an internal table of type “bdc data” structure.
• <A/N/E> are different data process modes.
A = All screens.
N = No screens.
E = Error screens.
• <S/A> are the different update modes.

S = Synchronous mode.
A = Asynchronous mode.

• <gt_bdcmsgcoll>is an internal table of the type “bdcmsgcoll” structure.

NOTE: The screen resolution of the table controls is maintained in call trans action method
using the below
Syntax:
CALL TRANSACTION ‘<TCODE>’USING<GT_BDCDATA> OPTIONS FROM
<wa_ctu_params>[Message INTO <gt_bdcmsgcoll>].
Here:
<wa_ctu_params> is a structure data variable of the type “CTU_PARMS” DDIC structure.

Different data process Modes in Call Transaction Method:

• Following are the different modes to process the data in call transaction method.

I. A-All Screens:

• This data process mode displays all the screens while migrating/converting a flat
file data.

II. N-No Screens:

• This data process mode is used to process the data without showing any screens
(background).

III. E-Error screens:


BY MR. BABU (OASIS TECHNOLOGIES)
• This data process mode is used to display the error screens while processing the
data.

IV. P-Process Mode:

• It is almost similar to no-screens mode. But only the difference is the no-screens
mode does stop the break points in called transactions. Whereas the process mode
stops at the break points.

Different data Update Modes:

• There are 3modes to update the data into data base tables through the required t-code
screens.

a.)S-Synchronous Mode:

• It is used to update/migrate the data by giving an acknowledgement.


• In case of this mode the data is not continuously updated/migrated in case of error
records.

Ex: railway system, courier,……

b.) A-Asynchronous Mode:

• It is used to update/migrate the data continuously by skipping the error records.


Ex: roadtransport,normalpost,……

NOTE: The synchronous update mode is stopped with an error record whereas the
asynchronous mode skips the error records.

c.)L-Local Update:

• It is used to update/migrate the data with local update task.(Set update task local).

Some of the useful fields in BDCDATA structure:

Field Description
BY MR. BABU (OASIS TECHNOLOGIES)
Program BDC module pool
DYNPRO BDC screen number
DYN BEGIN BDC screen start
FNAM Field name
FVAL BDC field value(flat file).

Common Steps involved in BDC:

• Record screen flow of the required functional t-code using the t-code “SHDB”.

NOTE: In the real time screen flow recording is mostly given by the functional consultants.

• Convert the recorded screen flow into a temporary program.


• Upload flat file data into an internal table.
• Convert/translate/validate the uploaded flat file data within the loop of flat file internal
table (gt_flat_file).
• Copy the system generated subroutines which start with “BDC_DYNPRO” (screen no)
and “BDC_FIELD” from the temporary program of the recording which has been
generated by the system with in the loop of flat file internal table.
• Comment screen default values and pass the flat file data.
• Use any one of either session/call transaction to update/migrate the data.

Screen flow Recording -SHDB

• The t-code SHDB is used to record the screen flow as the t-codes.

Steps to Record Screen flow:

• Execute t-code SHDB.


• Click on create new recording button.
• Enter recording name.
• Enter the required t-code Ex: VA02.
• Click on start recording button.
• Enter order number ex:4970
• Press enter button.
BY MR. BABU (OASIS TECHNOLOGIES)
• Click on yes button.
• Change the required fields.
• Click on save icon.
• Click on yes button.
• Click on save icon.]Related to VA02.
• Click on save icon to save the recordings.
• Click on process button.
• Check the recording.

NOTE: An icon export is used to download the recording into local pc.

• An icon import is used to upload the recording file into an transaction recorder.
• Keep on pressing enter button until the recording process is done.
• Click on back.

Steps to Convert Recording Into Temporary Program:

• Execute t-code SHDB.


• Enter the required recording name.

NOTE: Use * symbol to list out all the recordings in a system.


• Select the required recordings, click on create program button.
• Enter temporary program name Ex: YTEMP_REC.
• Select a radio button transfer from recording.

NOTE: An option read from file is used to generate a program using the given recording file.

• Click on yes button.


• Enter title.
• Click on source code button.
• Click on local object button.
• Copy the system generated sub routine which starts with bdc_dynpro and bdc_field.
• Paste them with in the loop of a flat file internal table in the original program bdc.
• Comment default values of a screen field.
• Pass the data from flat file internal table.

Scenario on BDC:

Change the sales document data using the given flat file.
T-code: VA02.
BY MR. BABU (OASIS TECHNOLOGIES)
Tables: VBAK, VBAP.

Batch Input Session:

• The t-code SM35 is used to work with the created batch input session to process
session, check the log file etc.

Steps to Work with the Created Session:

• Execute t-code SM35.


• Enter the required session to be processed.

NOTE: Use * symbol to list all the sessions.

• Select the session name.


• Click on process button.
• Press the ‘Enter’ button.
• Keep on pressing enter button until the session is finished.
• Click on session overview button to check session.

NOTE:
 The button log is used to check the system generated log file analysis the
messages.
 The session can be scheduled in background to migrate the data without user
interaction using the tab “In Background”.

Steps to Check Log file and rectify errors:

• Once the session is processed select the errors session.


• Click on log button.
• Then select the created log overview.
• Click on display button/analyze session button.
• Analyze the system given message.
• Rectify the errors in flat file.

NOTE: Remove the processed records from the flat file, rectify error record then re process
Session in case of error record in session method.
• Click on back.

Demo program on BDC Session Method is ZB_MIGRATE_SESSION


BY MR. BABU (OASIS TECHNOLOGIES)
Scenario on BDC-Call Transaction Method:

Creation of banks using the given flat file.


T-code: FI01.
Tables: BNKA…..

Demo program on BDC Session Method is ZB_MIGRATE_CALL

Steps to Handle Messages in Call Transaction Method:

• Get the message details such are, message type message number into an internal table.
(gt_bdcmsgcoll) of the type BDCMSGCOLL using an addition “…..MESSAGES INTO” with
CALL TRANSACTION statement.
• Set a loop into an internal table (gt_bdcmsgcoll) of the type “bdcmsgcoll”.
• Use any of the function modules “FORMAT_MESSAGE”/ “WRITE_MESSAGE” to get the
corresponding message text, since the structure “BDCMSGCOLL” does not have any
message text field.

NOTE: The standard table “T100” can also be used to populate the message text.

• Display the populated messages with message text either list or ALV

Some of the Useful fields in DDIC structure BDCMSGCOLL:

Field name Description


TCODE BDC transaction code
DYNAME Screen program name
DYNUMB Screen number
MSGTYP Message type
MSGSPRA Message language
MSGID Message id
MSGNR Message number
MSGV1-MSGV4 Message variables.

Differences between LSMW and BDC:

LSMW BDC
1.It is system provided tool 1. It is utility to develop a program.
BY MR. BABU (OASIS TECHNOLOGIES)

2. The data can be imported in different 2. The data is processed or Migrated in batch
import methods such as batch input recording, input method only.
BAPI, IDOC.

3. It does not require any programming 3. It requires programming knowledge.


knowledge.

4. It is compatible for both large and small 4. It is compatible for small amount of data
amount of data. only.

5. The field mapping is done automatically by 5. The field mapping should be done manually.
the system.

6. It is not possible for custom 6. Can be used for custom screens or custom
screens/standard with custom fields of fields of applications also.
applications.
7. It cannot be used for new functional t-codes
7. It can be used for enjoy (new t-codes) (enjoy t-codes).
transaction codes also(ends with *N)
8. The t-code SM35 is used to develop BDC
8. The t-code LSMW is used to work with this program.
tool.

Differences between Session and Call Transaction Method:

Session Method Call Transaction Method


1. The data is updated/migrated in 1. The data is updated/migrated in both
synchronous mode only. synchronous and asynchronous modes.

2. The flat file data is processed 2. The flat file data is processed
asynchronously. synchronously.

3. The log file is generated by the system. 3. The messages should be handled explicitly
using the structure “BDCMSGCOLL”, and the
function modules “FORMAT_MESSAGE” /
“WRITE_MESSAGE”.
BY MR. BABU (OASIS TECHNOLOGIES)
4. The standard function modules 4. The ABAP statement CALL TRANSACTION is
“BDC_OPEN_GROUP”, “BDC_INSERT”, used to work with the call transaction method.
“BDC_CLOSE_GROUP” are used to work with
the session method.

5. It is not as fast as call transaction method. 5. It is faster than the session method.

6. One batch input session is created which 6. The t-codes are called for each record while
can be processed using the t-code SM35 after executing the program.
the program execution.

Table Control in BDC:

• The table control is used to update or migrate the multiple records (line items) in BDC.

Header data:
Doc No: 1
Line Items

Item no. Name


10 ABC PQR
20 MNO STU
……. ……. ….

Steps to Work with Table control in BDC:

• Record screen flow with line items using the t-code “SHDB”.

NOTE:
 Press page down in the table control to record the function code for page down.
 In the real time the recording is given by the functional consultants.
BY MR. BABU (OASIS TECHNOLOGIES)

• Convert the recording into a program using the button program.


• Make the below changes in the original main program.
i) Upload the flat file data which contains both header and item data.
ii) Split the uploaded fault file data into header and item tables, using the control
break statements.

[diagram]-Refer Notes

NOTE: The header and item data can be processed separately using the control break
statements without splitting the flat file data.

* Split Header and Item data


LOOP AT <gt_file> INTO <wa_file>.
ON CHANGE OF <wa_file-f1>.
MOVE <wa_file-f1> TO <wa_header-f1>.
APPEND <wa_header> TO <gt_header>.
ENDON.
<wa_item> = <wa_file>.
APPEND <wa_item> TO <gt_item>.
CLEAR:wa_file,
wa_header,
wa_item.
ENDLOOP.

• Set a loop to header internal table then process the header related data by copy and
paste the system generated header related subroutines from the temporary recording
program.
LOOP AT <gt_header> INTO <wa_header>.
REFRESH:<gt_bdcdata>.

* Process the header data


PERFORM bdc_dynpro………………..
PERFORM bdc_field………………..

• Set a loop to item table data to process the multiple line items.
• Make the item number dynamic by concatenating the screen field name with the screen
number.
BY MR. BABU (OASIS TECHNOLOGIES)
* Process the Line Items

LOOP AT gt_item INTO wa_item WHERE <f1> EQ <wa_header-f1>.


* Increase the Coutner to handle the Multiple Items
<gv_count> = <gv_count> + 1.

* Make Item No as Dynamic


CONCATENATE <'SCRNFLD' '(' '0' <gv_count> ')'
INTO <gv_fnam>.
PERFORM bdc_field USING 'BDC_CURSOR'
*'SCRNFLD(02)'.
<gv_fnam>.
…………………………………………

• Use the function code “p+” to handle page down in table control.
< lv_counter = lv_counter + 1.
IF lv_counter EQ <2>.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
CLEAR lv_counter.
ENDIF. >
ENDLOOP.

• Use any one of methods wither BDC_INSERT(Session) or CALL TRANSACTION to migrate


or converted data from intern al table GT_BDCDATA.

NOTE: The control break statements can also be used to process header and item data
separately by avoiding nested loops.

Scenario on Handling Table Control in BDC:

Change the sales document header and item data.


T-code: VA02.
Tables: VBAK, VBAP.

Steps to handle Screen Resolution in BDC table Control:

• Declare/define a structure data variable of the type “CTU_PARAMS”.


BY MR. BABU (OASIS TECHNOLOGIES)
Example:DATA:<wa_ctu_params> TYPE ctu_params.

• Pass the required data such are default size, display mode,update mode and etc to the
defined ctu_params structure variable.

<wa_ctu_params>-updmode = <p_umode>.
<wa_ctu_params>-defsize = <gc_x>.
<wa_ctu_params>-dismode = <p_pmode>.

• Use the populated structure variable of type ctu_params (gs_ctu_params) with CALL
TRANSACTION using an addition “OPTIONS”.

CALL TRANSACTION <TCODE> USING <gt_bdcdata>


OPTIONS FROM <wa_ctu_params>

MESSAGES INTO <gt_bdcmsgcoll>.

NOTE: 1.Pass the structure (wa_ctu_params) to an export parameter ‘CTUPARAMS’ function


Module “BDC_INSERT” in case of session method.
2.

Conversion Routines:

• The conversion routines are used to convert the data from internal format to external
format and external format to internal format.
• The conversion routines are maintained at the domain level of a field.
• The standard function module which ends with “*input” and “*output” are attached to
the maintained at conversion routines.

*INPUT Function Module:

• It is used to convert the field data from external to internal format.

Example: 4970000000….4970.

*OUTPUT Function Module:

• It is used to convert the field data from internal to external format.

Example: 00000……49704970.

Steps to find Conversion routine:


BY MR. BABU (OASIS TECHNOLOGIES)
• Execute t-code se11.
• Enter the required table name/domain name.
• Click on display button.
• Double click on the required data element name.(vbeln_va).
• Double click on domain name.

NOTE: The conversion routine name is appeared in the conversion routine field in case of
available

• Double click on conversion routine name to find the attached conversion routine
function modules (*input, *output).
• Click on back.

Parallel Cursor Method:

• The parallel cursor method is advisable in case of an internal table(nested) contains


huge amount of data.

Steps to use Parallel Cursor Method:

• Read an internal table with in the loop of base internal table and get an index of current
record.

LOOP AT <gt_header> INTO <wa_header>.


*Process header data
READ TABLE <gt_item> INTO <wa_item> WITH KEY <f1> = <wa_header-f1>
BINARY SEARCH.
IF sy-subrc = 0.
<lv_index> = sy-tabix.

• Set a loop to second internal table (item table) to process from the set index(lv_index)
• Use an “EXIT” statement to come out of second loop for unmatched records.

LOOP AT <gt_item> INTO <wa_item> FROM <lv_index>. "Avoid WHERE condition


IF <wa_item-f1> NE <wa_header-f1>.
EXIT. “ Comes out of loop
ENDIF.
…………………………….Process Item data.
ENDLOOP. "KNA1 Loop
ENDLOOP.
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: In the real time parallel cursor method is advisable than normal nested loop in case of
huge amount of data.
.Debugger
It is used to check the programs or source code line by line and block by block for finding and
rectifying errors or bugs.

Following are the different debuggers from version ECC 6.0

1) Classic Debugger
2) New Debugger

1) Classic Debugger:
• It is also called old debugger.
• This debugger opens on same session.
• It has lots of limitations such as different desktops are not there, no separate sections
for local, global variables etc.
2) New Debugger:
• This debugger is available from sap version ECC 5.0.
• This debugger opens in another new session.
• This debugger is user friendly with lots of actions such as different desktops ,
separate actions for local and global variables and objects.
• New debugger is default debugger from sap version ECC 6.0 and 5.0.

Note: The program or source code is stopped in classic debugger in case of maximum number

Of Sessions (6) are opened.

Following Are Some Of Usuable Tabs In New Debugger:

1) Desktop 1:
The variables section is displayed vertically to the source code or program in case of
this desktop.
2) Desktop 2:
It contains all the events used in source code or program.

Note: An icon ABAP source code under stack type is used to open source code or program from

The Debugger.

3) Desktop 3:
It is used to arrange variables section horizontally to source code or program.
4) Standard: It is a combination of desktop1 &2.
Following Are Different Sub tabs Under Desktop1 &3 Are Standard:

A) Variables 1& Variables 2:

They are used to check different data variables, values such as variables, work areas etc
and at a run time 16 data variables can be checked (2*8).

Note: In case of classic debugger 4 data variables at a time and maximum 8 variables then only
can be check.

B) Local Tab:

It contains all the local data variables and their values used in the function modules , sub
routines , methods etc.

C) Global:
It contains all the global data variables and their values in the program or source code.

6. Structures Tab:

It is used to check data structures, variables such as work areas, structure type, and field .

Symbols after they are assigned.

7. Tables:

It is used to check internal tables used in the program or source code.

8. Objects:

It is used to check objects of the program or source code such as work flow objects etc.

9. Break /Watch Points:

It is used to maintain break/watch points.

Short Cuts to Check Programs Or Source Code In Debugger:

Following are the different short cuts to check program or source code in debugger tool.

1) Single Step:
The function key F5 or single step icon is used to check line by line of the program or
source code.
EX:

Stop MOVE :< GV_SOURCE> TO < GV_DESTI>

F5 WRITE : ………….

2) Execute :
The function key F6 or execute icon is used to check block by block of program or source
code.

Stop PERFORM < F_BLOCK>… / CALL FUNCTION


F5 FORM < F_BOCK>…..
Process block

Write

F6 ENDFORM.

WRITE…………………

3) Return:

The function key F7 or an icon Return is used to return from the source code of the
process blocks such as sub-routines, function modules, methods etc.

Stop PERFORM < F_BLOCK>… / CALL FUNCTION


F5 FORM < F_BOCK>…..
Process block
F6
F7 WRITE
WRITE… END FORM.
Return

4) Continue:

The function key F8 or an icon continue is used to jump from one break point into the
next break point then execute once the last break point is reached.
Note: F5 -> Line By Line.
F6 -> Block By Block.
F7 -> Return From Source Code Of Blocks such as Sub routines, FM,
Modules..etc
F8 -> Jump From One Break Point To Another Then Execute

Break Points
They are used to stop the program or source code in the debugger tool for checking line
By line or block by block.

Following are the different types of break points.

 Session break points


 Static break points
 Dynamic break points
 External break points

Note: In the real time session break points are mostly used and external break points are used
rarely

1) Session Break Points:


• An icon set or delete session break point icon (ctrl + shift+ f12) or click on statement
line at gray color vertical section in the source code.
• To set or delete session break points.
• All the session break points are deleted automatically by the system once it is exit.

Steps To Set Session Break Points :

 Once the program or source is in display or change mode.

Note: The Program or Source Must Be Activated Before Session Or External Break Points Are
Set.

 Click on find icon find


 Enter the required find string

EX: gv_add / WRITE……………………….

 Select a radio button in main program.


 Click on yes button double click on required found location or line number.

EX: gv_add = p_input1 + p_input2.

(Or) WRITE: gs_final-f1…………….

 Click on STOP icon (session break point) or click on the statement line at gray color
vertical section to set or delete the session break points up to 30.

Note: The STOP icons are appeared beside the statement line once they are set.

 Execute the program or t-code.


 Fill the required fields.
 Perform the required action such as execute icon or save or enter button.

Note: The program or source is stopped in the debugger at the first set break point.

 Use the function keys F5/F6/F7/F8 to check line by line or block by block.

2) Static Break Points

The ABAP statements BREAK-POINT or BREAK<user_name> is used to set static points

Syntax: BREAK < BABU>. “ Advisable

* Or

BREAK-POINT . “ Strictly not advisable.

Note: In the real time the ABAP statement BREAK-POINT should not be used since all the
users are stopped.

Steps To Set A Static Break-Point:

 Once the program or source code is in change mode click on find icon.
 Enter required find string

EX:WRITE:…………

 Select a radio button in main program and click on yes button.


 Double click on required location or line number.
o Gv_add = p_input1 + p_input2
o WRITE :…………..
 Click on display or change icon
 Write an abap statement break followed by an user nae before which the statement line
to be stopped.
BREAK < BABU>.
Gv_add = p_input1 + p_input2
WRITE:…………

 Click on active icon & press enter button.


 Execute the program or source code fill all the required fields and perform the required
action such as execute.

Note: program or source code is stopped at the first set static break-point.

 Use the function keys f5/f6/f7/f8 to check line by line or block by block.

3) Dynamic Break Points:

• They are used to check the program or source code in case of not possible to
find a location

Where the program or source code to be stopped.

• The program or source code is stopped at the first statement line of the
performed action in case of dynamic point.
• The command /H is used to set dynamic break-points.

Steps To Set Dynamic Break-Point :

1) Execute the required program or T-code.


2) Fill all the required input fields or screen fields.
3) Enter /H in the command field.
4) Press enter button the system gives the success message as debugging switched on.
5) Once the dynamic break-point is set.
6) Perform the required action such as execute or save button.

Note: program or source code is stopped at the first statement line of performed action.

7) Use the function keys F5/F6/F7/F8 to check line by line or block by block.

4) External Break Points:

• They are used to check cross application component such as RFC-remote function
call, BAPI, business applications programming interface from another system.
• An icon set or delete external break-points is used to set or delete external break-
point.
Steps To Maintain External Break-Point Settings:

Click on UTILITIES menu item -> click on settings

Click on DEBUGGING tab & enter the required user name

EX: users SAPUSER & check IP MATCHING & enter .

Watch Points
 They are used to stop the programs or source code once the set condition is reached or
true.

 Watch points are defined inside the debugger only.

Note: Up to 9 watch points can only be created & up to 30 break-points can only be set in a
system.

Steps To Create Watch Points in New Debugger

1) Once the program or source code is stopped in new debugger.


2) Click on button WATCH POINT & create watch point.
3) Enter the required data variable or fieldname.
Ex: variable gv_add
4) Click on an icon display condition.
5) Enter the required free condition.
Ex: gv_add = 700 or gs_final-field = < field name>.
6) Click on yes button.

Note: The system gives a success message as watch point created once watch point is
created.

7) Click on F8 function key or continue icon.

Note: The program or source code is stopped once the set condition of watch point is
reached.

8) Use the function keys F5/F6/F7/F8 to check line by line or block by block.
Steps To Switch From New Debugger<--------->Classic Debugger

1) Once the program or source code is stopped in new debugger.


2) Click on debugger menu item----> switch to classic debugger ------> switch to new
debugger .
3) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps To Create Watch Points In Classic Debugger

1) Once the program or source code is stopped in classic debugger.


2) Click on the field name or variable name.
3) Enter the required relational operator.
4) Enter the required component field / value.
5) Click on yes button.

Note: The System gives a success massage as ‘watch point created’ once the watch point
is created.

6) Press F8 function key.

Note: The program or source code is stopped once the set condition of created watch
point is reached.

7) Use the function keys F5/F6/F7/F8 to check line by line or block by block.

Steps To Check Data Variables In New Debugger Or Classic Debugger:

1) Once the program is stopped in debugger double click on the data variable name such
as variables, work areas, internal tables etc..
2) Once the compiler icon is crossed the statement line.

Note: The corresponding data variables, type & length are displayed when the cursor is

Placed on data variable name in new debugger.

STOP 29. Gv_add = p_input1 + p_input2 “compiled

F5 30. Move …………… “Yet to compile

3) The corresponding values are displayed under value field or field contents.
EX: Field names : gv_char
Field contents : m
Note: Double click on the data structure variables (work area, internal tables) under variable
column to check

The corresponding content or data.

Steps To Change Data Variable Values In New Debugger:

1) Once the program or source code is stopped in new debugger double click on data
variable name such as variable name, field name or field value of an internal table (scrolls
the data variable section in right hand side).

Note: Data variable values can be change while debugging in development systems only.

2) Double click on change contents icon that appears beside value column change data
variable value.

3) Press enter.

4) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps To Change Data Variable Values In Classic Debugger :

1) Once the program or source code is stopped in classic debugger.


2) Double click on the required data variable name such as variables, field, and field
contents of an internal table.
3) Change corresponding field contents & click on icon change field contents.
4) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps to Use Goto Statement Function:

1) Once the program or source code is stopped in new debugger .


2) Place a cursor on the statement line from which program or source code to be re-checked.
3) Click on debugger menu item & click on “go to statement”.
4) Use the function keys F5/F6/F7/F8 to check line by line or block by block.

Differences Between Classic Debugger & New Debugger:

Classic Debugger:

1) It doesn’t have different desktops.


2) It opens on same session.
3) It doesn’t have different tabs to captures local variables, global variables, objects etc.
4) It has lots of limitations such as four data variables can only be checked at a time.
5) It is not possible to go back into the source code from debugger.
New Debugger:

1) It has different desktops.


2) It requires new session to open.
3) It has different tabs to captures local variables, global variables, objects etc.
4) It is user friendly with much functionality.
5) It is possible to get into the source code using desktop 2 (ABAP stack).
BY MR. BABU (OASIS TECHNOLOGIES)
FORMS:

Each organization or company needs to print their documents such are Orders, Bills, and
Invoices…etc in their day to day business process.

 The forms concept is used to design the documents or pages in the customer’s specific
format.
 Following are the different types of techniques to develop the forms.
1) SAP Script forms.
2) Smart Forms.
3) Adobe Forms.

1) SAP Script forms:

They are the client dependent since the contents are displayed or printed through text
elements.

 SAP Script forms is the text management system to design the documents or pages in
the required format.
 SAP Script form mainly contains two parts.
1. Form Painter (Layout set).
2. Print Program.

1) Form Painter (Layout set):


 This tool is used to maintain the page layouts.
 The transaction code “SE71” is used to work with the form painter.
 The form painter contains the following various elements to design the page layouts.
1. Header.
2. Pages.
3. Windows.
4. Page Windows.
5. Paragraph formats.
6. Character formats.

1. Header:

It is used to maintain the administration and basic settings data.

a) Administrative data:
BY MR. BABU (OASIS TECHNOLOGIES)
 It contains the technical details such are Package name, Changed by, Created by
and etc…
 It can also be used to maintain language attribute to translate a form into
different languages.

Note:

 By default translate “Into all languages” is selected.


 An option ‘to individual languages’ is selected to translate a form into the
specific languages.

b) Basic data:
 It is used to maintain the default basic settings which can be applied across
the forms.
 The different basic setting one page format, orientation, font size etc.

Note: The first page and the default paragraph names must be specified once they are created

Before the form is activated.

Following are the same of the useful page formats.

Format Orientation Width Units Height Units

*DINA4 P 00210 MM 00297 MM


(Default)
DINA5 P 00148 MM 00210 MM

ANY P 00999 MM 00999 MM

Following are the different types of units of measurement (UOM):

Units Short text

CH Characters
CM Centimeters
MM Millimeters
IN Inches
PT Point
TW Twips (1/20 point)
BY MR. BABU (OASIS TECHNOLOGIES)

Following are the default basic settings.

Page format
DINA 4
Orientation

o Portrait format Default paragraph 

o Landscape Format Tab stop 1.0 CH


Lines/inch Font family
6.00 Courier
Characters/inch Font size pt.
10.00 12.0
First page must must be specified

Rectangular format of the document page.

2. Pages:

 They are the rectangular format of the documents.


 This element is used to maintain the next page, print mode, page counter mode etc.
 Following are the different types of print modes.

Print Mode Short text

Default: No change of print mode.


S Begin new page in SIMPLEX mode(Single-
Sided)
*D Begin new page in DUPLEX mode
T Begin new page in TUMBLE DUPLEX
mode.(Double sided)

Following are the different types of Page counters:

Mode Short text


INC Increasing counter by 1
HOLD Not changing counter
START Setting counter to 1
BY MR. BABU (OASIS TECHNOLOGIES)
3. Windows:

 They are the small components on the pages.


 The windows are not positioned on the pages unless they are assigned to the
pages.(Page window)
 Following are the different types of windows.
Windows type Description

MAIN Window It is the default window to display or print the main content of the
document continuously.
Note: 1). The system generates the pages dynamically for main
window.
2). Up to 99(099=100) main windows can only be created.
3). It is not possible to create SAP Script form without main
Window.
CONSTant Window The constant window can be formatted only once to print or
display the same contents on all the pages.
VARiable Window The variable window can be formatted for each page to print or
display the different contents.
GRAPHic Window It is used to print or display the graphics or logos.

4. Page Window:

 They are used to position the window on the pages.


 Different position attributes Left margin, Upper margin, Window width, Height are
maintained.

Variable LOGO
Window
MAIN Window

Footer Window

Page Format: DINA4


BY MR. BABU (OASIS TECHNOLOGIES)
5. Paragraph Formats:

 They are used to format the entire paragraph of the document.


 This element contains the following attributes.

a).Standard Attributes:

 It is used to maintain the standard attributes such are alignment, line spacing,
left margin, right margin etc.

b).Font Attributes:

 They are used to maintain the font setting such are font family, font size, bold,
italic etc.

Tabs: The numbers of characters of tab position are maintained under tab attributes.

6. Character Formats:

 They are used to format the particular string of the paragraphs.


 They can also be used to select the bar codes.
 It contains the following different attributes.

a).Standard Attributes:

They are used to select required barcode, super script, subscripts …. Etc.

b).Font Attributes:

They are used to maintain the font type, font size, bold , italic …. Etc.

Ex:- format paragraph <C> character <1>


<P>
Paragraph format
<P>

<C>  Character format


BY MR. BABU (OASIS TECHNOLOGIES)
Different TAG columns in SAP Script forms :-->

Following are the different tag column in SAP Script forms.

Tag Meaning

* Default paragraph format

Continues text

= Extended line

( Raw line

/ Line feed

/= Line feed and Extended line

/( Line feed and raw line

/: Command Line

/* Comment Line

/E Text element

P Paragraph format

Symbols: The symbols are the constants which can be inserted on the page windows to
display or print the corresponding contents or Data.

 The symbols are enclosed between “&”.

Ex: &<Symbol>&

<Symbol> is a field or variable names.

 Following are the different type of symbol.

1. System Symbols.
2. Standard Symbols.
3. Application Symbols.
BY MR. BABU (OASIS TECHNOLOGIES)
1) System Symbol:
 The system symbol are used to display or print the system data such are date, time etc..

Following are the useful System Symbols.

Symbol Description
DATE System Date DD/MM/YYYY
DAY Day in DD (01, 02…)
number
MONTH Month in
number
YEAR The current YYYY
system year
TIME Time of the (HH:MM:SS)
current
system
HOURS The current (HH)
system Hours
MINUTES The current (MM)
system
minutes
SECONDS The current (SS)
system
Seconds
PAGE The Current
Page number
NEXTPAGE Next page
number
ULINE Horizontal
Line
VLINE Vertical Line

 The system provided Standard Structure SAPSCRIPT contains some of the SAP Script
system fields.
 Following are some of the useful system fields in the structure SAP SCRIPTS.
BY MR. BABU (OASIS TECHNOLOGIES)
FIELD Description

SUBRC Return code

FORMPAGES Total number of pages

COUNTER_0 General Counter Variable


to
COUNTER_9

DRIVER Spool(Print): Driver name

TELELAND Country Key

TELENUME Telecommunication Partner

Note:- Number of pages like “1 of 10 ” can be displayed or printed using the system symbols
page and form pages as below.

&PAGE& of &SAPSCRIPT-FORMPAGES&

Current Page number Total number of pages.

2).Standard Symbols:

 The standard symbols are the predefined symbols.


 The pooled table “TTDTG” is used to maintain the standard symbols.

Ex:-- &MFG&  Kind regards.

&DSM&  Dear Sir/Madam, etc.


BY MR. BABU (OASIS TECHNOLOGIES)
3).Application Symbols:

 They are used to display or print the processed data from the print program or
database.

Ex:-- &<WA_DBTAB-FIELD>&

&<DBTAB-FIELD>&

Print Program or Driver Program:

 The Print program is also called a Driver program.


 The Print/Driver program is used to extract the data from the database tables or
views, process the extracted data and pass the processed data to SAP Script from
to display/Print on the document.

Note:-- It is not possible to execute SAP Script form without Print program of driver
program.

Below function modules are used in Print program or driver program.

1. OPEN_FORM.
2. START_FORM.
3. WRITE_FORM.
4. END_FORM.
5. CLOSE_FORM.
6. CONTROL_FORM.

1) OPEN_FORM:
 This function module is use to provide a link between Print program and SAP
Script form.
 It can also be used to specify the default device name,
Control the dialog pop to choose the device etc.

Note:-- All the global data variables of the Print programs can be accessed in SAP Script form
after this function module is called to open a form.
BY MR. BABU (OASIS TECHNOLOGIES)
 Below parameters can be passed

*Open the form

CALL FUNCTION ‘OPEN-FORM’.

EXPORITNG

Device = ‘PRINTER’ “Default device type

Dialog= ’X’ “Dialog pop up to choose device name

Form= ’<ZB20_SCRIPT_FORM>’ “Form name

Language = sy-langu “system language

2) START_FORM: This function module is used to specify the starting page from which the
document to be printed, the below parameters can be pass.

*Start form to specify the start page to print the document.

CALL FUNCTION ‘START FORM’

EXPORTING

Form = ‘<ZB20_SCRIPT_FORM>’ “SAP Script form name.

Language = Sy-langu “System language.

Start page = ‘<PAGE1>’ “Start page name.

3) WRITE_FORM: This function module is used to pass the multiple entries of an internal
table from print program into “SAP Script form” to Print or display the multiple entries or line
items.
BY MR. BABU (OASIS TECHNOLOGIES)
 Below parameters can be passed.
PAGE WINDOW
LOOP AT <gt_itab> INTO <wa_itab>.

*Pass record by record to SAP Script .


form
.
CALL FUNCTION ‘WRITE_FORM’
.
EXPORTING
.
Element = ‘<ELE>’
E ELE
Function = ‘SET’

Type = ‘Body’ * &WA_ITAB_FIELD&


Window = ‘<MAIN>’

4) END_FORM: It is an optional function module to END the started form.


5) CLOSE_FORM: This function module is used to close the opened form and send the
Spool Request (Print).
 This function module can also be used to get SAO Script form data in OTF (other text
format) format.
Note:--
• The standard function module CONVERT_OTF or CONVERT_OTF_2_PDF can be
used to convert SAP Script form OTF DATA into PDF Format.
• The standard function module SO_NEW_DOCUMENT_ATT_SEND_API1 is used to
send an EMAIL with the required attachments in different formats.
• Below parameters can be passed.

LOOP AT <gt_customers> INTO <gs_customers>.

• Generate windows or pages Dynamically

CALL FUNCTION ‘CONTROL_FORM’.


EXPORTING
Command = ‘<New_window>/new_page>……’
.
.
.
ENDLOOP.
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: The mandatory function module in SAP SCRIPT form is OPEN_FORM, WRITE_FORM and
CLOSE_FORM.

Steps to create Sap Script Form:

**************************Refer Notes*************************

Logo Upload:

The transaction code SE78 or standard program RSTXLDMC is used to upload graphics or logos.

Steps to upload a graphic or Logo:

 Execute the transaction code SE78.


 Expand graphics folder
 Double click on “Bitmap images” folder (BMAP).
 Click on import icon.
 Select the required graphic logo file name by pressing F4 function key.
 Enter logo name and description.
 Select type of the logo either Black and White or color.
 Click on print preview icon F8.
 Click on back.

Steps to create a graphic window to insert a logo on page:

 Once SAP Script form is in change mode click on settings menu item click on settings
menu item click on form painter.
 Check the check box Graphical form painter.
 Click on yes button.
 Click on layout button.
 Right click on the page layout.
 Click on create graphic.
 Select or enter the required logo name.
 Select type of a logo either color/Black & White.

Note: An icon import can also be used to import the graphic directly.

 Click on yes button.


 Adjust the logo position and size by drag and drop.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on settings menu item.
 Click on from Painter.
 Uncheck Graphical from Painter to hide form painter.
 Click on yes button.
 Click on form menu item.
 Click on Activate and Click on back.

Different ways to Debug SAP Script form:

There are two ways to debug SAP Script forms.

1. Using menu path SE71UtilitiesActive Debugger.


2. By executing standard program “RSTXDBUG”.

Note: In the real time the form debugger is activated by using menu path.

Steps to Debug SAP Script form:

 Execute the T-code SE71.


 Enter the required SAP Script form name.
 Click on utilities menu item.
 Click on activate Debugger.

Note: The system gives a success message to inform ‘Form Debugger is activated ’.

 Execute the required T-Code or program.


 Enter the required Billing Document Number.
 Click on execute or output type.
 Click on OK button on form Debugger Window.
 Enter output device name (LP01 or LOCAL).
 Click on print preview button.
 Use the function key F5 or F6 in form Debugger.
 Enter the required symbol to check the corresponding contents.

Note: Double click functionality cannot be used to check the symbol values like source code
Debugger.

Steps to copy SAP Script form:

 Execute T-Code SE71.


 Enter the required form name and original language.
 Click on change button.
 Click on form menu item.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on copy form.
 Enter the existing form name.
 Click on yes button.
 Make the necessary changes in the copied form.
 Click on form Menu item.
 Click on Activate, Enter the package name and create the TR.

Download and Upload SAP Script form:

The system provided standard program ‘RSTXSCRP’ is used to download and upload SAP Script
form.

Steps to Download SAP Script form:

 Execute standard program ‘RSTXSCRP’ in the required system


(Development/Quality/Production).
 Enter the required SAP Script form name in object name field.
 Enter the required mode (EXPORT).
Ex: EXPORTDownload to local PC.
ImportImport from local PC.
 Click on execute icon.
 Select the required directory such are desktop or C drive, D drive etc.

Note: Change file name if required.

 Click on save button.

Steps to Upload SAP Script form:

 Execute standard program ‘RSTXXSCRP’ enter SAP Script form name as object name.
 Enter the mode IMPORT.

Note: The form name should be similar to downloaded form name.

 Click on execute icon.


 Select the required downloaded form file in text format.
 Click on back.

Note: The Standard program ‘RSTXXSCRP’ can also be used for standard texts and script form
Styles also.

Symbol Formatting Options:


BY MR. BABU (OASIS TECHNOLOGIES)
SYMBOL FORMAT DESCRIPTION

&SYMBOL& Display or print the content of symbols without any format.


&SYMBOL(N)& Display or print ‘N’ no. of characters.
&SYMBOL+N(M)& Display or print ‘M’ no. of characters from the positions ‘N’.
&SYMBOL(.D)& Display or print ‘D’ no. of Decimal places.
&SYMBOL(C)& To compress the content without spaces.
&SYMBOL(Z)& To remove the unwanted preceding Zeros.
&SYMBOL(R)& Display or print the contents by justifying the Right hand
side.
&SYMBOL(L)& Display or print the contents by justifying the Left hand side.
&SYMBOL(T)& Omit/remove thousand Separators.
&SYMBOL(K)& To avoid conversion routine.
&SYMBOL(S)& Display or print sign of the number.
&SYMBOL(<)& To Display the symbols sign at Left hand side.
&SYMBOL(>)& To Display the symbols sign at Right hand side.

Note: 1). the command /: SETSIGN RIGHT/LEFT can also be used to display or print sign of the
number symbols at Right or left hand side.

2) The check box sign at domain level should be checked to return sign of the number
field.

Some of Useful Commands In SAP Script Form

1. /:ADDRESS…..ENDADDRESS:
This command is used to display or print the address details of the given address
number in the standard format.
Syntax /: ADDRESS
/: ADDRESS number & GS_KNA1-ADRNR&.
/: ENDADDRESS

* OR

* Name: &GS_KNA1-NAME1&

* City: …………

1. /:SET DATE MASK:

This command is used to format the system date in the required format.

Syntax
BY MR. BABU (OASIS TECHNOLOGIES)
/: SET DATE MASK = ‘<DD.MMMM.YYYY>’

* Date: &DATE&

Following are different Date formats:

FORMAT DESCRIPTION

DD Day in number – 01………31.


DDD Day in short text form.
MM Month in number – 01…..12.
MMM Month name in short – Jan/Feb….
MMMM Month name in full – January/February.
Y Year in short—14/15…..
YYYY Year in Full—2014/2015…..

3. /: SET TIME MASK:

This command is used to format the system time in the required format.

Syntax

/: SET TIME MASK = ‘SS:MM:HH’

Note: Pass blank spaces to the formatted date and time to format them into default format.

Syntax /:SET DATE MASK = ‘ ’.

Control Statement (or) Condition statement 

The below control statements are used.

1. IF…..ENDIF:
/: IF <condition1> AND <condition2>
/* Process Block
/: ELSE IF <condition5> OR <condition4>
/* Process Block2
.
.
.
BY MR. BABU (OASIS TECHNOLOGIES)
/* ELSE
/* ELSE Block
/* ELSE IF.

2. CASE…..ENDCASE:
/: CASE &FIELD_NAME/VARIABLE&
/: WHEN ‘<VALUE1>’
/* Process Block1
/: WHEN ‘<VALUE2>’
/* Process Block2
.
.
.
/: WHEN OTHERS
/* OTHER BLOCK
/: END CASE

Note:

There is no loop statements in SAP Script forms but the text elements can be used to
communication with the function module WRITE_FORM used within the loop of the print
program to display or print the multiple entries.

Ex: LOOP AT <gt_item>

CALL FUNCTION ‘WRITE_FORM’

. Element = ‘ELE’ /E ELE

. *&GS_VBRP-POSNR&

ENDLOOP .

3. PROTECT…..END PROTECT:
This command is used to avoid page breaks in SAP Script forms.
BY MR. BABU (OASIS TECHNOLOGIES)
Syntax /: PROTECT

/E ELE

/: ENDPROTECT

DEFINE: This command is used to define the symbols in SAP Script the symbols in SAP Script
form.

Syntax /: DEFINE &GV_SYMBOL&

BOX: This command is used to define the Boxes or frames on the page windows.

Syntax /: BOX XPOS<**> cm/mm YPOS <yy> cm/mm

/: WIDTH <ww> cm/mm HEIGHT <yy> cm/mm

/: FRAME <FF> TW INTENSITY <yy> TW

Note: An addition INTENSITY is used to gray out the boxes.

• The command position and size can also be used to define the box position and
sizes.

/: POSITION X ORIGIN <XX> cm Y ORIGIN <YY> cm/mm.

/: SIZE WIDTH <WW> cm/mm INTENSITY <TT> TW.

TOP…….ENDTOP: This command is used to display or print the contents at the Top portion of
specified window.

Syntax /: TOP

/* Display or print at Top of page window.

/: ENDTOP

BOTTOM…….ENDBOTTOM: This command is used to display or print the contents at the


Bottom portion of specified window.

/: BOTTOM

/* Display or print at BOTTOM of page window.

/: ENDBOTTOM.
BY MR. BABU (OASIS TECHNOLOGIES)
NEW-PAGE: This command is used to generate the new pages.

/: NEW-PAGE.

NEW-WINDOW: This command is used to generate the new Windows.

/: NEW-WINDOW.

PERFORM……ENDPERFORM(FORM ROUTIENS):

Form Routines are used to add additional functionality to SAP Script form without making any
changes in the print program.

Syntax /: PERFORM <FORM_NAME> IN PROGRAM<Z_PROG>

/: USING <&IM_SYMBOL&>……

/: CHANGING <&Ex_SYMBOL&>……

/: END PERFORM.

* In program pool/Report.
FORM <FORM_NAME> TABLES <in_tab> STRUCTURE ITCSY
<out_tab> STRUCTURE ITCSY.
*Local Data declarations.
DATA: <ls_itcsy> TYPE ITCSY
*Get data from FORM.
READ TABLE <in_tab> INTO <ls_itcsy> INDEX <1>.”1st import symbol.
*Get data from DB table
SELECT…..
*out TAB.
READ TABLE <out_tab> INTO <ls_itcsy> WITH KEK name = ‘<EX_SYMBOL>’.
<ls_itcsy>-value = <lv_new>
*Modify <out_tab> FROM <ls_itcsy> INDEX <1>. “1st symbol.
.
.
ENDFORM.

ITCSY Structure:

This standard structure is use as a reference Import and Export the symbol with the form
routines in SAP Script form.
BY MR. BABU (OASIS TECHNOLOGIES)
Following are the field in the field in the structure.

FIELD DESCRIPTION

NAME Name of the program symbol(without &).


VALUE Text symbol value.

Standard Text:

The standard structure texts are used to maintain the long text.

 The T-Code SO10 used to maintain the standard text.


 The command INCLUDE … OBJECT is used to insert standard text on page window.

Syntax /: INCLUDE <ZSTP_TEXT_NAME> OBJECT <obj_name>

ID <Id_name> LANGUAGE <EN/….>

NOTE: Standard function module READ_TEXT can also be used in the programs to read
standard text.

Steps To Maintain Standard Texts:

 Execute the transaction code SO10.


 Enter the text name (ZB20_STD_TEXT).
 Click on create button.
 Enter the required standard text.

NOTE: The menu path GOTO Change editor is used to change the text editor.

 Click on save icon.

NOTE: The system does not generate the TR number directly while saving the standard
texts.

Creation of the TR for Standard Texts:

The system provided standard report ‘RSTXTRAN’ is used to generate a transport request
number for standard text.

Steps To Generate TR For Standard Texts:

 Execute the report or program RSTXTRAN.


 Enter the required standard text name (Z_STD_TEXT).
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on execute icon.
 Place a cursor on the standard text name.
 Press enter button.
 Click on the button ‘Transfer text to correction’.
 Click on yes button.
 Click on create request icon.
 Enter short description as per the project standards.
 Click on save icon.
 Click on yes button.

Steps to insert Standard Text on page windows in SAP Script forms:

 Once SAP Script form is in change mode click on page window button.
 Double click on required page window.
 Click on text elements icon.
 Click on ‘Goto’ menu item.
 Click on change editor Place a cursor on a line where the standard text to be
inserted.
 Click on insert menu item.
 Click on text.
 Click on standard.

NOTE: The menu path INSERTTEXTHypertext is used to insert the Hypertext (web link)
on the document.

Ex: www.oasis.com Hyperlink.

 Enter the required text name (ZB20_STD_TEXT).


 Click on yes button.
 Click on back.
 Click on form menu item.
 Click on activate.
 Click on Back.

Application Texts:

The application texts are maintained for long free text in each functional transaction codes.

 The standard function module READ_TEXT is used to read the application and standard
text.
BY MR. BABU (OASIS TECHNOLOGIES)
 The standard tables STXH and STXL contain the application text data on technical
information such are text object name, text ID and etc.

Steps to maintain application text:

 Execute the required functional T-Code VA02/VA01 etc.


 Enter the order or document number.
 Press enter button.
 Select the tab texts “TEXTS” for header or item data.
 Enter the required application.

Ex: Application

Text

From

VF02

 Click on save icon.

Steps to find technical details of an application text:

Once the application text is displayed after text tab is selected in any function T-Code.

 Double click on the application free text window.


 Click on goto menu item.
 Click on header.

Note: 1. Corresponding technical details such as textID, text object etc are displayed in text
header window.

2. The technical field value should be passed “READ_TEXT” to read corresponding text
or application text.
 Demo program on (sub routine pool) On Form routine ZB20_SUB_ROUTINE .

SAP Script Form Styles:

 Transaction code SE72 is used to work with SAP Script form styles.
 The command STYLE is used to specify the style name in SAP Script form.

Syntax: -- /: STYLE <ZSTYLE_NAME>

Note: The menu path FORMAT CHANGE STYLE in the page menu can also be used to
change styles.
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to create a style:

 Execute the T-code SE72.


 Enter style name up to 9 characters only.
 Click on create button.
 Click on yes button.
 Enter meaning.
 Click on paragraph format button.
 Enter the paragraph format button.
 Press enter button.
 Enter meaning.
 Click on font button.
 Enter the required font family and size.

Note: Select Bold, Italic, Underline if required.

 Click on tab button.


 Enter the required tab positions.

Note: Create any number of paragraph formats by pressing an icon create element or menu
path EditCreate element.

 Click on character format button.


 Enter the required character format name (C1).
 Press enter button.
 Enter meaning.

Note: 1. Select an appropriate “Bar code” if required.

2. The Transaction code SE73 is used for font maintenance.


To create customer specific fonts, Bar code and etc.
 Click on font button.
 Select the required font family and enter the required size.

Note: Select Bold, Italic, Underline if required.

 Click on save icon.


 Enter the package name.
 Create the TR number by pressing an icon create request if required.
 Click on yes button.
 Click on Header icon enter required default paragraph name.
 Click on activate icon.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on back.

Standard SAP Script forms:

All the standard SAP Script forms are available in the client no. 000.

Following are some of the useful standard script forms and print programs.

Form name Print program Form Routine Application

MEDRUCK SAP M & SP Entry_new Purchase order only


RVOROADDRS RVADOR01 ENTRY Sales order
RVDELNOTE RVADDN01 ENTRY Shipping
RVADIN01 RVINVOICE01 ENTRY Billing

Note: The standard table TNAPR (or) NACE T-Code can be used to find from details (or)
output type details.

Copy Standard SAP Script forms:

The standard script forms are generally copied and made the changes to add an additional
functionality.

Steps to copy SAP Script forms:

 Execute the T-code SE71.


 Click on utilities menu item.
 Click on copy from client.
 Enter the required standard Script form name ‘MEDRUCK’ .
 Enter target form name (ZB20_MEDRUCK).
 Click on execute icon.
 Enter the package name.
 Click on save icon.
 Create the TR ,by pressing an icon create request.
 Click on yes button.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on Back.

NOTE:-- Copied standard script form design must be changed by logging in original language
only i.e. DE-German Language.

Steps to change the copied standard Script form:

 Execute the T-code SE71.


 Enter the copied standard script form name (ZB20_MEDRUCK).
 Enter the original language DE.
 Click on change button.
 Make the necessary changes in form painter and page windows such as graphic window
creation, add additional fields using form routines.
 Click on form menu item.
 Click on activate.
 Activate the copied form after the necessary additional changes.

NOTE:-- The copied custom Script form should be assign to an output type using the T-Code
“NACE”.

Some of the useful T-Code in Script form:

T-code Description
SE71 To maintain form painter.
SE72 To maintain SAP Script form style.
SE73 To maintain different types of forms and bar
codes.
SE78 To maintain graphics or Logo’s.
SO10 To maintain standard texts.
SE63 Translations to translate text in different
languages.
NACE To maintain output types.
Some of the useful Standard reports:

The reports which are related to SAP Script forms start with RSTX.

Report name Description


RSTXLDMC To upload graphics or logos.
RSTXSCRP To download or upload SAP Script forms,
styles, standard text.
RSTXTRAN To create Transport Request for standard text.
BY MR. BABU (OASIS TECHNOLOGIES)
RSTXDBUG Activate or Deactivate form Debugger.
RSTXFCPY Copy forms between clients.
Note: T-Code SCC1 can also be used.
RSTXPDFT Convert spool job to PDF format.

Smart Forms

 The smart forms are advanced to sap script forms.


 They are client independent since one unique function module is generated for each
smart form while activating it.
 The standard function module ‘SSF_FUNCTION_MODULE_NAME’ is used in the print
program to provide a link between print program and smart form.
 The smart forms can be executed without print program also.

Smart forms are executed as below:-

 Following are some of useful transaction codes in smart forms.

Transaction code Description

SMARTFORMS To maintain smart forms

SMART STYLES To maintain styles for smart forms

SMART FORM-TRACE Smart form trace

Main components in smart forms:-

 Following are the main components in smart forms


a) Global settings.
b) Pages and windows.

Global settings:-

 It is used to maintain the global settings, definitions which can be applied across the
smart forms.
 Following are the different global settings.
BY MR. BABU (OASIS TECHNOLOGIES)
a) Form attributes.
b) Form interface.
c) Global definitions.

Form Attributes:-

 It is used to maintain the general smart form attributes and output such are, page
format, style name etc……

Note: - The default style for smart forms is ‘SYSTEM’.

Form Interface:-

It is the system generated function module with all the parameters except changing
parameters.

Global definitions:-

It is used to maintain the global definitions which can be used across the different
Global definitions.

i. Global data:-

It is used to maintain the global data definitions such are internal tables, work areas,
variables etc…………..

ii. Types:-

It is used to define the types which can be referred to declare internal tables and work
areas.

iii. Field symbols:-It is used to define field symbols.

iv. Initialization:-
 It is processed before the smart form pages and window are processed.
 It is used to extract all the required data from the database table or views and process
the extracted data.

Note:- Import and export parameters must be specified before they are used

Ex:-

INPUT PARAMETERS OUTPUT PARAMENTERS

<LS_DBTAB> <GT_DBTAB>
BY MR. BABU (OASIS TECHNOLOGIES)
| |
| |

CLEAR: <LS_dbtab>

*Extract data

SELECT <f1>

SELECT<f2>

I NTO TABLE <GT_DBTAB>

FROM <dbtab>

WHERE <__>

*Process data

END FORM

v. Form Routines:-
 It is used to define the subroutines which can be called across the smart form.
 It is used to define the currency or quantity fields as like the DDic tables or
structures.
vi. Currency or quantity fields:-

It is used to define the currency or quantity fields as like the DDIC tables or structures.

Pages and windows:-

 It is used to maintain the different page formats and windows


 Following are the different nodes in smart forms
a) Windows:
 They are positioned on the pages
 Following are the different types of windows

Window type Description


Main window To display or print the continuous text.

Note:- the smart forms can be created


without main window also.
BY MR. BABU (OASIS TECHNOLOGIES)
Secondary window To print or display the different contents
on each page (similar to variable
window).

Copies window To display or print the original and copy


or duplicate.

Final window The final window cannot be copied and


flown in to the subsequent pages.

b) Graphics:
It is used to create a graphic node (window) to display or print the graphics or logos.

c) Address:

It is used to define the address node or window to display or print the organization
address or personal address or workplace address.

Note:- The address can be determined dynamically also using an option determine

Dynamically.

d) Text: It is used to display or print the contents of the different symbols or fields.

e) Table:
 It is used to display print the dynamic data of an internal table
 It can also be used as a template to display or print style static record by unchecking the
checkbox internal table.

Dynamic data-Table
 Internal table <gt_tab> INTO <gs_tab>

F1 F2 F3
1 A B

2 C D

| | |
| | |

Static data-template
BY MR. BABU (OASIS TECHNOLOGIES)
( ) Internal table <> INTO < >
F1 F2 F3
1000 P Q

f) Template:-
 It is used to display or print the static data(single record)
 This node does not have the separate header, main area and footer whereas, the
table node contains the different sessions, and such are header, main area and
footer.

Note:-The template node can be used under loop node to display or print the dynamic data

(Multiple entries) as like the table node.

Template as table:-

Ex: Loop_node………..

• √ Internal table < gt_tab > into < gs_tab >

Template

Internal table < > into < >


g) Flow logic:-
 The flow logic nodes are used to control the nodes and define the program lines in
smart forms.
 Following are the different flow logic nodes.
(i) Loop
(ii) Program lines
(iii) Alternative
(iv) Command

Loop_node:-

It is used to process the corresponding nodes based on the number of entries of an


internal table.

Loop_node
BY MR. BABU (OASIS TECHNOLOGIES)
Internal table < gt_tab > into < gs_tab >

Template

Text node

Window

Program lines nodes:-

 It is used to write ABAP source code


 Input and output parameters must be filled with the data variables before they are used
Ex:-
INPUT PARAMETERS OUTPUT PARAMETERS
GV_DOC_NO GS_DBTAB

CLEAR : < gv_doc_no >,


< gs_dbtab > .
|
|

*Implement Business Logic or source code

SELECT
|
|

Alternative Node:-

It is used to control the corresponding nodes based on the specified condition.

Condition <GV_VAR> = ‘VALUE’


TRUE
Template node
Text node
FALSE
Table node
Text node

Command Node:-
BY MR. BABU (OASIS TECHNOLOGIES)
This node is used to go to a new page based on the specified conditions

Common tabs on most of the nodes:-

Most of the nodes have the following common tabs


1. Output options.
2. Conditions.

i. Output options:-

It is used to maintain the required output options such are smart form style, frames, colors
etc.

Note:-The checkbox ‘page protection’ is used to avoid page breaks in smart forms.

ii. Conditions:- They are used to control corresponding nodes.

Additional events in smart forms:-

Following are the different additional events which can be maintained under condition

a) Only on first page:

To print or display the corresponding contents on the first page only.

b) Not on first page:

The corresponding contents are not displayed or printed on the first page.

c) Only after end of main windows:

To print or display corresponding contents after the main windows is processed

d) Only before end of main window:-


To print or display the corresponding contents of the node or text node before the main
window is ended.
e) Only on page:-

It is used to print or display the corresponding contents of the text nodes on the
specified page.

Steps to create smart form:-

**********************Refer Notes***************
BY MR. BABU (OASIS TECHNOLOGIES)

Steps to find the system generated fn module for smart forms:

 Execute the t code ‘SMART FORMS’


 Enter the required smart form
 Click on display button

Note:- An icon can also be used to see and execute the system generated function module.

 Click on environnement menu item.


 Click on function module name.

Note:-

• The system generated fn module which start with “/1BCDWC/SFXXXX” is displayed as


information message.
• The system generated fn module could be different from system to system
• forms dynamically by passing the parameter ‘fm_name’ to the standard Function
module ’SSF_FUNCTION_MODULE_NAME’

Ex:-

CALL FUNCTION ‘SSF_FUNCTION_MODULE_NAME’

EXPORTING

Formname = <zsmart_form>

IMPORTING

Fm_name = <lv_fnam> “system generated function module

*CALL FUNCTION ‘/1BCDWB/SFXXXX’ “Not Advisable since it may be


changed in Quality and Production Systems
CALL FUNCTION <lv_fnam> “ Advisable
|
|
BY MR. BABU (OASIS TECHNOLOGIES)
Steps to execute smart forms independently:

 Execute T-code ‘SMARTFORMS’


 Enter the required smart forms
 Click on test icon
 Click on execute icon to execute the system generated FM module
 Pass the required import parameters
 Click on execute
 Enter output device name LPO1
 Click on print preview button
 Click on back

Different ways to debug smart forms:

There are mainly two ways to debug smart forms

1) Using the system generated Function module


2) Using static break points in smart forms.

steps to debug a smart form using the system generated function module:-

 Execute the truncation code ‘SMART FORMS’


 Click on test icon
 Click on display button

Note: The system generated FM module is displayed

 Click on test icon.


 Enter the required find string.
 Select a radio button in main program.
 Click on yes button
 Double click on the required. Found location.
 Click on stop icon(session break point)
 Execute the smart form either to print program or output type.
 Use the fn key ‘F6’ or ‘F5’ or’F7’ or ‘F8’ to check the smart form.

Note:- The system generated internal table %TEXT contains following fields which are filled
with the text node contents at run time.

 Enter %TEXT.
 Press enter button.
BY MR. BABU (OASIS TECHNOLOGIES)
 Double click on an internal table %TEXT to check the corresponding contents of the text
node under TDLINE column.

Fields in the system generated internal table %TEXT:-

The system generated internal table %TEXT contains following fields which are filled with the
text node contents at runtime.

Field name Description

TDFORMAT Tag column of the text elements.

TDLINE Contents of the text element (or) text node


Steps to debug a smart form using static break point:
 Once the smart form is in change mode
 Double click on the required program lines or initialization under global definitions
 Write BREAK followed by an user name

Ex: BREAK <OASIS>. “Your user Name

 Activate the smart form.


 Execute the smart form either through.

Note:

Note: The smart form is stopped at the static break point,


• Use the function keys ‘F5’ or ‘F6’ or ‘F7’ or ‘F8’ to check the smart form.
• Enter the system generated internal table ‘%TEXT’ to check text elements or text node
elements

Steps to download the smart form:

 Execute the transaction code ‘SMART FORMS’


 Enter the smart form name to downloaded
 Click on utilities menu item
 Click on download form
 Click on yes button
 Select the required directory
 Change the file name if required
 Click on save button
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE:

• The smart forms are downloaded in xml forms


• The SAP script forms are downloaded in text format

Steps to upload the smart form:

 Execute the transaction code smart forms.


 Click on utilities menu item.
 Click on upload form.
 Enter new form name to be created by uploading the existing downloaded smart form.
 Click on yes button.
 Select the required downloaded smart form file (xml format).
 Click on open button.
 Enter package name.
 Click on save icon.
 Create the ‘transport request’ number by pressing create request icon.
 Click on yes button.
 Click on change button.
 Make the necessary changes if required.
 Click on activate icon.
 Click on back icon (F3).

Steps to migrate SAP script form into smart form:-

 Execute the transaction code ‘SMARTFORMS’.


 Enter the smart form name to be created by migrating the existing Script Form.
 Click on utilities menu icon.
 Click on migration.
 Click on import Sap Script form.
 Enter the existing script form name.
 Click on yes button.
 Make the necessary changes in the migrated form then activate the form then activate
the form.
 Click on back.

System provided smart forms:

 The system provided example smart forms start with ‘SF*’


 They can be copied and made the necessary changes.
Note: System provided example smart forms start with SF_EXAMPLE*
BY MR. BABU (OASIS TECHNOLOGIES)
Ex: SF _ EXAMPLE _0L

SF_EXAMPLE _ 01

SF_ EXAMPLE _ 02

SF _EXAMPLE _03 |

Steps to copy the smart forms:

 Execute the T-code “SMARTFORMS”.


 Enter the Smart Form name to be copied.
 Click on copy icon.
 Enter the target form name.
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create the TR number by pressing create request icon .
 Click on yes button.
 Make the necessary changes by pressing change button.

Steps to maintain smart styles:

 Execute T-code ‘SMARTSTYLES’.

Note: They can be maintained by selecting a radio button style in the transaction code

‘SMARTFORMS’

 Enter smart style name.


 Click on create button.
 Change system proposed description.
 Double click on paragraph formats folder .
 Click on create node icon.
 Enter the paragraph format name (p1).
 Press enter button.
 Enter short description.
 Maintain indent and spacing settings if required such are left margin, space before,
space after etc..
 Click on Font tab.
 Select the required font family.
 Enter the required font size.
BY MR. BABU (OASIS TECHNOLOGIES)
 Select the required font style such are bold or italic if required.
 Select an appropriate color if required.
 Click on ‘TABs’ tab.
 Enter the required tab position.

No Position Unit Alignment


1 3 CH Left-Alignment
| | | |
|| | | |

Note:-

 Print preview of the paragraph and character formats can be seen in smart styles but
not possible in script form styles.
 Follow the similar steps to create any number of paragraph formats by pressing create
node icon.

Creation of character formats:

 Double click on the character format.


 Click on create node icon.
 Enter the character format name(c1).
 Press enter button.
 Enter short description.

Note:- The font effects superscript and subscript are possible in smart styles and can be
maintained with character formats in SAP script forms.

Ex:

21st April->super script

21st April->sub script

 Click on font tab.


 Select the required font family.
 Enter an appropriate font size.
 Select the font style if required.
 Select an appropriate color if required.
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE:

• The bar codes can be selected under ‘standard settings’ tab.


• Follow the similar steps to create any number of character formats by pressing create
node icon.
 Double click on header data folder.
 Select the created standard paragraph name.
 Click on save icon.
 Enter the package name.
 Click on save icon.
 Create the TRANSPORT REQUEST by pressing create request icon .
 Click on yes button.
 Click on activate icon.
 Click on back.

Steps to specify the smart style in the smart forms:

 Once the smart form is in change mode.


 Double click on the required node such are windows, tables, templates, text nodes etc.
 Click on output options tab.

Note: Enter the smart style name under output option of the form attributes to apply the
styles for entire smart form.

 Activate the smart form name.

Text module:

They are used to maintain the long texts.

Steps to create a text module:-

 Execute the transaction code ‘SMARTFORMS’.


 Select the radio button text module.
 Enter the text module name.
 Click on create button.
 Enter or maintain the required long text.
 Click on save icon.
 Enter the package name.
 Click on save icon.
 Click on create request icon.
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter short description as per the project standards
 Click on save icon.
 Click on yes button.
 Click on back icon.

Steps to use the text module:

 Once the smart form is in change mode.


 Double click on the created text node.
 Select text module under text type field .
 Click on yes button.
 Enter the required text module name.
 Activate the smart form.

SFSY structure:

It is the system provided standard structures which contain a smart form system fields.

Following are some of the useful fields:

Field Description
PAGE Current page number

FORM PAGE Total number of pages

JOBPAGES Total number of pages of print job

COPYCOUNT Copy counter (

DATE

TIME

SUBRC

USERNAME

PAGENAME

WINDOWNAME
BY MR. BABU (OASIS TECHNOLOGIES)
Forms execution process in the real time:

The forms are mostly executed through the output types as below.

*******************Refer Notes for Diagram*****************

NACE Transaction code:

 It is used to maintain the output types of an application.


 It can also be used to find print program, form routine details for the given output type.

NOTE: In the real time the output types are maintained by the functional or basis consultants

Steps to change the output type details:

 Execute the T-code ‘NACE’


 Select an appropriate required application

Ex: EF- Purchase

V1-Sales

 Click on output button.


 Click on position button.
 Enter the required output type (NEU).
 Press enter button.
 Select the font output type (NEU).
 Double click on processing routines folder.
 Click on display or change icon.
 Change processing routine details.
 Such are print program, form routine, form name etc.

NOTE: Follow the above similar steps to find the form and print program details of the given
Output types.

Processing routines:

Medium Program Form routine FORM

Print output ZB20_PRINT_PP_NACE ENTRY ZB20SMART_FORM


FAX SAPFM0GP ENTRY_NEU MEDRUCK
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on save icon.
 Click on create request icon.
 Enter short description as per the projects standards.
 Click on save icon.

NOTE: The system proposes the customizing request since the maintenance view VN_T685B is
maintained.

 Click on Yes button.

NOTE: The button new entry is used to create new output types.

 Click on Back.

NOTE: Standard table “TNAPR” contains all the output type and form details in the system.

Steps to create an output type:

 Execute the T-Code “NACE”.


 Select the required application.
 Click on output types button.
 Click on Display/change icon.
 Click on new entries button.
 Filled the required details such are output type, description, print program, form routine
name etc.

Ex: Output type ZNEU


Program ZB20_PRINT_PP_NACE

Form routine ENTRY_NEU

 Press enter button.


 Double click on processing routines folder.
 Click on new entries button.
 Select the required data transmission medium such as print fax, etc.
 Enter the required print program name, form routine name and form name.

Ex: Program ZB20_PRINT_PP_NACE

ENTRY_NEU
BY MR. BABU (OASIS TECHNOLOGIES)
Form routine

FORM ZB20_SCRIPT_OR_SMF

 Click on save icon.


 Create the customizing TR by pressing an icon “Create request”.
 Click on yes button.
 Demo program on sending a form as a PDF attachment through an email
ZB20_PRINT_FORM_PDF.
 SMART FORM name : ZB20_SMART_FORM.

Steps to send a FORM or REPORT as PDF/XLS/.TXT attachment through an E-Mail:

 Pass flag ‘X’ to field ‘GETOTF’ of export parameter control_parameters


 Get the form data in OTF format using the system generated function module of the
SMARTFORM.

Note: Use the standard function module CLOSE_FORM to get SAP Script form data in OTF
format.

Ex: *Smart form

*Pass flag to get smart form data in OTF then get it in OTF format
<gs_parameters>-getotf = ‘X’.

CALL FUNCTION<gv_fnam> “system generated.

EXPORTING

….

Control_parameters = <gs_parameters>

IMPORTING

Job_output_into = <gs_otf_data>

*or

*In case of Script Form

.
BY MR. BABU (OASIS TECHNOLOGIES)
*CLOSE_FORM

* TABLES

* OTF data = <gs_otf_data>

 Convert the OTF data of the forms into a PDF format using the function module
CONVERT_OTF.
 Populate the mail subject, mail body, receives list etc.
 Use the standard function module.
SO_NEW_DOCUMENT_ATT_SEND_API1 to send an email with an attachment such as
PDF or excel etc.

Note: The T-Code “SOST” is used to check the sent email.

Steps to check the sent mails and push them:

 Execute T-Code “SOST”.


 Change the sent date if required.
 Click on execute button.
 Select the required sent request or mail.
 Click on display document icon to check the sent mail and the corresponding
attachments.
 Click on an icon start send process for selection to push an email.
 Click on yes button.
 Click on Back.

Translations:

The T-Code “SE63” is used to translate the text symbols and text elements in different
languages.

Steps to translate text element of the forms:

 Execute the T-Code SE63.


 Click on translation menu item.
 Click on ABAP objects.
 Click on other long text.

Note: The menu item short text is used for repository text, ABAP text such are text element
messages text translation.
BY MR. BABU (OASIS TECHNOLOGIES)
 Expand and hierarchy forms and style (FS).
 Double click on SAP SMART FORMS (SSF) item.

Note: The sub item (forms) is used for SAP Script forms.

 Select the required object name (SMART FORM NAME: ZB20_SMART_FORM).


 Select the required source language (ENGLISH ).
 Select an appropriate required target languages (DE-GERMAN).
 Click on edit button.

Note: Use any one of the translator to translate the required text of the source language into
a target language.

Ex: English (EN)  German (DE)

 Copy and paste the translated text under the corresponding text element of the target
text section.

Ex: Source

/E &%TEXT

/* Date: &SFSY-DATE&

Target

/E &%TEXT1&

/* Datum& SFSY-DATE  Form Translator.

 Click on save icon.


 Click on Activate button.

Note: 1. the system does not propose the transport request number for translations, hence

The TR has to be generated manually.

2. The object names in the translator are case sensitive (Only in upper case).

3. The T-Code SLXT is used to generate the TR for translations.

Steps to generate Transport Request for translations:

 Execute the T-Code SLXT.


BY MR. BABU (OASIS TECHNOLOGIES)
 Select the required target language (DE).
 Enter the required text element or text symbol name (&%TEXT1) in description.
 Select a radio button workbench request.
 Click on execute.

Note: The system generated TR is displayed against the line Transport request used:

DEVK900058.

Differences:

SCRIPT SMART FORM


It is client Dependent. It is client Independent.
It is not possible without main It can be created without main window also.
window.
Color fonts cannot be displayed. Color font van be maintained.
Background images are not Background images are possible.
possible.
Multiple page formats are not Multiple page formats are possible with SMART Forms.
possible in Scripts.
It cannot be executed without It can be executed without print program by executing
print program. the system generated function module.
Address window is not possible. Address window can be created in SMART FORM.
Note: The command
ADDRESS….ENDADDRESS can be
used.
Data extraction logic or ABAP The entire data extraction logic or ABAP source code
source code cannot be written in can be written under initialization, program line in
Script forms. Smart form.
The tables and template cannot be The tables and templates can be drawn to display or
drawn but the command box is print static or dynamic data.
used to draw the boxes.
Note: Statement function module
RKD_WORD_WRAP is used to
wrap the text into multiple lines.
Copies window are not possible. Copies windows can be created.
BY MR. BABU (OASIS TECHNOLOGIES)
Enhancements

 This concept is used to add additional customer specific functionalities to the


standard applications or programs or transaction codes.

Following are the different enhancements techniques or methods.

1. Customer Exits.
2. Business Transaction Events (BTE).
3. Enhancement frame work.
4. User Exits.
5. Business ADdIns (BADI).
6. Functional Routines

1).Customer Exits:

 Customer Exits are available in most of the functional areas such are SD- Sales
and Distribution, Material Management (MM), Finance and Controlling (FI/CO)….
Etc.
 They are used to add the additional functionalities in the standard applications or
programs, without using access key to break them.

Access key:

It is the unique key provided by the basis consultant or SAP People to break the
standard applications or programs.
 The application or program will become custom development once they
are broken.

Following are the different types of Customer Exits.

a) Field Exits.
b) Function Exits.
c) Menu Exits.
d) Screen Exits.

a).Field Exits:

They are used to change the field labels of the standard data elements.

b).Function Exits:

They are used to add an additional functionality to the standard applications or program
without breaking them.
BY MR. BABU (OASIS TECHNOLOGIES)
 Each Function Exit contain a custom include program which starts with Z* to
implement the customer specific additional business logic.
 The Function Exit is the three digit number which is called using the ABAP
statement
CALL CUSTOMER_FUNCTION.

Ex:

*Function Exit

CALL CUSTOMER_FUNCTION ‘<XXX>’

IMPORTING

im_param =

..

TABLES

FUNCTION <funct_exit_name>.

Z<INCLUDE_NAME>

* Define include with Additional Custom Business Logic

SELECT….

ENDFUNCTION.

Note: In the real time we mostly work with function exits.

c).Menu Exits: They are used to add the custom specific menu items and
corresponding additional functionality based on the selected menu item.

d).Screen Exits: They are used to add the additional screen elements and the
corresponding additional functionality to the standard screens, or application or
transaction codes.

 The T-Code SMOD and CMOD is used to work with the Customer Exits.

T-Code SMOD: It is used to find the Customer Exits of the standard package.

T-Code CMOD: It is used to assign the enhancements or exit to a project to record


the changes, activate and de-activate the enhancements.

Note: It is not possible to assign an enhancement or exit to more than one project.
BY MR. BABU (OASIS TECHNOLOGIES)

Different ways to find Exits:  Following are different ways to find Exits.

1) Using the Package name of the applications.


2) Using the T-Code “SE84”.
3) Using the find function in standard programs.
4) Using the standard tables MODSAP and MODACT.

1). Steps to find Exits using Package:

a)Finding Packages:

 Execute the required T-Code or application.

Ex: VA02/VL02.

 Click on system menu item.


 Click on status and double click on the program name (screen).
 Click on ‘Go to’ menu item.
 Click on attributes.

Note:  The corresponding Package name is displayed in the package field.

b) Finding Exits using T-Code SMOD:

 Execute the required T-Code SMOD.


 Click on utilities menu item.
 Click on find.
 Enter the above found package.

Ex: VA/MGA…

 Click on execute.

Note:  All the corresponding of the Package are listed.

 Find an accurate exit by understanding the system given short description or by


using an trial and error method by activating the exits and perform the required
action.

2). Steps to find Exits using the T-Code SE-84:

 Find the package name of the required T-Code.


 Execute the T-Code SE84.
BY MR. BABU (OASIS TECHNOLOGIES)
 Expand enhancement folder.
 Double click on enhancements.

Note:  An item project is used to find the enhancements of the projects.

 Enter the required package name or Exit name.


 Click on execute icon.

Note:  1).All the corresponding Exits are listed.

2) Find the correct exit by analyzing the system given short text or by using

Trial and Error method.

3). Steps to find Exits using the find function:

 Execute the required T-Code (Ex: MM01/VA01….).


 Click on system menu item.
 Click on status.
 Double click on the screen program name.
 Click on find icon.
 Enter the find string as CALL CUSTOMER_FUNCTION.
 Press enter button.

Note:  All the Exits which are called using the statement

CALL CUSTOMER_FUNCTION are listed.

 Double click on the required found location.


 Set a session break points.

Note:  Set the session break points for all the found locations up to 30 only at a time.

 Perform the required action in the T-Code to stop the correct Exits.

4). Using the standard table MODSAP and MODACT:

 The standard table MODSAP or MODACT can also be used to list out the
enhancement projects.

Scenario on Field Exit: Change the field table of the standard data element
DWERK_EXT – Deliver plant in the T-Codes VA01, VA02, VA03.

Steps to change the Field label in the standard application:


BY MR. BABU (OASIS TECHNOLOGIES)
 Execute the required T-Code Ex: VA02/…
 Enter the document or order number.
 Press enter button.
 Place a cursor on required field.
 Press F1 function key.
 Click on technical information icon.
 Copy the data element name.
 Execute the T-Code CMOD.
 Click on GOTO menu item.
 Click on text enhancements.
 Click on key words.
 Click on change.

Note:  An option “Data elements” is used to change the documentation of the


standard data Elements.

 Paste or enter the required data element name DWERK_EXT.


 Click on yes button.
 Change the field labels.
 Click on save icon.
Ex:- Deliver plant  Del.plant.
 Create the transport request number by pressing create request icon.
 Click on yes button.
 Cancel the change key words window.

Note:  Check the change field label by executing required T-code.

Scenario on Function Exit:

Hiding the attributes of an executable program in the T-Code “SE38” -Attributes.

Steps to find exact Exits:

1. Find an appropriate package name of the required T-Code or an application.

Ex: Package for attributes is SE38 is SEDT.

2. Finding Exit:
 Execute the T-Code SMOD.
 Click on utilities menu item.
 Enter the required found package name.
Ex: SEDT/MGA/VA…..
 Click on execute icon.
 Click on find icon.
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter the required find string.
Ex: Attributes/check/save/function.
 Press enter button.
 Copy the font Exit names by pressing (Ctrl + Y).
 Cancel the find windows.
 Click on back.

3. Project Creation - CMOD:


 Execute the T-Code CMOD.
 Enter the project name (ZB20_PRJ).
 Click on create button.
 Enter short text.
 Click on enhancement assign button.
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create the TR-Transport request number by pressing an icon create
request.
 Click on yes button.
 Paste or enter the found Exit name.

Note:  The exit cannot be assigned more than one project.

 Press enter button.


(Ex: SEU00001 – Fonction Exit in program attributs)
 Click on components button.
 Click on yes button.
 Click on activate icon.

Note:  1.Color of the traffic light will become green, once the project is activated.

Red – Inactive.

Green – Active.

2. The tick marks are appeared under Impl. Column once the Exits are implemented.

 Double click on function Exit names.


 Double click on the system provided Z* include name.
 Press enter button for the first time.
 Click on yes button.
 Enter the package name.
 Click on save icon.
BY MR. BABU (OASIS TECHNOLOGIES)
 Create the TR if required.
 Click on yes button.
 Write any statement to get the Exit stop in the debugger.
Ex: BREAK <OASIS>.
 Activate include program.
 Click on back icon.
 Click on back icon to come out of the function module Exit.

Note:  Follow the similar steps to implement any number of Exits by double
clicking on them.

4. Finding Exact Exit:


 Execute the required T-Code.
Ex: SE38/MM02/….
 Perform the required action.
Ex: AttributesDisplay/Save/Delete.

Note:  An accurate/Exact exit is stopped in debugger.

5. Implementing the required Business logic in the found Exit:


 Execute the required T-Code - CMOD.
 Enter the required project name (ZB20_PRJ).
 Click on display button.
 Click on components button.
 Double click on the required Exit name.
 Double click on the include program name.
 Click on display or change icon.
 Implement the required business logic as per the specification.
 Activate the include program.
Ex: *Additional business logic.
<If program EQ ‘ZB21_ALV_GRID_LIST’.
MESSAGE ‘Attributes are hidden’ type ‘I’.
LEAVE SCREEN.
ENDIF.>

6. Test the Scenario:

 Execute the required T-Code SE38/MM02/ME22N…


 Enter the required data.
Ex: Program name/Doc.No./…
(ZB21_ALV_GRID_LIST)
BY MR. BABU (OASIS TECHNOLOGIES)
 Perform the required action.
Ex: Select Attributes  Display/Save/Enter.

Note:  An information message is given as ‘Attributes are hidden’ from the


implemented function Exit.

Scenario on MENU Exits:  Add an additional custom menu item and the
corresponding additional functionality to the standard T-Code MC94 – Change plan.

1. Find Package name: 

 Execute the T-Code MC94.


 Click on system menu item.
 Click on status.
 Double click on screen program name.
 Click on GOTO menu item.
 Click on Attributes.
 Copy the package name (MCP2).

2. Find Exits:

 Execute the T-Code SE84/SMOD.


 Expand enhancements folder.
 Expand customer exit folder.
 Double click on enhancements.
 Enter or paste the required package name (MCP2).
 Click on execute icon.
 Click on find icon.
 Enter an appropriate find string (function).
 Press enter.
 Copy an appropriate found exit name.
Ex: MCP20003

3. Project Creation:

 Execute the T-Code- CMOD.


 Enter the Project name (ZB20_PRO).
 Click on Create button.
 Enter short text.
 Click on enhancements assignments button.
 Click on yes button.
 Enter the package name.
 Click on save icon.
BY MR. BABU (OASIS TECHNOLOGIES)
 Create the TR by pressing create request icon.
 Click on yes button.
 Enter/Paste the required Exit name.
 Press enter button.
 Click on components button.
 Click on yes button.
 Click on activate icon to activate the Exits.

Note:  1.An Icon undo activation is used to de-activate the enhancement project.

2. Click on back icon then use activate icon in case of not appeared in the

Components Screen.

 Double click on any one of the function codes such as +CU1,+CU2….


 Enter function text, icon text, icon text, info text … etc.
 Click on yes button.
 Click on yes button.
 Double click on the corresponding function Exit name to add an additional
functionality when the custom menu is pressed.
 Double click on the custom include program name.

Note:  Press enter button then create an include program name for the first time.

 Implement the required additional interactive functionality (as per the


specification).
Ex: -- *Additional Interactive Business logic.
 IF i_fcode EQ ‘+CU2’.
CAL TRANSACTION ‘SE11’.
END IF.
 Click on pretty printer button.
 Click on Activate icon.
 Press enter and Click on Back.

4. Test the Scenario:

 Execute the required T-Code (Ex: MC94).


 Enter the required data.
o Ex: Planning type: REPL.
 Press enter button.
 Click on activate version button or perform the required action.
 Click on extras menu item.
 Click on customer functions.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on the required additional custom menu item.

Note:- The additional functionality such as call another T-code (SE11) is happened

From the Implemented menu exit and function exits.

Scenario on Screen Exits:  Add the additional screen fields with the transaction
code MP01 (Maintain Approved manufacture parts).

Common steps involved in Screen Exits:

1. Find the corresponding screen exits of an application or T-Code by using the


corresponding package name.
2. Add the additional fields to the corresponding structure which stars with CI* or
standard tables by appending a structure.
Ex: CI_AMPL/…
3. Define the screen or sub screen of the screen Exit with required additional fields
by creating the enhancement projects.
4. Provide the additional functionality to pass data to the database tables, provide
Search help and etc using corresponding in exit or flow logic of the screen in the
screen exit.

Steps to work with Screen Exits:

1. Find Screen Exit using the package :

 Once the package name of the application or T-code is found then execute
SMOD.
 Click on utilities menu item.
 Click on find icon.
 Enter the required found package name (ME).
 Click on execute icon.
 Click on find icon.
 Enter appropriate find string (screen).
 Press enter button.
 Click on required found string.
 Read the system given short text.
 Copy the found exit name.

2. Add additional fields by appending structure or by CI* structure:

 Once the required standard table or table is in display mode.


Ex: AMP1/MARA/….
 Double click on a structure which starts with CI*.
BY MR. BABU (OASIS TECHNOLOGIES)
Note: -- Use append structure button in case of the CI* structure does not exit.
 Click on yes button.
 Enter short description.
 Define the required fields such as MATKL (Material Group) … etc.
 Activate the CI* structure.
 Click on back.

3. Enhancement project creation:

 Execute T-Code CMOD.


 Enter the project name.
 Click on create button.
 Enter short text.
 Click on enhancement assignment button.
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create the TR by pressing create request icon.
 Click on yes button.
 Enter or paste the required enhancement name (AMPL0001) - (user sub screen
for additional data on AMPL).
 Click on components button.
 Click on activate icon to activate enhancement project.

Note: -- Activate and Deactivate project in an initial screen of CMOD if they are not
appeared.

 Double click on the system provided sub screen number of screen exit.
 Press enter button.
 Enter short description.
 Click on layout button.
 Click on dictionary or program fields windows (F6).
 Enter the required table or structure name.
Ex: AMPL
 Select the required additional field.
Ex: MATKL
 Press enter button.
 Place if on the screen by pressing left mouse button.
 Click on activate icon.
 Enter the package name.
 Click on save icon.
 Click on yes button.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on the button maintain original language.
 Click on back.
 Click on flow logic and add the additional functionality.
Note: -- Use the system provided for exits.
 Make sure the screen type ‘Sub screen’ is selected under attributes tab while
defining the sub screen.

4. Test the Scenario:

 Execute the required T-Code MP01.


 Enter the document number (material number).
 Press enter button.
 Double click on any one of material number.
Note: -- The additional custom fields are appeared o standard screen.

BTE—Business Transaction Events:

The Business Transaction Events are also called Source code plug-ins to add an
additional functionality in the standard program or T-Code.

 Each BTE is linked with the system provided interface to which the custom
function module can be assign.
 The BTE are called using the function
OPEN_FI_PERFORM* and OUTBOUND_CALL*.

Ex:--
 Standard program.
.
CALL FUNCTION ‘OPEN_FI_PERFORM
(or) OUTBOUND_CALL’…
BTE-0001490

ZCUSTOM_FUNCTION
 The T-Code BERE and FIBF are used to work with BTE’s.
BY MR. BABU (OASIS TECHNOLOGIES)
T-Code BERE: It is used to find the BTE’s.

T-Code FIBF: It is used to work with the BTE’s.

Scenario on BTE: It gives an information message while saving the vendor data (or)
sends a purchase order as a PDF attachment to an Email of the vendor.

T-code—XK02/XK01

Tables – LFA1/LFB1

Find BTE:

 Execute the T-code BERE.


 Click on execute icon.
 Click on find icon.
 Enter a appropriate find string.
Ex: Vendor/Customer/Material.
 Press enter button.
 Close the find window.
 Double click on the required found ‘BTE’.
Ex: 00001420 – VENDOR
 Click on sample module button.
 Click on copy icon.
 Change two function module names and enter the function group name.

Ex: FROM FM: SAMPLE_INTERFACE_00001420

TO FM: ZB20_CUST_INTERFACE_00001400

Function group: ZB20_FUN_GRP.

 Click on yes button.


 Press enter button.
 Enter the copied interface name/FM name.
 Click on change icon button.
 Implement the required additional business logic as per the specification.
Ex: *Implement additional customer specific business logic.

*Give message.

MESSAGE ‘Vendor saved successfully’ TYPE ‘I’.

*Implement Print program.

*Submit ZB20_PRINT _PROGRAM VIA SELECTION-SCREEN.


BY MR. BABU (OASIS TECHNOLOGIES)
 Click on Pretty Printer button.

Note: -- Make use of the parameters of an interface or function module to provide an


additional logic.

 Click on activate icon.

Note: -- The menu path EnvironmentInfo system (process)

In the T-Code FIBF can also be used to find BTE’s.

Steps to assign the custom interface or function Module to BTE:

1. Create Product:

 Execute T-Code FIBF.


 Click on setting menu item.
 Click on products.
 Click on ‘of a customer’.
 Click on new entries button.
 Provide the product details.

Product Text RFC Destination A


ZB20_PRD Product for BTE in 
Vendor Master
 Click on save icon.
 Create a customizing request to save the table entries of TBE24.
 By pressing create request icon.
 Click on yes button.
 Click on back icon.

2. Assign a custom interface or function module to BTE:

 Click on settings menu item in an initial screen of FIBF.


 Click on PS modules.
 Click on ‘of a customer’.
 Click on new entries button.
 Provide the required details.

Event Product CTR Appl Function module


00001420 ZB20_PRD ZB20_CUST_INTERFACE_00001420

 Click on save icon.


BY MR. BABU (OASIS TECHNOLOGIES)
 Create the customizing request to save the table contents of a table ‘TBE34’
by pressing create request icon.
 Click on yes button.
 Click on back.

3. Test the Scenario:

 Execute the required T-Code.


Ex: XK02
 Enter the document number or vendor/Customer no.
 Check the check box address in case of vendor.
 Press enter button.
 Change any data.
 Click on save icon or perform the required action.

ENHANCEMENT FRAME WORK:

 It is an advanced enhancements concept introduced from the version ECC6.


 It is used to attach or hook the source code plug-ins such as enhancements
section or enhancements points in the standard programs.
 Following are the different types of enhancements frame work.
1. Implicite Enhancement Section (or) point.
2. Explicit Enhancement Section (or) point.

1. Implicit Enchantement Section (or) point:

 They are provided implicitly at the particular locations by SAP.


 They are mostly presented at the beginning and end of the subroutines (FORM
…. ENDFORM), beginning and end of the function modules, beginning and end
of the programs etc.

2. Explicit Enchantement Section (or) point:

 They are pre coded by SAP and provided at the specific location in the standard
programs.
 There are two types of Explicit Enhancement.
1. ENHANCEMENT-SECTION.
2. ENHANCEMENT-POINTS.

1. ENHANCEMENT-SECTION:

 It is used to copy, change the existing standard source code and add additional
business logic to the standard program.
BY MR. BABU (OASIS TECHNOLOGIES)
 The ABAP statement ENHANCEMENT-SECTION is used to specific the
enhancement sections.

2. ENHANCEMENT-POINT:

 It is used add or plug-in the additional customer specific business logic to the
standard program.

Scenario on Implicit Frame work:

Make the physical file path name in the standard migration program.

RMDATIND – Migrates Material Master Data.

Steps to work with an Implicit Frame work:

 Once the standard program is in display mode.

Ex: RMDATIND/etc.

 Click on enhance icon (spiral icon).


 Click on edit menu item.
 Click on enhancement operations.
 Click on show implicit enhancement options.

Note:-- The system inserts the double coated lines (“ ” ” ”) in the certain locations
in the standard program.

 Right click on the system inserted double coated line at the required location
such as beginning of the program or end of the program or end or beginning of
the subroutine… etc.
 Click on enhancement implementation.
 Click on create.
 Click on create enhancement implementation icon (F8).
 Enter the enhancement implementation name.
 Enter short text.
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create TR by pressing create request icon.
 Click on yes button.
 Select the created enhancement name.
 Click on yes button.
 Implement the required customer specific additional business logic within the
system generated statement.
BY MR. BABU (OASIS TECHNOLOGIES)
 Ex: -- “”””””””””””””””””””””””””””””””””””””””””””””””
ENHANCEMENT <n> <ZB20_IMPLICIT_ENHANCEMENT>
*Implement customer specific additional business logic
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = “%%%_PHY”.
SCREEN-REQUIRED = ‘1’.
MODIFY SCREEN.
EXIT.
ENDIF.
ENDLOOP.
ENDENHANCEMENT.
 Click on activate enhancement buttons.
 Press enter button.

Note:-- Test the scenario by executing the required T-Code or program.

Scenario on Explicit Enhancement Frame work:

 Change the default value for an input field “Transactions per commit unit from
500 to 1000” in the standard report (RMDATIND) material master data upload.
 Once the standard program is in display mode.
 Right click on the system provided explicit enhancement section or point.
 After an icon enhance is pressed.
 Click on enhancement implementation.
 Click on create.
 Click on create enhancement implementation (F8).
 Enter enhancement implementation name.(ZB20_EXPLICIT_ENHANCEMENT)
 Enter short description.
 Click on yes button.
 Click on save icon.
 Create the TR by pressing create request icon.
 Click on yes button.
 Select the created enhancement implementation name.
 Click on yes button.
 Implement the required customer specific additional business logic.
Note:-- Change the existing standard source code in case of enhancement
section.
BY MR. BABU (OASIS TECHNOLOGIES)
Sample:

ENHANCEMENT-POINT BMVDEF00_03 SPOTS ES_RMDATIND

“or ENHANCEMENT-SECTION

*$*$....start: BMVDEF00_03….

ENHANCEMENT 30 ZB20_EXPLICIT_ENHANCEMENT

*Implement additional logic

MAX_COMM = 1000.

ENDENHANCEMENT.

 Click on activate enhancement button.


 Press enter button.

Note: -- Test the scenario by executing the required T-Code or program.

USER EXITS

 These are the subroutines in the standard include programs.


 The user exits are mostly used in sales and distribution (SD) and rarely used in other
functional areas.
 The access key is required to break the standard include program of the user exits for the
first time.

Note:The enhancement frame work is advanced to user exits for adding an additional
functionality without breaking the standard programs.

 The user exit names start with “User Exit*”.


Ex:- Most of the user exit in SD starts with
MV-MV45AFZZ, MV45AFZA

Scenario on USER Exits:

Give an information message while saving the sales order.

Steps to list out the USER Exits using T-Code SPRO:

 Execute T-Code SPRO.


 Click on SAP reference IMG button.
 Expand the required functional area (SD-Logistics etc).
BY MR. BABU (OASIS TECHNOLOGIES)
 Expand system modifications.
 Expand the required enhancement type such as User Exits/BADI’s (or) BTE’s …..etc.
Note: The T-Code SPRO can also be used to list out the BADI’s routine …. Etc.
 Expand an appropriate functional sub area user exits. Ex: User exits in sales.
 Click on an icon IMG activated documentation to know more about a user exit.
 Click on execute icon that appears beside the documentation icon.
Note: In the real time the user exit names are given in the specification.

Steps to work with an User exit using frame works:

 Execute the T-Code SE38.


 Enter the required standard include program name Ex: MV45AFZZ.
 Click on display button.
 Click on find icon.
 Enter the required find string (Save/Change/Delete)…
 Press enter button.
 Double click on the required found user exit.
Ex:- USEREXIT_SAVE_DOCUMENT.
 Click on (spiral icon) enhance icon.
 Click on edit menu item.
 Click on enhancement operators.
 Click on show impact enhancement options.
 Right click on the system generated double quoted lines (Implicit enhancement spots).
 Click on enhancement implementation.
 Click on create.
 Click on code button.
 Click on create implementation enhancement.
 Click on yes button.
 Add additional business logic/functionality in between the system generated statements.
(ENHANCEMENT…. ENDENHANCEMENTS) .
FORM USEREXIT_SAVE_DOCUMENT
FORM USEREXIT_SAVE_DOCUMENT Implicit enhancement spot.
<ENHANCEMENT 315 ZB20_SD_FRAMEWORK>.
*Additional customer specific business logic or functionality.
MESSAGE ‘Sales Document Saved Successfully ’TYPEI’
END ENHANCEMENT
END FORM.
 Click on active enhancement button.
 Press enter button.
 Click on back.

Test the scenario:


BY MR. BABU (OASIS TECHNOLOGIES)
 Execute the required functional T-Code.
Ex:- VA02/VA01/VL02/VL01/VF02/VF01…
 Enter the document or order number.
 Press enter button.
 Change any data.
 Perform the required action such as Save/Enter/press any icon./….. etc.

Note:An information message is given from a User exit.

Difference between Customer Exits &User Exits:

Customer Exits User Exits


These are the function modules. These are the subroutines.
The customer exit have different type such as: User exit do not have different types.
function exits, menu item, screen exit &field
exits.
The global data cannot be accessed but the The global data can be accessed.
parameters import and tables can be accessed.
These are available under most of the These are mostly available in sales and
functional areas such as: SD,MM,FI… etc. distribution function area.
Access key is not required to add the additional Access key is required to break the standard
functionality. program.
Note:- The enhancement frame work can be
used without breaking the standard program
from the version ECC6.0.
Data inconsistency is not happened since the Data inconsistency may be happened while
global data can’t be accessed. changing the global data.
The customer Exits are called using The User Exit starts with USEREXIT (sub
‘CALLCUSTOMER_Function’. routines in standard include).

Requirement Routines/VOFM Routines

 Requirement/VOFM routines are used to facilitate OR alter standard system


provided business process
 Transaction code "VOFM" is used to maintain OR define requirement routines.
BY MR. BABU (OASIS TECHNOLOGIES)
Note: In real time requirement/VOFM routines are defined and given by functional
consultants
Note: Access key is required for defining requirement/VOFM routines
Note: Defined requirement/VOFM routines are specified against required output type under
Procedures in transaction code "NACE"

Steps to define requirement routine:-


 Execute transaction code VOFM
 Click on 'Requirements' menu item
Note: Menu item 'Copying Requirements' is used to copy existing requirements and do
modifications.
Note: Menu item data transfer is used to transfer data.
 Click on output control
Note: Existing requirement routines are listed here
Note: most of the custom requirement routines …start with '9*' and '6*' [Ex: 905, 601 etc]
 Enter required routine number, description and application area

Routine number Description Active Application


901 For UK YES V2
Validation
---- ------ ----
---- ---- --- ----
Note: Select existing routine number …then click on source text icon to make changes in
the existing requirement routine
 Click on save icon
 Enter given access key by Basis consultant
 Click on continue button
 Implement required customer specific business logic in between system generated
subroutine definitions.
 Click on activate button

Steps to specify requirement/VOFM routines:-


 Execute Transaction code 'NACE'
 Select required application [Ex: V2 - Shipping OR V3 - Billing]
 Click on procedures button
Note: Button 'output types' is used to maintain output types
 Select required procedure OR output type
Ex: ZV1000 - Custom procedure.
V20001 - Standard procedure.
 Double click on 'control' folder
 Enter/Select defined requirement routine against required condition type.
Ex: Reference Counter Condition type Description Requirement
BY MR. BABU (OASIS TECHNOLOGIES)
30 3 Zpk1 Packing list 901
--- --- --- --- ---
--- --- --- --- ---

 Click on save icon


 Create TR by pressing create request icon
 Click on 'YES' button
Note: The button 'new entries' is used to define new control.
 Click on back icon.

BADI’S

Business ADdIns:

These are the new enhancement techniques to add the additional customer specific business logic
to the standard programs.

 The T-Code’s ‘SE18 & SE19’ are used to work with the BADI’s.

T-Code SE18: This T-Code is used to define the BADI’s.

T-Code SE19: This T-Code is used to implement the BADI’s.

Different types of BADI’s:

Following are the different types and subtypes of the BADI’s.

1. Classic BADI (or) Old BADI.


2. New BADI/kernel BADI.

Subtypes are:

a. Single use BADI.


b. Multiple use BADI.
c. Filter dependent BADI.
1. Classic BADI:
Classic BADI’s are used in most of the function areas like MM,SD,FI/CO……ETC.
The system provided standard method ‘get_instance’ of the standard class
‘CL_EXITHANDLER’ is used to work with the classic BADI’s.
2. New BADI’s (or)Kernal BADI’s:
BY MR. BABU (OASIS TECHNOLOGIES)
The ABAP statement GET BADI & CALL BADI are used to work with the new BADI’s or
kernel BADI’s in the programs.

Get BADI statement:

This is used to generate a new BADI object and sets the BADI reference to the objects in the
BADI reference variables.

Call BADI statement:

This statement is used to call the methods of the new BADI’s.

Syntax :--

CALL BADI <ref_badi>  <meth_name> (or)<static_method>.

EXPORTING

Im_param

IMPORTING

.TABLES]

1. Single use BADI:


 The Single use BADI’s can’t be implemented for the multiple times.
 The single use BADI can only be implemented.

2. Multiple use BADI:


 The multiple use BADI’s can’t be implemented for the multiple times.

3. Filter dependent BADI:


 It is used to control the BADI implementation based on the specified filter value.
 The system generates an import parameters ‘FLT_VAL’ to pass the filter values for
controlling the business logic of the BADI implementation.

Note: 

1. The multiple use option is not possible with the new BADI’s.
2. The filter dependent and multiple use options are possible with the classic BADI’s.
3. The BADI’s implementations are triggered in the specified order in case of the multiple
use BADI with different implementations.
BY MR. BABU (OASIS TECHNOLOGIES)
Object: It is a runtime instance of a class to provide the services.

 The services are known as methods.


 The ABAP statement Create Object is used to create an object.
Syntax:--
CREATE OBJECT <ref_name>.

Class: It is used to describe or define the objects.

Method:

 It is the process block (set of lines).


 All the attributes such ass (wa) ,(If)… etc of the class can be accessed in the methods.
 The methods can be compared with the FM’s.
 The ABAP statement CALL METHOD is used to call the methods.

Syntax:--

CALL METHOD <ref_obj>  <instance_method>….

“Instance method.

CALL METHOD <ref_obj>  <static_method>….

“Static method.

Interface: It is a separate structure which can be used to extend the scope of a class.

Steps to work with (or) Create Classic BADI:

1. Define BADI:

 Execute the T-Code SE18.


 Click on the utilities menu item.
 Click on yes button <”ZB20_CLS_BADI_DEF”> .
 Enter short description.

Note: 

1. The check box multiple use can be unchecked for single use BADI.
2. The check box filter dependent BADI’s can be checked & specified the filter type in case
of filter dependent BADI’s.
3. Click on interface tab.

 Double click on the system proposed interface name.


Ex: ‘ZIF_EX_ZB20_CLS_BADI_DEF’.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on yes.
 Enter the package name.
 Click on save icon.
 Create TR.
 Click on yes.
 Define the required methods.

METHOD LEVEL
GET_DATA Instance method

 Place the cursor on the method name.


 Click on parameters button.
 Define the required parameters.
Parameters Type Typing method Associated type
IN_EBELN Importing Type EBELN
EWA_EKKO Exporting Type ZB20_STRCTR_EKKO

 Click on active.
 Press enter button.
 Click on methods button.

Note: 

Follow the similar steps to assign the parameters for any number of methods.
 Click on back icon.

2. Implement BADI:

 Execute the T-Code SE19.

Note: 

 The menu path Enhancement  Implementation


 T-Code SE18 can also be used.
 Select a radio button classical BADI under create implementation on block.
Note:  The block edit implementation block is used to edit the existing BADI’s
implementations.
 Enter the BADI definition name.
 Click on create implementation button.
 Enter the implementation name (ZB20_CLS_BADI_DFF-1).
 Click on yes.
 Enter short description.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on interface tab.

Note: 

 The system provided interface (or) class name displayed.


 Double click on the method name to be implemented.
 Click on yes.
 Enter package name.
 Click on save.
 Click on signature button to appear parameters of the methods.
 Implement the required customer specific business logic as per the specification.
Ex:
*Implement customer specific business data.
*Get required data from EKKO
IF im_ebeln NE space
SELECT SINGLE EBELN
ERNAM
FROM EKKO
INTO WA_EKKO
WHERE EBELN EQ IM_EBELN.
ENDIF.
 Click on pretty printer button.
 Click on activate icon.
 Select all the object which are related to BADI.
 Click on yes.
 Click on back icon.
 Activate BADI implementation.
 Click on back icon.

Steps to call a method from an interface or class: 

 Once the program is in changed mode.


 Place a cursor where the method to be called.
 Click on pattern button.
 Select a radio button ABAP object patterns.
 Press enter button.
 Enter an instance (or) class (or) interface name.
 Select/Enter the required method.
 Press enter button.
Ex: Instance --- VF-BADI
Class/Interface ---ZIF_EX_B20_CLS_BADI_DEF
Method --- GET_DATA
BY MR. BABU (OASIS TECHNOLOGIES)
Note:  Replace the self reference with the reference object name rf_badi if required.

 Uncomment the required parameter.


 Pass the data variables to the parameters of the methods.
 Click on pretty printer button.

Type Reference to statement: 

This statement is used to refer the data objects such as class, interface, BADI definitions… etc.

Syntax:-- DATA: <ref_obj> TYPE REF TO <class_name/interface_name/BADI_definition >

*create an object

CREATE OBJECT <ref_obj>

Demo program on making use of the custom classic BADI is


(ZB20_USE_CLASSIC_BADI).

Steps to create a new BADI: 

 Execute the T-Code SE18.


 Enter the new BADI name in Enhancement spot field (ZB20_NEW_BADI) .
 Click on create button.
 Click on yes button.
 Enter package name.
 Click on save icon.
 Create the TR.
 Click on yes button.
 Click on create BADI icon.
 Enter the BADI definition name.
 Enter short description.
 Click on yes button.
 Uncheck the multiple use check box.
 Expand the BADI definition name.
 Double click on interface.
 Enter an interface name (ZIF_EX_B20_NEW_BADI_DEF).
 Double click on an interface name.
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create the TR.
 Click on yes button.
 Press enter and define the required methods.
BY MR. BABU (OASIS TECHNOLOGIES)
Method name Level
GET_SALES Instance method
 Place the cursor on the method name.
 Click on parameters button.
 Define the required parameters.

Parameters Type Typing method Associated type


IM_VBELN Importing Type VBELN_VA
ES_SALES Exporting Type ZB20_STRCTR_VBAK

 Click on activate.
 Press enter.
 Click back.
Note:  Follow the similar steps to define the parameters for any number of methods.
 Activate an interface.
 Click on back.
 Click on activate to activate an enhancements spot.
 Click on back.

Steps to implement a new BADI: 

 Execute the T-Code SE19.


 Select a radio button new BADI.
 Enter enhancement spot name under create implementation block.
 Click on create implementation button.
 Enter enhancement implementation name.
 Enter short text.
 Click on yes.
 Enter the package name.
 Click on save icon.
 Create the TR and click yes.
 Enter BADI implementation name (ZB20_NEW_BADI_IMP).
 Click on yes.
 Expand the BADI implementation.
 Double click on implementing class.
 Enter the class name.
 Press enter (ZCL_EX_B20_NEW_BADI_DEF).
 Click on yes.
 Enter package name.
 Click on save.
 Click on yes to save the class under same TR.
BY MR. BABU (OASIS TECHNOLOGIES)
 Double click on the interface method name
(ZIF_EX_B20_NEW_BADI_DEF~GET_SALES).
 Click on yes.
 Press enter.
 Click on display or change icon.
 Implement the required business logic in between the system generated statement
METHOD… ENDMETHOD.
 Custom business logic.
IF IM_VBELN <> space.
SELECT SINGLE VBELN
ERDAT
ERNAM
FROM VBAK
INTO ES_SALES
WHERE VBELN EQ IM_VBELN.
ENDIF.

 Click on pretty printer button.


 Click on activate.
 Select all the related objects.
 Press enter button.
 Click on back.
Demo program on making use of New custom BADI (ZB20_USE_NEW_BADI).

Note:  Replace CALL METHOD statement with CALL BADI statement to call the methods
from a new BADI.

Fall Back Class: 

Program goes to runtime error (or) short down in case of a BADI does not have active
implements.
The fall back classes are used/defined to call the default methods in case of a
BADI doesn’t have any active implementations.

Note:  The exceptions can also be raised to avoid such kind of errors.

Steps to define filter dependent BADI: 

 Execute T-Code SE18.


 Click on utilities menu item.
 Click on create classic BADI.
 Enter the BADI definition name(ZB20_FLT_CLS_BADI)
 Click on yes.
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter short text.
 Check the check box ‘Filter dependent’.
 Select or enter the required filter type (BUKRS-Company code).
 Click on interface tab.
 Double click on the system proposed interface name.
 Click on yes.
 Enter the package name.
 Click on save icon.
 Create the TR.
 Click on yes.
 Enter or define the required methods.

Note:  Define the parameters by placing a cursor on the method name if required.

 Click on activate icon.


 Press enter.
 Click on save icon.
 Click on back.

Note:  The system generates an import parameter FLT_VAR to pass the filter values for
controlling the business logic of the BADI.

 Click on back.

Steps to implement filter dependent BADI: 

 Execute T-Code SE19.


 Select radio button classic BADI under create implementation block.
 Enter BADI definition name.
 Click on create implementation button.
 Enter implementation name.
 Click on yes button.
 Enter short description.
 Click on insert row icon to set the filter values.

Ex:

 Filter dependent Filter type


BUKRS
BY MR. BABU (OASIS TECHNOLOGIES)
Co.code
2000
1000
….
……

 Click on interface tab.


 Double click on the method name.
 Click on yes.
 Enter the package name.
 Click on save icon.
 Click on yes to save the BADI implementation under the same TR.
 Click on yes.
 Click on save.
 Implement the required business logic as per the specification in between the system
generated statements.
Ex: IF FLT_VAL EQ <1000>.
*business logic for first filter value.
.
ELSEIF FLT_VAL EQ <2000>
*Business logic for second filter value.
ENDIF.
 Click on pretty printer button.
 Click on activate icon.
 Select all the related objects.
 Press enter button.
 Click on back.
 Activate the implementation.
Demo program on filter dependent BADI is (ZB20_USE_FLT_BADI).

Steps to work with a fall back class: 

 Once the new BADI definition is in change mode.


 Uncheck the multiple use check box.
 Double click on interface name.
 Press enter and click on yes.
 Enter the package name and then click on save icon.
 Create the TR.
 Click on yes.
 Press enter button.
 Define the required method and the corresponding parameters.
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on activate.
 Click on back.
 Double click on the BADI definition name.
 Check the check box ‘Call fall back’.
 Enter the fall back class name (ZCL_B20_NEW_BADI_FALBK_DFF).
 Double click on the fall back class name.
 Click on yes.
 Enter the package name.
 Click on save.
 Click on yes to save the class under the same TR.
 Click on yes.
 Press enter button.
 Double click on the required interface method.
 Implement the required business logic in between the system generated statements
method END method.
 Click on pretty printer.
 Click on activate.
 Select all the BADI related objects.
 Press enter button.
 Click on back.

Standard BADI: 

 Most of the Standard BADI’s are classic BADI’s.


 These are used to add the additional customer specific functionality or business logic to the
standard programs or T-Codes.

Different ways to find Standard BADI’s: 

Following are the different ways to find the standard BADI’s.

1) Using T-Code SE-84.


2) Using the standard class CL_EXITHANDLER.
3) Using SQL tracer (ST05).

1. Steps to find Standard BADI’s using the T-Code SE-84: 

 Find the package name of the required T-Code/program.


Ex: execute MM02/VA02SystemStatusDouble click on program
nameGOTOAttributes.
BY MR. BABU (OASIS TECHNOLOGIES)
 Execute the T-Code SE84.
 Expand enhancements.
 Expand business add-ins folder.
 Double click on definitions.

Note: An implementation selection/icon is used to list out the BADI implementation of the
package.

 Enter the required package name (MGA).


 Click on execute icon.

Note:

1) All the corresponding BADI’s are listed.


2) Most of the standard BADI’s start with BADI*.
3) Find an appropriate BADI by reading its name and description use trial & error method to
find an exact Exit/BADI.
Ex: BADI_MATERIAL_CHECK-Enhanced checks for material master tables.

2. Steps to find the BADI’s using the standard class CL_EXITHANDLER: 

Note: T-Code SE24 is used to maintain the global class.

 Execute the T-Code SE24.


 Enter the standard class name CL_EXITHANDLER.
 Click on display button.
 Double click on the method GET_INSTANCE.
 Set a session break point on the method GET_CLASS_NAME_BY_INTERFACE.
 Execute the required functional T-Code.
Ex: MM02
 Perform the required action.
Ex: Save material

Note: Skip the break point for the unwanted action by pressing F8 function.

 Double click on a passing parameter (EXIT_NAME) to know/list out corresponding


BADI.
Ex: BADI_MATERIAL_CHECK.

3. Steps to find the BADI’s using SQLTRACER (ST05): 

 Execute the T-code ST05.


 Check the check box ‘Table buffer trace’.
 Click on activate trace button.
 Execute the required functional T-Code in another new session.
BY MR. BABU (OASIS TECHNOLOGIES)
Ex: MM02/VA02/VL02…..
 Perform the required action.
Ex: Save/Enter/Press any icon /…
 Open SQL tracer session.
 Click SQL tracer session.
 Click on deactivate trace button.
 Click on display trace button.
 Press enter button.
 Click on find icon.
 Enter the find string.
Note:
1. All the corresponding BADI’s and the interfaces are listed.
2. Find an appropriate correct BADI by analyzing the BADI names, BADI
descriptions (or) by using trail &error method.
Ex: BADI_MATERIAL_CHECK.

Database views V_EXT_ACT:

It contains the BADI definitions implementations, filter values etc.

Following are the field in this DB view.

View field Description


EXIT_NAME Business Add-in definition
IMP_NAME Business Add-in Implementation BADI
FLT_VAL Filter value for filter dependent
implementation
MST_LANG Language key
Database views V_EXT_IMP:

It contains the BADI interface name, class name, implementation name, definition name &
etc,Following are some of the useful fields:-

Field Description
INTER_NAME Interface name
FLT_VAL Filter value for filter dependent BADI
implementation
IMP_CLASS Object type name
IMP_NAME Business Add-in implementation
EXIT_NAME Business Add-in definition
Steps to implement a standard BADI: 

 Execute the T-Code SE19.


 Select a radio button classic BADI under create implementation block.
BY MR. BABU (OASIS TECHNOLOGIES)
Note:The block edit implementation is used to change the existing BADI implementation.

 Enter the required BADI name (BADI_MATERIAL_CHECK).


 Click on create implementation.
 Enter implementation name.(ZB20_ MATERIAL_CHECK)
 Press enter button.
 Enter short description.
 Click on interface tab.
 Double click on required method name.
Ex: (CHECK_data).
 Click on yes.
 Enter the package name.
 Click on save icon.
 Create the TR by pressing create request icon.
 Click on yes button.
 Click on SAVE icon.
 Implement the required additional customer specific business logic using parameters of
the method in between the system generated statement METHOD & ENDMETHOD.
Ex: METHOD if
EX_badi_Material_CHECK~CHECK_DATA
*Additional business logic
<If wmara_Volum EQ space.
MESSAGE : “Enter Volume” TYPE ‘E’
ENDIF
END METHOD >
 Click on pretty printer button.
 Click on activate icon.
 Check all BADI related objects names.
 Press enter button.
 Click on back.

Test the scenario: 

Make volume field (MARA_VOLUM) mandatory in MM02/MM01.

 Execute the required T-Code Ex: MM02/VL02.


 Enter the document number
Ex: Material no/Delivery no. etc…
 Press enter button.
 Select an appropriate view (Basic Data).
 Change any data.
 Click on save icon.
BY MR. BABU (OASIS TECHNOLOGIES)
Note:All implementations are triggered in the specified sequence one by one in case of a
BADI has multiple implantations.

Different between EXITS and BADI’s:

Exits BADI’s
These are procedural ABAP based. These are OOABAP based.
It is not possible to assign an Exit to more than The multiple use BADI can be implemented
one project. for multiple types.
Filter values can be set to the Exits. Filter values can be set for filter dependent
BADI’s.
T-Codes CMOD & SMOD are used. T-Codes SE18 & SE19 are used.

Different between classic BADI and New BADI:

Classic BADI/OLD BADI New BADI/Kernel


The standard method set instance of the The ABAP statements GET BADI and CALL
standard class CL_EXITHANDLER is used to BADI are used to work with new BADI.
work with classic BADI’s.
BY MR. BABU (OASIS TECHNOLOGIES)

Cross Aplications or Interfaces


This concept is used to distribute the data between two SAP systems, SAP & Non SAP systems.

SAP R/3 Interface SAP CRM

Two SAP Systems

NON SAP
SAP Interface
.Net/Java

SAP and Non SAP

Following are the different cross application components.

1. RFC.
2. BAPI.
3. ALE/EDI/IDOC.

1
BY MR. BABU (OASIS TECHNOLOGIES)
RFC (Remote Function Call):

 It is SAP specific protocol to provide communication between different systems.


 It is the process of calling Function Modules from another system.
These can be used to distribute the data between two SAP and SAP & Non SAP systems
as below.

Note: SAP uses CPI-C (Common Programming Interface for Communication) protocol.

CPI-C
SAP CRM
SAP R/3 RFC-Interface
(or) Non
SAP

Following are the different types of RFC’s.

 Synchronous RFC.
 Asynchronous RFC.
 Translation RFC.
 Qued RFC.

1. Synchronous RFC:SRFC
In case of synchronous RFC both the systems (Sender or Source and Receiver or
Target)should be available while distributing the data. The next part of calling
program isn’t continued until call function is completed.

2
BY MR. BABU (OASIS TECHNOLOGIES)
2. Asynchronous RFC:ARFC
 In case of asynchronous RFC both the systems need not to be available while
distributing data.
 The next part of calling program is continued without completing call
function.

Note:In case of this RFC data may be lost since if target system is not available.

3. Transaction RFC:TRFC
 It is almost similar to asynchronous RFC.
 The transactional RFC is executed only once in an RFC server and save the
corresponding data under unique transaction ID (TID) in the DB.

4. Qued RFC:QRFC
 In case of this RFC the multiple transactional RFC’s are serialized in the
sequence using the FM (TRFC_SET_QUEUE_NAME).
 The multiple logical units of works (LUW) are processed in the sequence.

Note:In the real time Synchronous RFCs are mostly used

Calling RFC in another SAP system:

An additional statement destination is used while calling remote enabled functions.

Syntax:

Source – SAP R/3—DEV QASPAS

o Remote enabled function.


Function <ZREMOTE_FUNCTION/BAPI….>
*business logic
SELECT
.
END FUNCTION
Destination—SAP CRM—CMDCMQCMP
REPORT<zrep_name>….
.
.
*call RFC
.

3
BY MR. BABU (OASIS TECHNOLOGIES)
.
CALL <ZREMOTE_FUNCTION/BAPI…>
*DESTINATION <DEV/QAS/PAS>
DESTINATION <gv_sysid>

[STARTING NEW TASK  This is a synchronous call]

IMPORTING

Ex_param =

EXPORTING

Im_param =

CHANGING

Chg_Param =

TABLES

Itab =

*New prog task part

Steps to maintain RFC connection:

 Execute the T-Code SM59.


 Select an appropriate RFC connection.
 Ex:-- ABAP connections/Type 3 connections.
 Click on create icon.
 Enter the FRC destination name.
 Enter description.
 Enter the target application server name/address in the target host field.
 Enter the target system number.
Ex:-- Target host : 110.610…. (or) CRMSYSTEM
System number 33
 Click on “Logon and security” tab.
 Scroll down add enter the logon credentials of the target system.
Ex:-- client 500

4
BY MR. BABU (OASIS TECHNOLOGIES)
User SAPUSER currentuser
Password INDIA123
Note:-- the check box current user can be checked to make use of the same user name
and password for the target system.
 Click on save icon.
 Click on remote login button to test the remote connection.
 Click on back.

Scenario on Remote Enabled Function:

Distribute billing data from SAP R/3 system into CRM system through remote function call.

Source System (or) outbound system Destination system (or) Inbound

System : SAP R/3 Interface System : SAP CRM

System ID : EC7 RFC System ID : CRM

Client : 800 client : 800

Steps to create the remote enabled function in the source system:

 Create the required function group.


 Execute the T-Code SE37.
 Enter the remote enabled function name (ZB20_RFC_BILL_DATA).
 Click on create button.
 Enter the existing created function group.
 Enter short text.
 Click on yes.
 Press enter button.
 Click on attributes tab.
 Select a radio button remote enabled module.
Note:-- The attribute tab is used to identify or recognize the type of FM.
 Click on import tab & define parameter if required.
 Click on import tab & define the required table’s parameters.
 Note:-- The check box ‘pass value’ must be checked for import, export and changing
parameters in case of remote enabled functions.

Parameter Name Type Specification Associated Type

IT_DOC_RANGE LIKE SELOPT

5
BY MR. BABU (OASIS TECHNOLOGIES)
ET_VBAP LIKE ZB20_STRCTR_VBAP

 Click on source code tab.


 Implement the required business logic as per the specification.
* Local data declarations
DATA: Lt_VBAP TYPE TABLE OF Zb20_strctr_vbap,
Ls_vbap TYPE zb20_strctr_vbap
Ls_vbap_t TYPEZB20_strctr_vbap
*clear and refresh local data variables
CLEAR :LS_vbap
LS_vbap_t
REFRESH: It_vbap_t
*get required data from VBAP
SELECT vbeln
Posnr
Matnr
Matkl
Umzin
From vbap
INTO TABLE It_vbap
WHERE vbeln IN it_doc_range.
*collect data
LOOP AT lt_vbap INTO ls_vbap
*move required data
MOVE: Ls_vbap-vbeln INTO ls_vbap_t_vbeln,
Ls_vbap-matnr INTO ls_vbap_t_matnr,
Ls_vbap-matkl INTO ls_vbap_t_matkl,
Ls_vbap-umzin INTO ls_vbap_t_umzin,
*compress character fields data & summarizes numeric field data
COLLECT ls_vbap_t INTO et_vbap
ENDLOOP
 Click on pretty printer button.
 Click on activate icon.
 Press enter button.
 *demo program on calling RFC (or) BAPI (ZB20_USAGE_RFC)
Note: 1. The pattern functions can’t be used to call remote enabled function (or)
BAPI’s in the destination (or) target system.

6
BY MR. BABU (OASIS TECHNOLOGIES)
2. The remote enabled functions can be used as normal function modules but the
normal functions can’t be used as a remote enabled function.
3. The external break points can be used to debug cross application components such as
RFC, BAPI across the system.

BAPI “Business Application Programming Interface”:

 BAPI stands for Business application programming interface.


 It is also a remote enabled function but only the difference between remote enabled
function and BAPI is the system generates the unique method for BAPI’s whereas the
system does not generates the unique method for Remote enabled function.
 The transaction code ‘BAPI’ is used to find the details of BAPI’s in the system.
 The T-code ‘SW01’ (object repository) is used to place the BAPI-RFC in BOR (Business
object repository).
 Following are different types of BAPI’s.
1. Custom BAPI
2. Standard BAPI
3. Extended BAPI

1. Custom BAPI:

 The custom BAPI’s are maintained as per the customer requirements.


 The custom BAPI’s are also called Z-BAPI’s.
 All the objects name related to custom BAPI’s should start with Z-BAPI.
 Following are the common steps to be followed to create custom BAPI’s.
1. Create the required BAPI structures which should start with ZBAPI*.
2. Create an appropriate BAPI-RFC which starts with ZBAPI*.
3.Place the created BAPI remote enabled function in BOR to generate the unique
method using the T-Code ‘SW01’.
4. Implement and release the created BAPI to the outside using T-Code ‘SQ01’.

Steps to work with custom BAPI’s:

 Create a BAPI structure with the below fields (ZBAPI_PLANT_MATERIAL)

7
BY MR. BABU (OASIS TECHNOLOGIES)
 Note:-- the system purpose the meaning full field names while creating BAPI
structure.
 Ex:-- MATNR  MATERIAL
WERKS  PLANT
Component field Component type Description

Material MATNR Material number

PLANT WERKS_D Plant

MAIN_STAT PSTAT_D Maintenance status

 Create BAPI remote enabled function with the below parameters.


Function module:-- ZBAPI_RFC_PLANT_MATERIAL

IMPORT:
Parameter Name Type Associated type Optional Pass value

IM_MAT_LOW TYPE ZBAPI_PLANT_MATERIAL 


-MATERIAL
IM_MAT_HIGH TYPE ZBAPI_PLANT_MATERIAL 
-MATERIAL

TABLES:
Parameter Name Type Associated type

RETURN LIKE BAPIRET2

ET_PLANT_MAT LIKE ZBAPI_PLANT_MATERIAL

Note: The RETURN parameter must be defined for Remote enabled functions
since the expectations are not raised in the third party system (Non SAP).

Note: Release Remote enabled BAPI Function module using the menu path
Release  Release before it is placed in BOR

8
BY MR. BABU (OASIS TECHNOLOGIES)
Place BAPI remote enabled function in BOR:

1. Execute T-Code SW01.


 Enter object name (ZCUST_BAPI).
 Click on create button.
 Fill the required fields such as object name, name, description, program name
and application.
 Ex:- Object type – Zcust_BAPI
Object name – ZCUST_BAPI
Name – ZCUST_BAPI
Description – Custom BAPI
Program – ZCUST_BAPI
Application – * -- cross application
 Click on yes button.
 Enter the package name.
 Click on save icon.
 Create the TR by pressing create request icon if required.
 Click on yes button.
 Place a cursor on methods.
 Click on utilities menu item.
 Click on API methods.
 Click on Add method (shift + f4).
 Enter the required BAPI remote enabled function
(ZBAPI_RFC_PLANT_MATERIAL).
 Click on yes button.
 Click on next step icon.
 Click on yes button.
 Expand methods objective type.
Note:-- The system generated unique method is displayed.
Ex:-- ZCUST_BAPI: ZbapiPlantMaterial
 Place a cursor on the method name.
 Click on generate icon.
 Place a cursor on the method name.
 Click on edit menu item.
 Click on object type.
 Click on ‘To implement’ and ‘To released’.
 Click on back.

9
BY MR. BABU (OASIS TECHNOLOGIES)
Generate, implement and release custom BAPI:

 Execute T-Code SW01.


 Enter the required BAPI object name (ZCUST_BAPI).
 Click on generate icon.
 Click on the menu item ‘objects type’.
 Click on change release status to.
 Click on implemented.
 Click on object type menu item.
 Click on ‘change release status to’.
 Click on ‘Released’.
 Click on yes button.
 Click on back.
Note:--
If everything goes well the custom BAPI will be available in BAPI Explorer (T-
Code BAPI)

Steps to test BAPI:

 Execute the T-Code SW01.


 Enter BAPI object name.
 Click on test button.
 Click on execute icon that appears beside the system generated method.
 Fill the required import parameters and tables parameters.
Note:-- The system provides search help in case of a BAPI remote enabled
function method.
 Click on execute icon.

Standard BAPI:
 They are the system provided which can be used to distribute the data between
two SAP and Non SAP systems.
 Some of the standard BAPI’s can also be used to migrate legacy system data
into SAP.
 The standard BAPI function modules start with BAPI*.

10
BY MR. BABU (OASIS TECHNOLOGIES)
Different ways to find standard BAPI’s:

There are two ways to find BAPI.

1) Using T-Code BAPI.


2) Using T-Code SE37.

Steps to find BAPI’s using the T-Code BAPI:

 Execute the T-Code BAPI.


 Expand the required hierarchy ex: sales and distribution etc.
 Expand the required sub-functional area ex: sales/billing …. Etc.
 Double click on the required BAPI.
Note:-- 1. Corresponding BAPI details such as method name, business object name, BAPI
function module and etc. are displayed under details tab.
2. The tab documentation is used to know more details about the BAPI’s (standard).
3. The tab alphabetic can also be used to find the BAPI’s in the alphabetic order.

 Click on back icon.


 Ex: ZBAPI_RFC_PALNT_MATERIAL

Steps to find BAPI function modules:

 Execute the T-Code SE37.


 Enter the required BAPI search string or pattern.
 Ex: BAPI * SALES*
 ZBAPI * PLANT
 Click on search help icon.
 Enter the required find string.
 Ex: create/change/delete.
 Press enter button.
 Note: --Find the exact BAPI by understanding its short description.
 BAPI_SALESORDER_CREATEFROMDAT2-SALES order: Create sales order.
 Double click on the required found BAPI to test it.
 Note: --The standard table TFDIR contains all the function module in the system.

Steps to check standard BAPI’s:

 Execute the T-Code SE37.


 Click on the function module menu item.
 Click on test.

11
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on test sequences.
 Enter the required BAPI to be tested along with the standard BAPI.
 Ex:-- BAPI_TRANSACTION_COMMIT {fonction modules}.
 Click on execute icon.
 Click on details view or edit to fill the required fields of the structure under import &
tables parameters.
 Note: --- Use an icon single entry to convert the fields arrangement vertically.
 Click on yes button.
 Click on back.
 Click on execute icon after the required data is provided to the BAPI.
 Click on back.
 Execute the BAPI_TRANSACTION_COMMIT to commit the changes in the data base.
 Click on back.
 Note: -- Check the updated data in the corresponding data base table. Ex:
VABK/MARA…etc.
Scenario on Data Migration to create or change using the standard BAPI’s.:
Create or change the cost centers using the standard BAPI’s.
T-Code: KS01—create cost centers.
KS02—change cost centers.
Tables: CSKS,….
BAPI: BAPI_COSTCENTER_CREATEMULTIPLE_CREATE –Create Cost centers
: BAPI_COSTCENTER_CHANGEMULTIPLE_CHANGE- Change cost centers

 *Demo program on data migration using standard BAPI’s is ZB20_MIGARTE_BAPI.

Common steps involved in Date Migration using standard BAPI’s:


1). Upload a flat file data from a legacy system into an internal table.
2). Validate the flat file data by setting a loop to flat file internal table (Gt_file)if
required.
3). Convert the flat file data into the BAPI compatible internal tables.
4). Use an appropriate required BAPI function module to migrate flat file data.
5). Display the messages in case of an internal tables (Return table_Gt_Return)is filled.
Example:
*upload flat file data
CALL FUNCTION ‘GUI_UPLOAD’.
.
.
*OR = <gt_file>

12
BY MR. BABU (OASIS TECHNOLOGIES)
*OPEN DATA SET
* DO
*READ DATA SET…
.
*END DO
*Convert, Translate flat file data into BAPI compatible
LOOP AT <gt_file> INTO <gs_file>
*Convert and translate flat file data if required
*CONCATENATE …
*TRANSALATE…
*CALL FUNCTION ‘<CONVERSION_ROUTINE>’
MOVE: <gs_file_f1> TO <gs_bapi>
.
.
ENDLOOP.
.
*CALL BAPI function to Migrate flat file data
CALL FUNCTION <BAPI_...>
.
TABLES
<bapi_tab> = gt_bapi>
Return = <gt_return>
.
Steps to handle message in standard BAPI’s
1). Get all the message details into a written table of the type BAPIRET such as Message
ID.
Messages type, message variable … etc.
2). Use the standard function modules MESSAGES_INITIALIZE (Initialize messages),
MESSAGE_STORE (to store the messages) and MESSAGES_SHOW (to display messages is
the Dialog box/Model dialog).
Sample code:
.
.
CALL FUNCTION ‘BAPI*’
.
.
TABLES
Return = <gt_return> “type BAPI RETZ

13
BY MR. BABU (OASIS TECHNOLOGIES)
IF NOT <gt_return> [ ] IS INITIAL.
PERFORM <F_messages>
ENDIF
FORM <f_message>
*initialize message
CALL FUNCTION ‘MESSAGES_INTIALIZE’
*store messages
LOOP AT <gt_return> INTO <gs_return>.
CALL FUNCTION ‘MEESAGE_STORE’
EXPORTING
Arbgb = <gs_return>- id
Msgty = <gs_return>- type
Txtnr = <gs_return>- message-V1
.
.
ENDLOOP
*display messages
CALL FUNCTION ‘MESSAGE_SHOW’.
ENDFORM.
3). Extended BAPI:
 Standard BAPI’s can be extended to add the customer specific additional field.
 Standard BAPI contains tables parameter EXTENTIONIN, EXTENTIONOUT in case
of they are extended BAPI’s.

Steps to extend the standard BAPI’s:

1. Add the additional customer specified into the relevant required tables and
structures using APPEND structure.
2. Create a custom structure for the check boxes.
3. Add the additional check box fields to the corresponding structure.
Ex: VBAP
VBAP KOZ customer modification structure
VBAP KOZX
BAPE_VBAP structures for BAPI’s.
BAPE_VBAPX
4. Populate an internal table (extension table) of the type BAPIPAREX with the
customer specific additional field and their data before BAPI is called.
5. Pass the populated extension table to the tables parameters EXTENTIONIN (or)
EXTENTIONOUT of the standard BAPI’s.

14
BY MR. BABU (OASIS TECHNOLOGIES)
Scenario on extended BAPI:

Extend the standard BAPI BAPI_SALESORDER_CREATEFROMDATZ with an additional field email


id.

1. Add an additional field E-mail address using .APPEND structure into the required
tables and structures.
Ex: VBAP
VBAP KOZ
BAPE_VBAP
Field Data element Description
EEMAIL_ADDR AD_SMT PADR Email address

2. Populate an extension table with the required data as below.


<gs_extention> _structure = ‘BAPI_VBAP’.
<gs_extention>_value part1 = <gs_adrc=SMTP-ADDR>
<gs_extention>_value part2 =
.
.
APPEND<gs_extention> TO <gt_extention>
*APPEND check boxes
CLEAR <gs_extension>
<gs_extention>_structure = ‘BAPE_VBAPX’—check boxes
<gs_extention>_valuepart1 = ‘X’.
APPEND <gs_extention> TO <gt_extention>

*APPEND
.
.
*Pass Extension table to BAPI
CALL FUNCTION ‘BAPI_SALESORDER_CREATEFORMDAT2’.
.
.
TABLES
EXTENSION = <gt_extension>.

15
BY MR. BABU (OASIS TECHNOLOGIES)
*Difference between RFC and BAPI:

RFC BAPI
1. The system does not generate any method 1. The system generates the unique method in
for remote enabled functions. BOR for BAPIs.
2.These can’t be used in all third party systems 2. The system generated method of the BAPIs
such as VB…etc. can be used in ant third party systems.
3. There are no standard remote enabled 3. Some of the standard BAPIs can be used to
functions to migrate the data. migrate the data from legacy system.

NOTE:Both of them are REMOTE ENABLED FUNCTIONS.

Authorization Objects:

 These are used to protect user access to the data and T-Codes.
 The authorization objects are maintained by BASIS consultants.
 The T-Code ‘SU24’ is used to find authorization objects in the system.
 The ABAP statement ‘AUTHORITY_CHECK’ OR the standard Function Modules
‘AUTHORITY_CHECK*…’ are used to check the authorizations.

Syntax:
.
.
AT SELECTION-SCREEN
PERFORM<f_auth_check>
.
.
AUTHORITY_CHECK OBJECT ’<OBJECT_NAME>’
ID’<ID_NAME>’FIELD<p_input/s_input/low..>
ID ‘ACTVT’ FIELD’<01/02/03>’.
*OR
*CALL FUNCTION ‘AUTHORITY_CHECK’.
.
.
IF sy-subrc NE 0.
MESSAGE ‘<Not authorized>’ TYPE ‘<E>’.
ENDIF.

16
BY MR. BABU (OASIS TECHNOLOGIES)
ENDFORM.

Here, <OBJECT_NAME> is the authorization object name.


<ID_NAME> is an authorization objects ID-name & Field name
 Activity values 01 for create, 02 for change, 03 for display.

Steps to find authorization objects:


 Execute the T-Code ‘SU24’.
 Enter the required T-Code (KS01/MM01/VA01…).
 Click on Execute icon.

Note: Find an appropriate relevant authorization object by analyzing their object descriptions
and field name.
 Double click on an authorization object to check the corresponding activity and field names.
EX:
OBJECT FIELD NAME ACTIVITY
K_CSKS KOKRS 01
KOSTL

3. ALE/EDI/IDOC’S:-
 ALE: Application Linking Enabling.
 EDI: Electronic Data Interchange.
 IDOC’s: Intermediate Document.

A. ALEInterface: It is used to distribute the data between two different SAP system or
servers.
B. EDI Interface: It is used to distribute the data between SAP and non-SAP systems or
servers.
C. IDOC: It is a data carrier to carry the data between the distributed systems. Each IDOC
has three records
1. Control Record
2. Data Record
3. Status Record
1. Control Record:It contains IDOC type and Message type information, Partner
information such as partner system number, Port number of the sender and receiver
system.
 It can also contain technical & address information of sender & recipients.
2. Data Records:These are the collection of segments.

17
BY MR. BABU (OASIS TECHNOLOGIES)
 Segment is the collection of field which can be distributed between the systems.

Data Records
Segment1-EXXX

FIELD NAME FIELD VALUE


F1 100
F2 200
. .
. .

Segment2-E1XXX
.
.
3. Status Record: The status records contain the status of the processed IDOC to know where
an IDOC has been successful or failed.
 The standard table EDIDC contains an IDOC information such as control records, different
statuses etc.
Following are some of famous message statuses:
TABLE DESCRIPTION
01 IDOC generated
02 Error while passing data to port
03 Data is passed successfully to port
04 Error within control information of EDI sub
system
20 Error while triggering EDI sub system
18 EDI sub system is triggered successfully
26 Error during syntax check of IDOC(Outbound)
32 IDOC was edited
34 Error in control record of IDOC
37 IDOC added incorrectly
50 IDOC added successfully
56* IDOC with error added
60 Error during syntax check of IDOC(Inbound)
63 Error passing IDOC to application
64 IDOC ready to be distributed to application
65 Error in ALE service

18
BY MR. BABU (OASIS TECHNOLOGIES)
75 IDOC is inbound queue

Note:
1. The sender system or source system is also called as ‘Outbound system’.
2. The receiver system or target system is also called as ‘Inbound system’.
3. The T-Code ‘WE30’ is used to maintain different types of IDOC such as basic IDOC, Ended
IDOC.
4. T-Codes ‘WE20’/’WE05’ are used to list out the generated IDOCs.
5. T-Codes ‘WE19’ are used to test or check IDOC.
Segment:It is a collection of fields with the data to be distributed between the systems.
 The data record of an IDOC contains the segments.
Following are different types of segments:

Segments
Custom segments standard segments
Client& Version Dependent Client& version Independent

Custom Segments: The custom segments starts with Z*/Y*.


 The custom segments are maintained by technical consultants and functional
consultants.
Standard Segment: These are the system provided segments.
 The standard segments which start with ‘E*’ are client & version dependent segments.
 The standard segments which starts with ‘E1*’ are client & version independent
segments.
 The T-Code ‘WE31’ is used to maintain the segments.
Message Types: These are the identifiers of the application data to be distributed between the
systems.
 The T-Code ‘WE81’ is used to assign message types to an IDOC (Data Carrier).

Following are some of the useful system provided standard message types:
Message Type Description
MATMAS Material Master
DEBMAS Customer Master
CREMAS Vendor Master
. .

19
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
1. The standard table ‘EDIDC’ contains all available message type.
2. Standard maintenance view VEDI_EDMSG contains the maintain message type.

Outbound and Inbound IDOC or ALE Process:

Outbound IDOC Process:

It is used to transfer data to the external system through Communication Layer(Out going
IDOC)

20
BY MR. BABU (OASIS TECHNOLOGIES)
Inbound IDOC Process

It is used to recieve data from sender sysem through communication Layer (Incoming IDOC)

Partner Profiles: These are used to maintain the partner system details with which data to be
distributed such as partner number, Partner type, and Message type of outbound parameters.
 The T-Code ‘WE20’ is used to maintain partner profiles.
Ports: These are used to specify the way in which data to be distributedthrough an IDOC.
 The systemgenerates one unique port number.
 The T-Code ‘WE21’ is used to maintain ports for IDOC process.
Customer Distribution Model: It is used to define data distribution model to exchange the
messages between two logical systems.
 T-Code ’BD64’ is used to define or maintain customer distribution model.

Some of useful Transaction Codes or Reports to send and receive the data to an IDOC:
Following are some of the useful T-Codes or Reports to send or receive the data through an
IDOC.
T-Code Description
BD10 Send Material
BD11 Get Material
BD12 Send Customer
BD13 Get Customer

21
BY MR. BABU (OASIS TECHNOLOGIES)
BD14 Send Vendor
BD15 Get Vendor
BD16 Send Customer
BD17 Get Cost Center
BD87 Reprocess IDOC

Useful T-Codes in ALE/IDOC:

T-Code Description
SALE Basic configuration of ALE/IDOC
WE30 Maintain IDOC’s
WE02/WE05 Display generated IDOC’s
WE20 Maintain Partner Profiles
WE21 Maintain ports in IDOC processing
WE31 Maintain Segments
WE41 Maintain process codes
(Outbound system)
WE42 Maintain process codes
(Inbound systems)
WE81 Maintain Logical Message types
WE82 Assign message type to IDOC type
NACE Maintain output type

Note: Most of the T-Codes which are related to ALE/IDOCs start with WE* and BD*.

Process Codes: It is used to identify type of the data to be distributed through an IDOC
interface.
 The process code can only be used with applications which perform outbound processing
message control(NAST-Structure).
 T-Code WE41/WE42 is used to work with the process codes.

Scenario on ALE/IDOC using standard message type:


Distribute Material data from one system to another system.

Source (or) outbound system Target(or) Inbound system

Through ALE/IDOC
Client: 800 Client : 810
22
BY MR. BABU (OASIS TECHNOLOGIES)
System ID: ECC System ID: ECC

1. Perform the below steps in Source system.


a. Steps to define logical systems:
 Execute the T-Code ‘SALE’.
 Expand basic settings.
 Expand logical systems.
 Click on execute icon ‘IMG’ activity that appears beside define logical system.
 Click on Yes button.
 Click on New Entries button.
 Enter or maintain the logical systems for outbound and inbound systems.

Logical Systems:
LOG System Name
CLNT 800 Outbound system-India
CLNT810 Inbound system-US

 Click on save icon.


 Click on create request icon.
 Enter short description (As per project standards).
 Click on save icon.
 Click on Yes button.
 Click on back icon.
 Click on back icon.

b. Steps to assign logical systems to clients:


 Click on Execute icon (IMG Activity) that appears beside assign logical system to client.
 Click on Yes button.
 Double click on the required source client number (800).
 Change the logical system name.
EX: Client: 800
Logical: CLNT800.
 Click on save icon.
 Click on Yes button.
 Double click on target system outbound system (810).
 Change the logical system name.
EX: Client: 810
Logical: CLNT810.

23
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on save icon.
 Click on Yes button.
 Click on back icon.
 Click on back icon.
c. Steps to create RFC Connections:
 Expand an item communication.
 Click on IMG Activity of ‘create RFC connections’ in the T-Code ‘SALE’.
Note: T-Code SM59 can also be used to maintain RFC destination or connection.
 Select the RFC connection type ‘ABAP connections’.
 Click on create icon.
 Enter RFC destination name.
 Enter description.
 Enter application server of the target system and the system number.
EX: Target Host gcecc62 System number 00.
 Click on logon and security tab.
 Enter logon credentials of the target system/ destination.

EX: Language:
Client: 810
User: SAPUSER
PW status: IS initial
Password: india123.
 Click on save icon.
 Click on Yes button.
 Click on Remote Logon button to test the Remote connection.
 Click on back button.
Note: The RFC connections to be maintained in the target system or Inbound system also(810).

d. Steps to maintain Customer distribution model:


 Execute the T-Code ‘BD64’.
 Click on display or change icon.
 Click on create model view button.
 Enter short text and technical name.
EX: CLNT: 800
 Click on Yes button.
 Select the created customer distribution model.
 Click on the button add message type.

24
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter Sender Logical system name, Receiver Logical system name and enter an
appropriate message type name(MATMAS).
 Click on Yes button.
 Click on Environ ment menu item.
 Click on Generate Partner Profile to generate Partner Profile and Port number.
 Enter Partner logical system name. Ex: CLNT810.
 Click on execute icon.
 Click on back.
 Click on back.
 Click on edit menu item in an initial screen of ‘BD64’.
 Click on model view.
 Click on distribute after model view is saved.
 Click on Yes button since the receiver logical system is selected.
Note:The system gives a message ‘Model view has been created’.
 The distributed model view is appeared in the target system or client ‘Inbound system’.
EX: Client: 810

e.Steps to maintain Partner Profiles:


 Execute the T-Code ‘WE20’.
 Select the folder partner type LS(Logical System).
 Click on create icon.
 Enter Partner number. EX: CLNT810.
 Click on an icon create outbound parameter under outbound parameter block.
 Enter the required message type. EX:MATMAS
 Enter the system generated Port Receiver number. EX:A000000055
Note: The port number is generated while generating partner profiles at the time of CDM.
 Enter or Select the required basic type.
EX: MATMAS05.
 Click on save icon.
Note: No need to create Partner Profile since the Partner Profile is generated while creating
CDM (Customer Distribution Model).

f. Creation of Material orDocument:


 Execute the T-Code MM01.
 Enter Material and select an appropriate Industry sector (OASIS MATERIAL).
 Select an appropriate Material type. (Competitive)

25
BY MR. BABU (OASIS TECHNOLOGIES)
EX: Material: OASIS MATERIAL
Industry Sector: Service Provide
Material Type: Competitive
 Press Enter button.
 Select the basic view. Ex: Basic View
 Press Enter button.
 Select Material description.
 Enter an appropriate base unit of measure.
 Click on save icon.

g. Perform below steps in the target system(810):


1. Steps to generate Port and Partner type:

 Execute the T-Code ‘BD64’.


 Select the distributed model view from the source system. EX: CLNT810
 Click on Environment button menu item.
 Click on generate Partner Profile.
 Enter Partner logical system.
EX: CLNT810
 Click on execute icon.
Note: The system generated Partner type and Port number are listed.
EX: Partner Type: LNT800
Port number: A000000012
 Click on back.
2. Perform the below steps in source system (800 client):
 Execute the T-Code ‘BD10’.
 Enter the required material to be distributed
EX: OASIS_MATERIAL.
 Enter the required logical system.EX:CLNT810.
 Click on execute icon.
Note: A system gives an information message to inform when Master IDOC is generated.
 Click on Yes button.

Steps to list out generated IDOC’s:


 Execute the T-Code ‘WE02 or WE05’.
 Fill the required input field such as created on etc.
 Click on execute icon.
Note:

26
BY MR. BABU (OASIS TECHNOLOGIES)
1. The generated IDOC is listed IDOC 0000000000757745.
2. Check the distributed material in the target system(‘Outbound’ system)using MM03.

Standard Reports of ALE/IDOC: Most of the useful standard report which are related to RBD*.
Following are some of the useful Reports or Programs.
Report Name Description
RBDAGAI2 Reprocess IDOC after Inbound ALE/ IDOC
RBDAGAIN Reprocess outbound error IDOC
RBDAPP01 Inbound processing of IDOC ready for
transfer
RBDCHECK Check IDOC structure against database tables
RBDCVS15 Generate Partner Profile
RBDOUTPU Process outbound IDOC
RBDPROCESS IDOC Processing
RBDMOIND Status conversion with successful TRFC
execution

Extended IDOC:
Extended IDOC can also be extended with the additional fields in the segments.

Scenario on extended IDOC:


Extend basic IDOC for vendor master to add an additional segment with the required fields.

Steps to work with an extended IDOC:


1. In outbound system-> client-800
Append the customs structure with the required field into an appropriate standard tables or
structure. EX: LFA1/LFB….
Field Description
VEN_EMAIL Vendor E-mail address
. .
. .

2. Creation of segment:
 Execute the T-Code ‘WE31’.
 Enter the custom segment name (ZE1LFA1).
 Click on create button.

27
BY MR. BABU (OASIS TECHNOLOGIES)
 Enter short description.
 Define the required fields.
 Click on save icon.
 Click on Yes button.
 Enter the Package name.
 Click on save icon.
 Create the TR by passing create request number.

Field Data Element
VEN_EMAIL AD-SMTPADR
. .
. .

3. Steps to create an extended IDOC:


 Execute the T-Code ‘WE30’.
 Enter extended IDOC name. EX: CREMA TEXT.
 Select a radio button extension.
 Click on create icon.
 Click on Yes button.
 Enter basic IDOC type against create new option.
 Enter description.
 Click on Yes button.
 Place the cursor on Mastersegment.
EX: E1LFA1.
Note: The segment can also be created using an icon create segment (shift+F6).
 Click on insert segment icon F6.
 Click on create segment icon.
 Click on yes button.
 Enter the created segment name (ZE1LFA1).
 Enter minimum and maximum numbers.
 Click on yes button.
Note: An additional segment is inserted under the required main segment or Parent segment.
 Click on save icon.
 Enter the package name.
 Click on save icon.
 Click on yes button to make use of the same TR.
EX: CREMASEXT
E1LFA1

28
BY MR. BABU (OASIS TECHNOLOGIES)
ZE1LFA1
E1LFA18
 Click on back icon.

4. Specify the extended IDOC to the standard message type:


 Execute T-Code ‘WE82’.
 Click on display or change icon.
 Click on yes button.
 Click on position button.
 Enter the required message type CREMAS.
 Press Enter button.
 Select the required basic type of message type. EX: CREMAS05.
 Click on copy as icon (F6).
 Enter the created IDOC extension. EX: CREMASEXT.
 Press Enter button.
 Select the unwanted previous basic type(CREMAS05).
 Press delete icon.
 Click on save icon.
 Click on yes button to make use of same TR.
EX:
Message Type Basic Type Extension Release
CREMAS CREMAS05 CREMASEXT 600

5. Steps to Check , Release and Transport IDOC:


 Execute the T-Code ’WE30’.
 Enter the defined extended IDOC name or custom IDOC name. EX: CREMASEXT.
 Click on edit menu item.
 Click on set release.
 Click on yes button.
 Click on development object menu item.
 Click on check.
 Click on back.
 Click on development object menu item.
 Click on Transport Request.

6. Steps to find an appropriate EXIT to populate IDOC with data:


 Execute the T-Code ‘SE84’.
 Expand enhancement tab.

29
BY MR. BABU (OASIS TECHNOLOGIES)
 Expand custom exits.
 Double click on enhancements.
 Enter an appropriate short text. (Customer / vendor).
Note: Use search pattern *SAPLKD* in SE37 to find the function exits foe vendor master IDOCs.
EX: EXIT_SAPLKD01_001-> Create vendor segment exit.
EXIT_SAPLKD02_002-> Read and Post vendor segment entry.
EXIT_SAPLKD03_003-> User Exit customer & vendor distribution.
 Execute the T-Code -SE37.
 Enter an appropriate Exit name.
EX: EXIT_SAPLKD01_001.
 Click on display button.
 Double click on the custom include program name.
 Press Enter button for the first time in case.
 Click on display or change icon.
 Add the additional business logic to populate the IDOC with the required data.

*Additional Business logic to populate IDOC.

DATA: ls_data_m TYPE E11falm, “Standard segment


ls_idoc_data TYPE edidd, “Idoc data
ls_ze1lfa1 TYPE ze1lfa1, “Additional segment
lu_tabix TYPE sy-tabix,
IF IDOC_cimtype = ‘CREMASEX’. “ Extendedidoc
IF segment_name = ‘ZE1LFA1’.
READ TABLE idoc_data INTO ls_idoc_data
WITH KEY segnam = ‘ZE1LFA1’.
Ls_da_m = ls_idoc_data_sdata.
*Get data for additional segment
SELECT SINGLE smtp_addr
FROM adr6
INTO ls_ze1LFA1_vend_email
WHERE addrnumber = ls_data_m_addr.
*Fill additional segment of an idoc
READ TABLE idoc_data INTO ls_idoc_data
WITH KEY segnam = ‘ZE1LFA1’.

30
BY MR. BABU (OASIS TECHNOLOGIES)
Lv_tabix = sy-tabix.
Ls_idoc_data-sdata = ls_ZE1LFA1.
*modify an IDOC with additional data
MODIFY idoc_dataFROMls_idoc_data INDEX lv_tabix.
ENDIF.
ENDIF.
 Click on pretty printer button.
 Click on activate icon.
 Press enter button.
 Click on back button.

7. Define the logical systems using the T-Code SALE:


 Assign logical systems to the required clients.
 Define customer distribution model CDM, generate partner profiles and port number
using the T-Code ‘BD64’.
Note: Follow the similar steps to define logical systems, assign logical systems to client, define
CDM, Refer standard idoc distribution.
 Use the T-Code BD14to send vendor.

8. Perform the below steps in the target system or client:


1. Define the logical system, assign logical systems to client and define RFC destination
using RFC code SALE.
2. Create customer distribution model if required, generate partner profiles and port
number using T-Code BD64.
3. Assign the define function module to the basic idoc using the T-Code WE37.
 Execute the T-Code WE57.
 Click o position button.
 Enter the required basic type. EX: CREMAS/DEBMAS/MATMAS.
 Click on display or change icon.
 Click on yes button.
 Click on new entries button.
 Enter the required function module name.
 Enter the basic type.
 Enter extension, Enter message type.
 Click on save icon.
 Create the TR by pressing create request icon.
 Click on yes button.
 Select IDOC direction inbound or outbound

31
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on save and click on back.
 Get the vendors using the T-Code BD15.
Custom ALE/IDOC:
Refer the document, demo program on function module to practice custom IDOC.
Note: The function module ‘MASTER_IDOC_DISTRIBUTE’ is used to generate the IDOC in the
custom report.

32
Opportunity Processing - General
Status: In Process

Name: Opportunity Processing - General


Documentation Type: LG ELEC Customer Input Template
Status: Copy Editing
Person Respons.: XXXXX

Applicability:All selling Units

1. Requirements/Expectations

1. To be able to create opportunities for prospects and existing customers.


2. To be able to assign relationship managers (Internal) for opportunities
3. To be able to assign contact person (External) for opportunities
4. To be able to define a Sales Cycle consists of multiple phases the following
a. Identify Opportunity
b. Value Preposition
c. Qualification
d. Exchange Information
e. Decision
f. Close
5. To be able to define sources of origin in opportunity Road Show / Exhibitions / Walk-in
/ Campaign / Client Relations / Internal Source / Customer Reference / Employee
Reference.
6. To be able to capture the Phase History with duration (No of days).
7. To be able to distinguish the opportunity from new customers / existing customers.
8. To be able to define the Priority of the opportunity as normal/ High / Very High
9. To be able to record the Milestones of the opportunity processing

a. Demonstration
b. Initial Need analysis
c. Go/No decision
d. Develop solution proposal
e. Quotation
f. Customer decision
2. General Explanations

With opportunity processing in SAP CRM, LG ELEC can perform the following.

The Opportunity describes the customers (sales prospects), their requested products and services,
the total volume of the customer project, the potential sales volume, and an estimated sales
probability. This information becomes more and more concrete throughout the sales course, and
should be updated regularly by the sales employee.

Information about the sales cycle:

• Sales cycle

• Start date and estimated end date of the sales project

• Current phase within the sales cycle and date on which this phase began

• Estimated sales probability within the current phase

• Status of the opportunity and the date since the opportunity has had this status

• Reason for status (won …, lost …)

Forecast Data

• Expected (estimated) sales volume for opportunity

• Expected net value of products or services (this is the cumulated, expected product
value from the items)

• Budget which the customer (sales prospect) has access to for the project

In each phase of the sales cycle, LG ELEC users can decide whether or not the data for the
expected sales volume should be entered for the sales volume forecast. LG ELEC users can carry
out an evaluation of all opportunities belonging to the group "New Customers", or an evaluation
of all opportunities belonging to the group "Longstanding Customers" – even when LG ELEC
users work globally, and, for example, if a different transaction type is used in the USA than in
Europe.

• Origin of the opportunity (for example, trade fair)

• Priority of the opportunity for User sales


Texts

In the opportunity, create, change or display different text types for own use or for
correspondence with business partners.

3. Explanations of Functions and Events


When BP submits applications to LG, respective Business development unit will be intimated
about the BP. CRM user will precede for opportunity processing.

For the qualified leads, CRM user can proceed for opportunity processing.

• CRM user will create an opportunity for the prospect / customer.

• CRM user will assign employee responsible to the opportunity.

• CRM user will maintain data


o Origin : Shows / Exhibitions / Walk-in / Campaigns/ Enquiry handling
/Internal sources/ Customer reference / Employee reference
o Priority : Normal / High / Very High
o Group : New customer / Existing Customer

• CRM user will check for contact person details, if not identical through account
processing new BP with category Person will be created

• The new BP-person will be related to BP-organization with a relationship category.

• CRM user will provide value preposition to the BP

• CRM user will check the role of business partner and status of business partner if the
role of the business partner is maintained as sold to party and status as registered /
incorporated, CRM user will precede for creation of quotation.

• If business partner role is still in prospect level CRM user will extend the business
partner master data to the respective unit.

• Finance will notify the about the status of the business partner.

• CRM user will proceed for quotation process

• CRM user will create quotation and forward to customer for approval.

• Negotiation is possible. Based on negotiation, quotation will be updated accordingly.

• Based on customer approval, respective CRM user will update opportunity won/lost
and close the opportunity.
Data relevance for opportunity process.
CRM user will maintain sales cycle and proceed in accordance with sales phases suitable
for the respective opportunity.
Sales Phases
• Identify Opportunity
• Value Preposition
• Qualification
• Exchange Information
• Quotation
• Decision
• Close

1. With movement of one sales phase to another sales phase system will capture the Phase
History (Duration in no of days)

2. CRM user will assign the respective Product / Service to the opportunity.

3. CRM user will maintain key milestones during sales cycle


Key Milestones during sales cycle

• Demonstration (Date)
• Initial need analysis (Date)
• Go/No decision (Date)
• Develop solution proposal (Date)
• Quotation (Date)
• Customer decision (Date)

4. At the end of opportunity CRM user will maintain the following status and reason code
for the status.
a. Won
b. Lost
c. Stopped by Us
d. Stopped by Customer

4. Special Organizational Considerations


None
5. Business Model

6. Changes to Existing Organization


Currently only selling units in LG ELEC were using opportunity process. Going forward
LG ELEC will maintain opportunity process with sales cycle and proceed in accordance
with sales phases in SAP CRM System.

7. Description of Improvements
With establishment of opportunity process LG ELEC users can have a framework for
displaying sales cycle from the beginning, to ending. This process will allow LG ELEC
users to monitor their success to identify number of opportunities won / lost.

8. Description of Functional Deficits


Capturing dates for each phase is not possible with standard functionality.

9. Approaches to Covering Functional Deficits


None

10. Notes on Further Improvements


None

11. System Configuration Considerations


Configuration Setting Possible Entries
Opportunity – Registration
Define Transaction types Opportunity – Leasing
Opportunity – Hospitality
Opportunity – General
Define sales cycles Company Registration
Customer Retention
Define Sales Phases As described in Process
Define sources of origin As described in Process
Define Milestones As described in Process
Define statuses Open
Inprocess
Won
Lost
Stopped by customer
Stopped by us
Prospect
Define Partner Functions Activity Partner
Person Responsible
Contact Person (Primary)
Contact Person (Secondary)
Legal Adviser

12. File Conversion Considerations


None

13. Integration Considerations


None

14. Interface Considerations


None

15. Reporting Considerations


1. List of companies at each sales phase
2. Opportunity Analysis to identify TOP 5 most valuable opportunities
3. Won/loss analysis

16. Authorization Considerations


Sales Manger & Sales Assistant Roles can be maintained, however final authorizations
can be considered during coming phases of project implementation.
BY MR. BABU (OASIS TECHNOLOGIES)
OOABAP (Object Oriented ABAP)

OBJECT: Object is a runtime instance of a class.

 It is a collection of attributes (or) components of a class.


 The ABAP statement ‘CREATEOBJECT’ is used to create an object

Syntax:

DATA:<ref_name> TYPE REF TO<class name>

CREATE OBJECT <ref_class>

Here <ref_class> is a runtime instance of a class.

CLASS : It is used to describe(or)define an object which can contain different


attributes(or)components such as types,data,methods,constants etc.,

Class are of two types,

1. Global class
2. Local class

1. Global Class:The global classes are maintained in the class pool.

 The global class and the attributes can be referred across the system
 The T-code SE24 is used to work with global class.

2. Local Class: The local class are defined and implemented in the same program.

Each class has two sections

 Definition section
 Implementation section

a)Classdefinition: This section is used to define (or) declare the different attributes such
as data objects, constants, methods etc.,

The ABAP statement ‘CLASS......DEFINATON’ is used to define the class.

Syntax:

*class definition section

CLASS<class_name>DEFINTION

*visibility section

PUBLIC CLASS
BY MR. BABU (OASIS TECHNOLOGIES)

DATA:<gv_var(10)> TYPE c,

METHODS:<method_name>,

ENDCLASS.

b) Class implementation : It is used to implement the method of a class

 The ABAP statement ‘CLASS.....IMPLEMENTATION’ is used to the method of a


class

Syntax:

*class implementation

CLASS<class_name> IMPLEMENTATION.

*implement method as a class

METHOD:<method_name>...

*get data.

SELECT

........................

ENDSELECT.

ENDMETHOD

ENDCLASS

Note:The ABAP statement ‘TABLES’ shouldn’t be used within the classes

 The internal tables must not be declared with header line (or) occurs in the class.
 The ABAP statement ‘LIKE’ cannot be used to define the data objects in the
classes
 The selection-screens of the report statementcannot be defined within the class.

TYPEREFTOstatement: this statement is used to define the different type of objects such as
classes, interfaces, BADI definitions etc.,

Syntax: DATA : <ref_obj> TYPE REF TO <class_name/imp_name.....> .


BY MR. BABU (OASIS TECHNOLOGIES)
Different Visibility Section:

Following are the different visibility section n OOABAP .

i. PUBLIC SECTION .
ii. PROTECTED SECTION .
iii. PRIVATE SECTION .

1. PUBLIC SECTION Attributes:


 Public section attributes can be accessed in the same class, subclasses and
external classes (anywhere).
 The ABAP statement ‘PUBLIC SECTION’ is used to define (or) declare the
public section attributes.
2. PROTECTED SECTIONAttributes :
 The attributes of a protected section can be accessed in the same class and
subclasses only.
 The protected section attributes cannot be accessed in the external classes .
 The ABAP statement ‘PROTECTED SECTION’ is used to define (or) declare the
protected section attributes
3. PRIVATE SECTION Attributes :
 The private section attributes can only be accessed in the same class.
 The private section attributes cannot be accessed in subclasses and external
classes.

The attributes of the class should be defined in the below order

 Public Section.
 Protected Section
 Private Section
VISIBILITY SECTION SAME SUBCLASS ANOTHER
CLASS EXTERNAL CLASS
Public section. YES YES YES

Protected section YES YES NO

Private section YES NO NO

Note: PRIVATE SECTION attributes can be accessed in friend classes.

Syntax: CLASS <cls_friend> DEFINITION FRIENDS <lcl_name>.

ENDCLASS.
BY MR. BABU (OASIS TECHNOLOGIES)

Different Types OfAttrbutes:

Following are the different types of attributes.

i. Instance Attributes
ii. Static Attributes

1. Instance Attributes:

 They are existed for each instance of a class.


 The instance attributes can be defined using normal ABAP statements such as DATA,
METHODS etc.,
 The reference of a class can only be used to access the instance attributes.
 The symbol instance connector “→” is used to access the instance attributes.

SYNTAX:

CLASS<class_name>DEFINITION.

* Visibility section

PUBLIC SECTION

* Define IntanceAttibuttes

DATA:<gv_var> TYPE <dataelement/....>,

.......................

PROTECTED SECTION.

* Dedine Instance Methods

METHODS: <METH_NAME> IMPORTING

EXPORTING

PRIVATE SECTION." with in the class only

DATA:........

..............

ENDCLASS.

* CLASS IMPLEMENTATION SECTION

...............
BY MR. BABU (OASIS TECHNOLOGIES)

START OF SELECTION

* Reference

DATA: <REF_CLASS> TYPE REF TO <CLASS_NAME>.

* CREATE OBJECT

CREATE OBJECT<REF_CLASS>.

*Access Instance Attributes

syntax:

CALL METHOD <REF_CLASS →<METH_NAME>.

2. Static Attributes :

 They are existed only once but can be used for any number of instances.
 The ABAP statement “CLASS --” is used to prefix to plain ABAP data declaration (or)
definitions statements to define static attributes.
 The class name should only be used to access the static attributes but not class
reference.
 The static attributes connector symbol (===>) is used to refer the static attributes.

syntax:

* Define static attributes

CLASS-DATA:<gv_static>....

CLASS-METHODS: <static_meth>....

* Access static attributes

CALL METHOD <class_name>==><static _meth>

Here <class_name> is class name.

METHOD:

 It is a collection of statements (process blocks).


 All the attributes of a class can be accessed in the methods.
 The methods can be compared with function modules.
 ABAP statements “METHODS (or) CLASS-METHODS “are used to define the methods.
 The ABAP statement "METHOD......END METHOD" is used to implement the methods
in an implementation of a class.
BY MR. BABU (OASIS TECHNOLOGIES)

syntax: Definition section


.................

PRIVATE SECTION/PUBLIC SECTION.


METHODS:<meth_name> IMPORTING<im_param>......,
EXPORTING<ex_param>......,
CHANGING<ch_param>......,
RETURNING<ref_param>....,
EXCEPTIONS<ex_param>....,
*Implementation section of a class.
.................

METHOD<meth_name>.
*Process Block
.
.
.
SELECT ..............
.
.
.
ENDMETHOD.

NOTE: The function method have only one return parameter without any importing and
exporting parameters.

CALL METHOD Statement:-

 This statement is used to call the methods of the class.

syntax:

CALL METHOD<class_name>----> (or) ===><meth_name>

IMPORTING<Im_param>...,

EXPORTING<Ex_param>...,

CONSTRUCTOR and CLASS_CONSTRUCTOR:

 They are the special methods and named as CONSTRUCTOR (Instance) and
CLASS_CONSRUCTOR (Static).
BY MR. BABU (OASIS TECHNOLOGIES)
 Constructors are called at run time automatically while creating an object.
 The constructors should be defined under PUBLIC SECTION only.
 The instance constructor can have only Importing and exceptions but not Exporting
parameters.
 The static constructor cannot have any Importing and Exception parameters.
syntax:
* Instance constructor
METHODS: CONSTRUCTOR IMPORTING......., .
*Static constructor
CLASS_CONSTRUCTOR,
.
.
.

EVENTS IN OOABAP:

 Event in OOABAP is used to raise the messages by an object.


 The ABAP statement " EVENTS" is used to define the events.
 The ABAP statements " RAISE" is used to raise an event.

SYNTAX:-

CLASS<class_name> DEFINITION.

EVENTS : ,event_name>.

ENDCLASS.

IF SY-SUBRC NE 0.

* Raise Event.

Raise<Event_name>.

.
BY MR. BABU (OASIS TECHNOLOGIES)
ENDIF.

Event Handler:

 It is used to call method of one class in another class to make use of same
functionality.
 The additional statement" FOR EVENT" is used to define the methods with event.
 The ABAP statement " SET HANDLER" is used to access attributes of event
handler.

SYNTAX:-

CLASS<cl_event_handler> DEFINITION.

PUBLIC SECTION.

METHODS<event_method> FOR EVENT <event_name> OF <class_name>.

ENDCLASS.

* IMPLEMENT <cl_event_handler>.

CLASA<cl_event_handler> IMPLEMENTATION.

METHOD<event_handler>.

*Bussiness logic

ENDMETHOD.

ENDCLASS.

*Call event handler methods

SET HANDLER <ref_event> ---><event_method> FOR <ref_class_name>.

TRY....CATCH...statements:
BY MR. BABU (OASIS TECHNOLOGIES)
 This statements are used to try the specified bussiness logic (or) methods and
catch the specified messages in case of fail.

SYNTAX:

TRY

CALL METHOD..............

CATCH <message>.

ENDTRY.

Properties OfOoabap:

Following are useful properties of OOABAP.


1. Abstraction.
2. Encapsulation.
3. Inheritation.
4. Polymorphism
5. Interface.

1.Abstraction:InOoabap Each And Everything Is Visualized As Objects Such Are

Class, objects,etc.

2.Encapsulation: This PropertyIs Used To Combine The Different Components Into A

Single unit (Binding) called class.

3.Inheritance:

 This property is used to adopt the properties of a parent class to the child classes
(subclasses).
 The ABAP statement “INHERITING FROM" is used to define the subclass by adopting
the properties of parent class.

Syntax to Define Subclasses:

CLASS<class_name> DEFINITION....

.
BY MR. BABU (OASIS TECHNOLOGIES)
.

ENDCLASS.

* Define Subclass using Inheritance

CLASS<sub_class> INHERTING FROM <class_name>

ENDCLASS.

NOTE: The final classes cannot be inherited.

The final method cannot be redefined.

Syntax To Define Final Class And Method:

CLASS<final_class> DEFINITION FINAL.

METHODS:<final_meth>.....FINAL.

NOTE: Private section attributes can be accessed in Friends class.

Syntax To Define Friends Classes:

CLASS<frind_class> DEFINITION FRIENDS<class_name>

ENDCLASS.

4.Polymorphism:

 Different behaviour of same method in different classes is called polymorphism.


 The ABAP statement “REDEFINITION " is used to redefine the methods (or) classes.

SYNTAX:
BY MR. BABU (OASIS TECHNOLOGIES)
* SUBCLASS

METHOD: <meth_name>............REDEFINITION.

5. Interfaces InOOABAP:

 They are the independent structures which can be used to extend the scope of the
classes
 The ABAP statement “INTERFACE" is used to define the interfaces.
 The interfaces do not have their own implementation sections.
 The ABAP statement “INTERFACES" is used to access the interfaces in a class.

NOTE:The interfaces must be specified under Public section of the class.

 The symbol "~ (tilt)" is used to refer the attributes of the interfaces.

Syntax:

*Define interfaces

INTERFACE<int_name>.

METHODS:<inter_meth>

ENDINTERFACE.

* Specify Interface

CLASS<class_name> DEFINITION.

PUBLIC SECTION.

INTERFACES:<int_name> "must be under public section.

ENDCLASS.

* Implement interface methods


BY MR. BABU (OASIS TECHNOLOGIES)
CLASS <class_name> IMPLEMENTATION.

METHOD<int_name> ~ <int_meth>.........

ENDMETHOD.

ENDCLASS.

Up Casting:

 It is also called "NARROW CAST".


 It is used to assign (or) copy instance of subclass into super class.

Eg:-<cl_superclass> =<cl_subclass>.

CALL METHOD <cl_superclass> ----><meth_redefine> ." calling from subclass

NOTE: It is not possible to access the sublcass own methods incase of upcasting.

Down Casting:

 It is also called " WIDENING CAST"


 It is used to assign (or)copy instance of superclass to subclass.
 The widening cast operator "?=" is used to assign (or) copy instance of superclass.

Eg: <cl_Psublcass> ?= <cl_superclass>.

NOTE:Incase of Down casting the subclass own methods can also be accesed.

 Create one new instance to access the attributes of a super class after up casting.
BY MR. BABU (OASIS TECHNOLOGIES)
GLOBAL CLASS:-

Steps to create a Global Class:-

 Execute the t-code "SE24".


 Enter the global class name.
 click on create button.
 Select a radio button interface to create the gobal interfaces.
 Click on yes button.
 Enter short description.

NOTE:

1. Use the button create inheritance to create the subclass by inherting the existing
super class.
2. The default class is final class.
3. Uncheck the checkbox "FINAL" to create normal global class.
4. In case of persistent class no need to create an object and the sysytem generates
the defaults class.
 Click on yes button.
 Enter the package name.
 Click on save button.
 Create the "TR" by pressing an icon create request.
 Define the required methods.

EG:

METHOD LEVEL VISIBILITY


Inst_meth Instance method Public
Static_meth Static method public

 Click on save icon.


 Place a cursor on method.
 Click on parameters button.
 Define the required parameters.

NOTE:-Follow the similar steps to define the parameters for any number of methods.

 Click on methods button.


 Double click on method name.
 Click on yes button.
 Click on signature button to display all the parameters of method.
 implement the required business logic within the system generated statements
 METHOD.......ENDMETHOD.
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: Attributes of same classcan be referred using self reference statement "me".

 Click on pretty printer button.


 Click on save button.
 Click on back.

NOTE:- Follow the similar steps to implement number as methods.

 Click on activate icon.


 Press enter.

STEPS TO CALL THE METHODS FROM THE GLOBAL CLASS (OR) INTERFACE:

 Once the program is in change mode.


 place the cursor where the method to be called from the gobal class(or)interface
 Click on pattern button.
 Select the radio button ABAP OBJECT pattern.
 Click on yes button.
 Enter class (or) interface (or) instance name.
 Enter (OR) Select the required method.
 Click on yes.
 Uncomment the required parameters and pass the data variables from the calling
program.
 Create the self reference statement "me" with the reference object name.

EG:

DATA:<cl_ref> TYPE REF TO <global_class>.

CREATE OBJECt<cl_ref>.

*Call method ME ---->

CALL METHOD <cl_ref> ------><inst_meth>


BY MR. BABU (OASIS TECHNOLOGIES)
NOTE:

 The data types of the method parameters and data types by passing parameters
variables should be similar. Otherwise program goes to short dump.

USES OF OOABAP:-

 Better programming structure.


 Abstraction and Encapsulation.
 Polymorphism and Inheritance.
 Stress on data security and data acess.

DIFFERENCE BETWEEN LOCAL AND GLOBAL CLASS

LOCAL CLASS GLOBAL CLASS

Local classes can be accessed within It can be accessed across the


the same program. system.

It can be started with any letter. It should start with Z*/Y* in case of
custom.
It can be defined and implemented It must be defined and
in any source code. implemented using t-code se24.

OOALV (Object Oriented ALV) REPORTS

1. The system provided standard classes which start with "CL_GUI" are used in OOALV
reports.

EG:

CL_GUL_ALV* --- " Display data in Alv Custom control.

CL_GUL_CUSTOM*/DOCKING.............

2. The system provided standard table types and structures with start with "LVC*" are
used for different types which can be used for OOALV reports.

NOTE:

 The standard type group "SLIS" is used in case normal ALV reports.

3. The custom control in screen painter to be created to display the data in OOALV
reports.
BY MR. BABU (OASIS TECHNOLOGIES)
SOME OF THE USEFULL STANDARD CLASSES TO DISPLAY AND FORMAT:-

 CL_GUL_ALV_GRID:- It is used to work with ALV GRID formats in OOALV.


 CL_GUL_ALV_TREE:- This standard class and corresponding methods are used to
work with ALV tree control (OR) tree structure.

NOTE:

 In the real time the standard system provided class "CL_GUL_ALV_GRID" is mostly
used to work with grid format.

SOME OF THE USEFUL METHODS OF ALV CLASSES:-

 DOUBLE_CLICK:- This event handler method is used to provide the double click
functionality in OOALV reports.
 HOTSPOT_CLICK:-This event method is used to provide double click functionality
based on the hand symbol click.
 TOP_OF_PAGE:-It is used to populate and display header data in OOALV reports.
 MENU_BUTTON: It is used to call the menu status to define the pushbuttons in
OOALV.
 USER_COMMAND:- It is used to provide an interactive functionality based on the
performed active.
 SET_TABLE_FOR_FIRST_DISPLAY: This method is used to display the final data in grid
format.

NOTE: It can be compared with the function module "REUSE _ALV_GRID_DISPLAY".

DIFFERENT TYPES OF CONTAINERS:

Following are different types of containers

1. Custom container: It is the normal container to display single output on custom


container.
 The standard class " CL_GUI_CUSTOM_CONTAINER" is used to work with
custom container to display the data.
2. Docking container: It is used to display the data on custom controlled at any position
either left (or) right.
 The standard class “CL_GUI_DOCKING_CONTAINER" is used to work with
custom container to display the data.

3. Splitting container: It is used to split the container into different parts to display the
multiple grids in OOALV.
 I t is not possible to display the data in any position (Docking) in normal ALV
reports.
 It is not possible to display multiple grids in normal ALV reports
BY MR. BABU (OASIS TECHNOLOGIES)
 The standard class “CL_GUI_SPLITER_CONTAINER" OR
"CL_GUI_EASY_SPLITER_CONTAINER". Is used to work with Splitter Container.

SOME OF THE USEFULL TABLE TYPES AND STRUCTURES ON OOALVS

1.LVC_T_FCAT: This table type can be used for filed catalogue for OOALV.

NOTE: It can be compared with the type “SLIS_T_FILEDCAT_ALV" .

2.LVC_S_LAYO: This standard structure is used to populate the layout in OOALV.

NOTE: It can be compared with the type SLIS_LAYOUT_ALV of the type group SLIS in
normal ALV.

3.LVC_T_EVTS: This table type is used to populate different events in OOALV.

STEPS TO CREATE A CUSTOM CONTROL:-

 Once the program is in change mode.


 Write the statement call screen followed by the screen number.
 Double click on the screen number.
 Click on yes.
 Press enter.
 Enter short description
 Click on Layout button.
 Click on custom control.
 Place it on the screen
 Expand the screen size as much as possible
Button Screen

EXECUTE

Input/output field

Custom Control
BY MR. BABU (OASIS TECHNOLOGIES)

 Enter the custom control name.


 Click on activate
 Press enter
 Click on flow logic.
 Specify and design the required PBO & PAO modules etc.,
 Activate the screen and click on back.
 The method ‘free container’ is used to refresh the container data

NOTE : The static method ‘DOC_AT_LEFT’ of the standard class

‘ CL_GUI_DOCKING_CONTAINER’ is used to position the custom control at left


hand side .

The static method ‘DOC_ATRIGHT’ of the standard class


‘CL_GUI_DOCKING_CONTAINER’ is used to position the custom control at left
right side.

The reference object of a docking container must be passed to export


parameters as a grid object

Ex:

*create a grid instance

CREATE OBJECT<rf_grid>

EXPORTNG

i_parent =rf_dock_container “ CL_GUI_ALV_GRID

NOTE: the static method ‘ORIENTATION_VERTICAL’ is a standard class used to


split the custom container in vertical.

The static method ‘ORIENTATION_HORIZONTAL’ is a standard class used to split


the custom container in horizontal.

SYNTAX:

CREATE OBJECT<rf_split>

EXPORTING

PARENT = <rf_split>bottom_right_container

ORIENTATION = CL_GUI_EASY_SPLTTER_CONTAINER →
ORIENTATION_HORIZONTAL/ ORIENTATION_VERTICAL.
BY MR. BABU (OASIS TECHNOLOGIES)
NOTE: the instance method ‘TOP_LEFT_CONTAINER’
‘BOTTOM_RIGHT_CONTAINER’ as the splitter class
‘CL_GUI_SPILTTER_CONTAINER’ to be passed to an export parameter I_PARENT
as the split class.

SYNTAX:

Gird at top splitter

CREATE OBJECT<rf_grid>

EXPORTING

I_parent =<rf_split> => ‘TOP_LEFT_CONTAINER/BOTTOM_RIGHT_CONTAINER.

CREATE DYNAMIC TABLE OF A CLASS CL_ALV_TABLE_CREATE:

 This method is used to generate dynamic internal table based on the fields
populated in a filed catalogue of the type "LVC_T_FCAT".

STEPS TONPOPULATE THE DYNAMIC INTERNAL TABLE AND DATA

 Declare (or) define filed catalogue of the type " LVC_T_FACT".


 Declare (or) define the field symbol line and standard table

Eg:

DATA:<gt_dyn_tab> TYPE LVC_T_FACT,

<gs_dyn_fcat> LIKE LINE OF<gt_dyn_fcat>.

*field symbols.

FILED-SYMBOLS: <<gs_line>>,

<<gs_dyn_table>> TYPE Standard table,

 Populte filed catalog with fixed and dynamic fileds by setting a loop.

Fixed coloumns.

<gs_dyn_fcat>-col_pos = '1".

<gs_dyn_fcat>-datatype/int type = '<char/....>'.

<gs_dyn_fcat>-itun = '< 10/20/30....>'.

.
BY MR. BABU (OASIS TECHNOLOGIES)
APPEND <<gs_dyn_fcat> to <gt_dyn_fcat>.

*dynamic coulmns

LOOP AT <gt_data> into <gs_data>,

<gs_dyn_fact>-filedname= <gs_data-filed>.

APPEND <g_dyn_fcat> TO<gs_dyn_fcat>.

ENDLOOP.

 Use static method "CREATE _DYNAMIC_TABLE” as the .class "


CL_ALV_TABLE_CREATE" to generate an internal table using the populated filed
catalogue.

EG:

CALL METHOD C_ALV_TABKE_CRETE ===>crete _dynamic_table

EXPORTING

it_fieldcatalog = <gt_dyn_fcat>" dynamic filed catalog.

IMPORTING

cp_tabe = <it_table>“of the type ref to data.

ASSIGN <it_table> --><<gfs_dyn_table>>

CREATE data is line_n Like line of gfs_dyn_table

AASIGN is_line_n ---> to gfs_line.

 The data can be populated int dynamic internal table as below

Eg:

ASSIGHN Component <filedname.OF structure <<gfs_lines>> TO <<gfs_temp>>.

<<gfs_tmp>> = "profit".

APPEND <<gfs_line>> to<<gfs_gyn_table>>.


BY MR. BABU (OASIS TECHNOLOGIES)
I.Land scape
 Land scape is an arrangement of the systems.
 In the real time each project will have mostly 3 system landscape.
1. Development system
2. Quality system
3. Production system

They can be arranged as below:

Note: The sandbox system or client is optional. That means it may or may not be there in the project

Land scape.

Note: The learning system (ides) is not part of real time system land scape.

Development system:

 It is used to develop objects, change existing objects and maintain configuration changes.
 It can also be used to perform unit test or self-test, release the objects and functional configuration.
 This system contains at least 2 clients and an optional sand box client.
 The system id and client numbers could be different from project to project.

System id Client Description


200/100/-------- Development client
BY MR. BABU (OASIS TECHNOLOGIES)
R3D/DEV/---------
220/120/-------- Unit test client
Development client:

 It is used to develop objects, change existing objects and maintain configuration changes.

Unit test client:

 It is used to perform unit test or self-test for preparing unit test documents (utd).

Note:

1. Objects, changes, configurations are released from development client only.

2. Consultants are authorized to make the changes in development client only.


3. Standard transaction code ‘SCC1’ is used to import client dependent changes such as table or

Maintenance view entries, script form changes etc.

Note: The custom table or maintenance view with the delivery class ‘A-Application table’ can be

Maintained directly in any client and system.

Quality system:

 It is an environment where all the developments, changes and configurations are tested without any
errors by the consultants, testing team and by the customers or end users.
 The system ids and client numbers will be different in each project.
 This system contains a single client number.

System id Client number


R3Q/ QAS/--------- 300/400/-------------

Production system:

 It is an environment where the customers or end users maintain live data or original data.
 It also called live system.
 The system contains a single client.
 The system id and the client numbers are different in each project.
Note:

1. The consultants are not authorized to execute any transaction codes unless the authorizations are
given in between special cases and unless the project is production support project.
2. In some of the projects there may be pre-production system (optional).
BY MR. BABU (OASIS TECHNOLOGIES)
3. The developments, changes and configurations are released from one system to another
system (Development  Quality Production) by releasing corresponding transport request (TR)
using Transport organizer or correction and transport system (CTS).

Sand box system:

 It is an environment to develop the objects, make the changes and maintain configurations at initial
stages of the projects.
 All the consultants are authorized for any transaction code in this system.
 This system is an optional system.
Note: In most of the projects 3rd party security gateway tools either VPN or CITRIX is used to connect the

Above Project System.

Different Objects:

Objects are mainly categorized into 2

i. Local objects
ii. Transportable objects

Local objects:

 They are the objects saved by pressing ‘local object’ button.


 All the local objects are saved under the temporary package $TMP.
 The system does not generate any transport request (TR) for the local objects.
 The local objects cannot be released from one system to another system.

Note: Create local objects for practice or R&D in case of the project land scape does not have sandbox system.

Transportable objects:

 Transportable objects must be saved under the required package.


 The system generates the unique T.R number while saving the objects under the package.
 The transportable objects can be released from one system to another system.

Package:
 It is a collection of transportable objects.
 The package must be used to save all the transportable objects and generate TR.
BY MR. BABU (OASIS TECHNOLOGIES)
ii. Correction and transportation system (or) transport organizer:
 This tool is used to record the changes made in the system.
 It can also be used to release or maintain the transport request.
 T-codes: SE09/ SE10/ SE01 are used to work with transport organizer.

Note: 1. T-code SE03 is used to find TR of objects

2. T-code STMS is used to Import TRs

Transport Request-TR:
 It is the unique number generated by a system for all transportable objects and Configurations.
 The transport requests are generated in development client only then release them from development
client.
 Transport request number starts with development system id followed by K-series number.

Ex: <R3D>K9<*****>

Here R3D is development system id.

Following are different transport requests

i. Workbench
ii. Customizing
iii. Transport of copies
iv. Relocations

Workbench request:

 They are used to record the changes or workbench objects such as DDIC objects, programs, function
modules etc. and release them from one system to another system.

Customizing request:

 They are used to record and release the customization or configuration changes in the system.

Transport of copies:

 They are used to transport the sub objects of the main object from one system to another system.

Relocations:

 They are used to change the objects from one package to another package.

Note: 1.In the real time the technical consultants mostly work with work bench requests and rarely work

With customizing requests.


BY MR. BABU (OASIS TECHNOLOGIES)
2. The functional consultants mostly work with customizing request and rarely work with work bench.

Steps to generate the transport request (TR)

 Enter the package name at the time of saving with objects.

Ex: ZDEV/ZSD/ZMM….

Note: The objects are saved as local objects under the temporary package $TMP in case of the button

Local object is pressed.

 Click on save icon.


 Click on create request icon.
 Enter short description as per the project standards.

Ex: < CR547895 – Sales Report>

CR/CHG/..-Change Request number.

Note: Specify the project code if required.

 Click on save icon.

Note: The system generated TR number which starts with the development system id followed by

K-Series number.

Ex: R3DK900028.

Note: The button own requests is used to make use of the existing transport request numbers.

 Click on yes.

Steps to release transport request number (TR):

 Execute T-code SE09/SE10/SE01.

Note: By default the login user name is appeared in user field.

 Check the all check boxes


o Customizing requests
o Workbench requests
o Modifiable
o Released
 Click on display button.
 Expand the required transport request number under modifiable status.
 Place your cursor on the task number
BY MR. BABU (OASIS TECHNOLOGIES)
 Click on release directly or F9.

Note:

1. The objects under the TR must be activated before the transport requests are released.

2. The tick marks are appeared beside the task numbers once they are released.
3. Place a cursor on the TR number after all the corresponding tasks are released.
 Click on release directly icon.

Note: 1. one tick mark is appeared beside the released transport request.

2. The released TRs are moved from modifiable status into released status.

Steps to delete transport request or object from TR:


 Execution the transaction code SE09/SE10/SE01.
 Click on display button.
 Expand the required TR under modifiable status.
 Expand the corresponding task number right click on object name click on delete  click on yes
button click on yes button.

Note: follow the similar steps to remove any number of objects from the task or TR.

 Place the cursor on the task number after all the corresponding objects are deleted.
 Click on delete and click on yes button.
 Place the cursor on tr after all the corresponding tasks are deleted.
 Click on delete icon  click on yes button.
Steps to change short description of TR:
Once the transport requests are displayed in transport organizer.

 Double click on the required TR  click on properties tab.


 Click on display/change
 Change short descriptions as per the project standards click on save and back.
Steps to change the package name of an object:
 Execute the required transaction code (ex: SE38, SE11,……….).
 Click on ‘Goto’ from menu
 Click on ‘object directory entry’
 Click on display or change icon
 Change the package number.
BY MR. BABU (OASIS TECHNOLOGIES)
Ex: $TMP ZPACK

 Click on save icon.


 Create the TR by pressing create request
 Click on tick (yes).

Steps to change the owner ship of TR:


 Execute the transaction code SE09/SE10/SE01.
 Enter the required user name

Ex: BABU [up to 12 characters].

 Click on display button.


 Expand the required TR under modifiable status.
 Place a cursor on the task number click on change owner icon (F5).

Ex: previous user : BABU

Current user : OASIS

 Click on tick mark.


 Right click on the TR
 Click on the change owner
 Click on tick mark (YES).

Note:

1. The transport request is moved from the previous owner into new owner list.
2. Change the previous owner in initial screen of transport organizer (SE09) into new user name then
release the tasks and transport requests.
3. The system proposes new task number in case of the TR is already created by another user on same
subject.
4. The system proposes new TR to make the changes in the objects in case of the existing TR is
released to quality system.
5. Multiple TR can be merged using the function ctrl+F12 by right clicking on corresponding TR.
Steps to import client dependent changes into unit test client:
 Execute T-code ‘SCC1’ in unit test client.
 Enter the required transport request number from which the client dependent changes to be imported.

Note: Make sure that source client number 100 is displayed.

 Check the check box including request subtasks.


BY MR. BABU (OASIS TECHNOLOGIES)
 Click on the button start immediately
 Click on yes.

Note:

1. The script form changes the table entries, maintenance views entries, standard test etc must be
imported into unit test client to perform self-test and prepare unit test document.
2. In case of the custom tables or maintenance views with delivery class ‘a’ can be maintained in the
unit test client, quality system and production system directly.

iii Different types of Projects and process


Following all different types of projects:-
1. Implementation.
2. up gradation.
3. Support & Maintenance.
4. Roll Out.
Implementation: - In case of Implementation project customers or clients they will go for SAP software newly
Since they might be used in different software.
Ex : - MS Office / JAVA / VB /_ _ _  SAP.

Up gradation: - In case of this project customers or clients will go for new versions of SAP since they might be
Using older versions.
Ex: - SAP 4.6 / SAP 4.7 /SAP ECC 5.0 /  SAP ECC 6.0.
Note: - The T-codes “SPDD & SPAU” are used to compare 2 different versions in up gradation project.
Note: - Any one of the tools such as ‘PANAYA’ or ‘SAP SOLMAN’ is used in up gradation project.
Support & Maintenance: - The customers or end users need support in their day to day issues.
In this kind of projects the consultants provides support to resolve the issues of the
Customers.
Note:- In support cum maintenance projects Tickets or Change requests are resolved as per SLA.
SLA: - Service Layer Agreements

Priority Response Resolve


P1-High 2hours 4hours
P2-Medium 4hours 8 – 16 hours
P3-Low 8hours More than 16hours

Note: - The highest priority tickets ‘P1’ are mostly related to functionality and servers but not ABAP changes.

Roll Out: - In this kind of projects the existing SAP implemented business process will be extended into another
country or company code or plant.
BY MR. BABU (OASIS TECHNOLOGIES)
Phases in SDLC (Software Development Life Cycle) : -

A. Waterfall methodology: -
• It is also called sequential methodology.
• In this methodology phase by phase is performed.
• It is not possible to go back previous phase unless the testing is done.
• Process starts with the below phases in the same order

B. Agile Methodology: -
• In case of this methodology the customers can change their requirements without impacting timelines.
• It is more flexible to prioritize requirements
• It is better interactive methodology
BY MR. BABU (OASIS TECHNOLOGIES)
Different methodologies in SAP streamlined projects : -
Following are different methodologies used for SAP streamlined projects such as
Implementation & Up gradation.
1. ASAP Methodology.
2. Scrum Agile Methodology.

ASAP Methodology : - ASAP stands for “Accelerated SAP Methodology”. It is the SAP provided standard
Methodology to implement or upgrade SAP projects.

Following are the different phases in ASAP methodology: -


BY MR. BABU (OASIS TECHNOLOGIES)

Projection preparation: - In this phase below activities are done.


• Documentation of the current business process.
• System landscape.
• Identify & Recruit resources.
Business blue prints: - In this phase the below activities are performed.
• All the Configurations, Customizations, Developments, Enhancements Are Identified.
• The business process documents with the proposed solutions are prepared.
• Fit gap analysis is done
Realization: - In this phase below activities are performed.
• Prepare functional specifications for configurations & developments are separately.
• Technical specifications are prepared
• All the configuration and customization work is done.
• All developments & enhancements are done.
• The different types of testing such as self-testing (UTP) User Acceptance Testing (UAT).

Note: - The technical consultants are mostly involved in this phase.

Final preparation: - In this phase below activities are performed.


• All the final documentation work and test scripts are prepared
• User training on different applications is provided.

Note: - Functional consultants will provide the application training to customers or end users.
BY MR. BABU (OASIS TECHNOLOGIES)
Go live & Support: - In this phase below activities are performed.
• Hand over the implemented business process in SAP.
• Release all the configurations, customization, developments & enhancements.
• Provide the limited post-production support.

Run: - The implemented business process is shown by running it in the live system.

Scrum Agile: -
• In this methodology the customers or end users are also part of each phase of the project.
• The customers may change the requirement while implementing also.
• Following phases are involved in scrum agile.

Sprint planning: -

In this phase the task or work is assigned for 2 weeks or one month based on the resources availability.

Note : -
• Resources availability will be considered 65% to 70% during sprint planning .

Ex : - 9 * 6.5 = 58.5 hours.


• The actual productive hours for team leads and above are considered 50% to 55% of their total
Availability.
Daily standup calls: -
 The standup calls are conducted daily to know the progress on the configurations, customizations, changes
and developments and to know the problems or issues.
 The daily standup calls are conducted by “Scrum Master” at onsite or off site.

Sprint Retrospective: - In this phase each resource is asked for their comments.
BY MR. BABU (OASIS TECHNOLOGIES)
• What went wrong or good?
• What are the improvements?

Demo: - Applications and developments are shown to the customers.

Note: - This methodology can be used for both implementation & support or Manianence projects.

Steps involved in getting & delivery work in projects:-

The below steps are involved in getting & delivery the objects.
BY MR. BABU (OASIS TECHNOLOGIES)

Roles & Responsibilities of Technical Consultants : -

• Analyze functional specifications or functional designs.


• Give proper estimations to complete the objects or developments.
• Interact with a functional consultant or onsite coordinators for clarifications to get the requirement
Finalized.
• Prepare technical specifications or technical designs.
• Develop the objects as per the project programing standards.
• Perform self-test and prepare ‘Unit Test Documents’.
• Perform code reviews or peer check & performance tuning.
• Release the objects.
Additionally: - Support or Mentor newly joined junior technical consultants.
Give knowledge sharing sessions to the team.

Steps involved in getting offer letter: -

Below steps or rounds are involved to get offer letter.

Screening interview to know your interest.

Technical Discussion or Interview

Project manager round / technical interview

Client interview (Optional)

Note: - client interview may be happened to get the project once we join in the company.

H.R interview for salary details

Offer letter
BY MR. BABU (OASIS TECHNOLOGIES)

Note: Complete below task immediate after you get into company.

o Upload resume in company format in their job portals (In case of Permanent )
o Declare Investments in their tools to save Income tax (In case of Permanent)
o Put hours (9 hours a day) against the given charge code or WBS (Work Breakdown Structure)
of the Project.

Note: - Each client or project is assigned to one unique charge code from which the chargeability or billing will

Be collected.

Tools & Communications methods in the company: -

Microsoft outlook: - It is used to communicate with the company people.

Note: One unique mail-id is given with the combination of our name.

Ex : - <your_name>@company.com

Microsoft communicator: -

It is used to communicate the company people voice calls, video calls, screen sharing.

Complete tax declarations in the given tool.

Steps involved in projects: -

Once the project is assigned the below steps are performed.

• Knowledge transfer (K.T) is given to understand the system landscape, tools, programming standards,
release process and etc.
Note: - Some of the K.T documents such as programming standards etc. are provided during K.T.

• The logon credentials such as user name, initial password different tools and SAP system are provided.
Project  M.S Outlook / M.S Communicator – client people.

K.T  Knowledge transfer – 5 to 10 days.

Logon  Credentials – Citrix / VPN, SAP, -----

Work-> F.S/F.D
BY MR. BABU (OASIS TECHNOLOGIES)
Some of useful tools in the projects: -

System Access: - The below third party security gateway tools are used to connect into client desktop or

SAP systems.

1. Citrix: - It is used to connect into client system desktop.

Your Desktop

Citrix

Client Desktop

SAP

PW

2 . VPN or Cisco VPN: - It is used to connect into client SAP systems.

SAP

Connect to VPN

SAP Logon Credentials

SAP

Note: - VPN (Virtual Private Network) : -

Tools for ticket handling: - Any one of below tools are used in support and maintenance project to maintain

Change request or tickets.


BY MR. BABU (OASIS TECHNOLOGIES)
 Remedy.
 SAP IMS (Incident Management System).
 Lotus Notes – IBM.
 SMS – Accenture.

Note: - The data migration tool ‘Panaya’ is used for migration projects.

Tools for document maintain: - Any one of the following tools.

 Share Point.
 Document Explorer.
 TFS - .Net.

Note: - The task or work is assigned through mails (M.S Outlook) by team lead or Functional Consultant.

iv Performance tools
Perform before the objects are given for code review or before the

Objects are released.

1. Extended program check (SLIN).

2. Code Inspecter (SCI).

3. Runtime Analysis (SE30).

4. SQL Tracer (ST05).

Extended program check (SLIN).

 This tool is used to list out the errors, warnings, messages in the programs or source code and rectify them.
 The T-code “SLIN” or the menu path.
Program -> Check -> Extended program check is used to work with this tool.

Steps to perform extended program check: -

 Execute the T-code “SLIN” or through menu path.


 Enter the required program.
Ex: - ZALV_REPORTS.
 Check the check of ‘Character String’.
 Click on ‘F8’ icon.
Note: - All the corresponding errors, warnings, messages are listed.
BY MR. BABU (OASIS TECHNOLOGIES)
Rectify errors & Warnings: -

 Double click on No of errors or warnings.


 Read & understand the system given messages.
 Double click on the row number or message tin.
 Click on display or change icon.
 Rectify the errors or warnings.
 Activate the program or source code.
 Click on ‘Back’ icon.
Note: - Follow the similar steps to rectify any No of errors or warnings.
Note: - Use the system given hidden code to hide errors & warnings in case of not possible to rectify errors &
Warnings.
Ex: - WRITE: ‘<TEXT>’. “#EC NEEDED.
Note: Try to deliver error free or warning free objects as much as possible.
 Perform the tool again to refresh the list.

Code inspector: -
 This tool is used to perform the different types of checks such as Security checks, performance checks &
Syntax checks.
 It can also be used to perform different checks for all the objects under one T.R.
 The T-code “SCI” or Menu path.
Program -> check -> code inspector is used to work with tool.
Steps to perform with this tool : -
 Enter the required program name in ‘SE38’.
 Click on program menu item -> Check -> Code inspector.
 Expand appropriate checks such as Syntax checks or performance checks or Security checks.
 Read & understand the system given messages rectify them.

Rectify the errors & warnings: -

 Double click on the system given message or row number.


 Click on display or change icon.
 Rectify errors or warnings.
 Activate program or source code.
 Click on back icon.
Note: - Follow the similar steps to rectify the any No of errors or warnings of different checks.
 Perform code inspector tool to refresh the list.
Steps to perform Code inspector using T.R : -
 Execute the T-code “SCI”.
 Click on create icon under ‘Inspection Block’.
 Select a radio button request / Task .
 Enter requires TR .
BY MR. BABU (OASIS TECHNOLOGIES)
Ex: - R3DK90002
 Checks the required checks to be perform.
 Click on execute icon.
 Expand the required checks such as syntax checks, performance checks and security checks.
 Read & understand the system given messages then rectify them.
Runtime Analysis: -
 This tool is used to know Execution time or Runtime of the program or T-code.
 It can also be used to know performance tips & tricks.
 The T-code “SE30” or Menu Path.
System -> Utilities -> Runtime Analysis is used to perform this tool.
Steps to perform Runtime Analysis: -
 Execute T-code “SE30”.
 Enter program or T-code or Function Module.
 Click on execute button.
 Fill the required fields.
 Click on execute icon.
 Click on ‘back’.
 Click on “Evaluate” button in Runtime Analysis screen.
Note: - Try to make execution time or load on database in green as much as possible.
Note:- Analyze the statement which are consuming more time in case of database load in ‘Red color’.

Analysis: -
 Click on ‘Hit List’ icon.
 Place a cursor on ‘NET’ column.
 Click on an icon sorting descending order.
 Place a cursor on a required statement or called which is consuming more time in our program.
 Click on ‘Display or Source code’ icon.
 Make the necessary changes to improve the performance of the program by using the performance tips.
 Activate the program or source code.
 Click on ‘back’ icon.
Note: - Follow the similar steps for any No of statements or calls which are related to our standards.
Note: - Perform Runtime Analysis too again to refresh the list by deleting existing Runtime.
Steps to know performance tips & tricks in SE30: -
 Execute T-code SE30.
 Click on the button “Tips & Tricks”.
 Expand the required performance Tips.
Ex: - SELECT vs SELECT LIST.
 Double click on performance example.
 Go through the system given documentation to know which statement is advisable.
 Click on the ‘Measure Runtime’ button to check the Runtime different.
SQL Tracer : -
BY MR. BABU (OASIS TECHNOLOGIES)
 This tool is used to know the indexes either primary or secondary which are consider while extracting the
data.
 The T-code “ST05” or menu path
System -> Utilities -> Performance trace is used to work with this tool.
Steps to perform SQL Tracer : -
 Execute the T-code “ST05”.
 Click on ‘Activate Trace’ button.
 Execute the required T-code or program in another new session.
 Perform the required action such as save data or execute button.
 Open SQL tracer session.
 Click on the ‘Deactivate Trace’ button.
 Click on ‘Yes’ button.
Note: - Use an icon ‘Find’ to find the tables which are related to particular field.
 Click on ‘Find’ icon.
 Enter the required table or field name press ‘Enter’ button.
 Click on any one of open cursor statement.
Ex: - MARA_OPEN.
 Click on ‘Explain’ button.
 Click on the considered index.
Ex : - <dbtab>~o  Primary index
<dbtab>~zin Secondary index.
 Click on ‘Analyze’ button.
 Click on ‘Execute’ button.
Note: - Make sure index analysis is in green.

v. Performance tips
a. Data extraction point of view:

SELECT * vs SELECT fields:


 The SELECT * is not advisable since it extracts all fields including unwanted fields.
 Use SELECT followed by the required fields in the similar order of the data base tables or data base
views.

Ex: * Not Advisable

SELECT *………………..

* Advisable

SELECT <f1>
BY MR. BABU (OASIS TECHNOLOGIES)
<f2>

<f3>-------- “same order of DB table or View

Normal search vs pointer search (or)

SELECT ------- ENDSELECT vs SELECT ------ INTO TABLE:


 The SELECT----ENDSELECT (normal search) is strictly not advisable since it hits the database tables
or views for each record.
 Use INTO TABLE statement (pointer search) to extract all the required data into an internal table in
single step.

Ex: *Not advisable:

SELECT <f1>

<f2>

FROM <dbtab>

INTO <gs_dbtab>

WHERE <condition>

*Append data

APPEND <gs_dbtab> TO <gt_dbtab>.

ENDSELECT.

*Advisable.

SELECT <f1>

<f2>

FROM <dbtab>

INTO TABLE <gt_dbtab>


WHERE <condition> AND ---

Note:

1. Nested SELECT statements (SELECT…..SELECT….ENDSELECT….ENDSELECT) are not


advisable.
2. INTO CORRESPONDING FIELDS OF is not advisable while extracting data.
BY MR. BABU (OASIS TECHNOLOGIES)
Key fields in WHERE Conditions:

Use key fields as many as much as possible in indexes order in WHERE conditions for better performance.

INNER JOIN vs FOR ALL ENTRIES:


 Up to 2 tables can be joined then use FOR ALL ENTRIES while extracting the data from the next
required tables.

Note:

1. The base internal table must be check whether it has data before it is used in for all entries.
2. All the records from the database table or database view are extracted incase of base internal table
in for all entries is empty and not check.
3. FOR ALL ENTRIES with INNER JOINS are advisable since FOR ALL ENTRIES are another extra
filter criteria as like select options

Ex: *up to 2 tables can be joined

SELECT <a~f1>

<a~f2>

<b~i1>

<b~i2>

INTO TABLE <gt_dbtab1_dbtab2>

FROM <dbtab1> AS <a>

INNER JOIN <dbtab2> AS <b>

ON <a~f1> = <b~f1> AND …

WHERE <condition> AND…..

IF <gt_dbtab1_dbtab2 []> IS NOT INITIAL.

SELECT <j1>

<j2> ------

FROM <dbtab3>

INTO TABLE <gt_dbtab3>

FOR ALL ENTRIES IN <gt_dbtab1_dbtab2>


BY MR. BABU (OASIS TECHNOLOGIES)
WHERE <i1> = <gt_dbtab1_dbtab2-f1> AND…

SELECT SINGLE vs SELECT…. UP TO 1 ROWS:


 Use SELECT SINGLE to extract single record in case of all the key fields can be considered.
 Prefer UP TO 1 ROWS in case of not possible to use all the key fields.

Ex:

*advisable in case of all key fields

SELECT SINGLE <f1>


INTO <gv_var >
FROM <dbtab>
WHERE <condition>--------
*Advisable in case of not possible to consider all key fields.

SELECT <f1>

INTO <gv_var>

FROM <dbtab>

UPTO 1 ROWS

WHERE <condition> AND …..

ENDSELECT.

Select statement with in the loop.

 Select statements within the LOOPs are not advisable.


 Use FOR ALL ENTRIES outside of LOOP statements then use READ TABLE statement with in
LOOP statements.

Ex:
* Not advisable.
LOOP AT <gt_base> INTO <gs_base>

SELECT-------

ENDLOOP.

*Advisable.

IF <gt_base[]> IS NOT INITIAL.


BY MR. BABU (OASIS TECHNOLOGIES)
SELECT <f1>

<f2>

FROM <dbtab>

INTO TABLE <gt_dbtab>

FOR ALL ENTRIES IN <gt_base>

WHERE <f1> = <gt_base_f1> AND---

ENDIF.

LOOP AT <gt_base> INTO <gs_base>

READ TABLE <gt_dbtab>----

IF sy-subrc EQ 0.

MOVE -----

ENDIF.

ENDLOOP.

Note:

1. Use as many number of key fields as possible in where condition for better performance.
2. Avoid using negative where conditions while extracting data.
3. Avoid using aggregate functions such as MAX, MIN, AVG while extracting data.

b.Data process point of view


Delete adjacent duplicate statement or deletion of duplicate records.

 Delete duplicate records from an internal table in case of not possible to use all the key fields in where
condition while extracting the data.

Note: Internal tables must be sorted before delete adjacent duplicates statement is used.

Ex: SORT <gt_dbtab> BY <f1>--------

DELETE ADJACENT DUPLICATES FROM <gt_dbtab> COMPARING <f1>…..

READ TABLE statement or access internal tables:


 Prefer BINARY SEARCH addition with READ TABLE statement for faster access.
BY MR. BABU (OASIS TECHNOLOGIES)
Note:
b. Internal tables must be sorted in ascending order before binary search addition is used.
c. Addition BINARY SEARCH does not work in case of an internal table is sorted in descending order.
Ex: SORT <gt_dbtab1> BY <f1>--- “ Must be in ascending Order
LOOP AT <gt_dbtab> INTO <gs_dbtab>.
*Read internal tables
READ TABLE <gt_dbtab1> INTO <gs_dbtab1>
WITH KEY <f1> = <gs_dbtab-f1> BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE: <gs_dbtab1-i1> TO <gs_final-i1>…..
ENDIF.
ENDLOOP.

Nested loop vs parallel cursor method:


 Prefer parallel cursor method in case of nested loops is required.

Steps to work with parallel cursor method:

 Read second internal table to get index of current record within the loop of base internal table.
 Set a loop to second internal table (item table) to process the data from the set index
 Come out of the second loop for the unmatched records.

Ex: <gt_item>

F1 F2 F3
1 10 A
1 20 B
2 10 P
2 20 Q
LOOP AT <GT_BASE> INTO <GS_BASE>

*2nd loop process.

*Not advisable.
BY MR. BABU (OASIS TECHNOLOGIES)
*LOOP AT <GT_ITEM> INTO <GS_ITEM> WHERE ---------

*Advisable parallel cursor method.

READ TABLE <GT_ITEM> INTO <GS_ITEM> WITH KEY <F1> = <GS_BASE-F1>.

IF SY-SUBRC EQ 0.

*get index of current record

<lv_index> = sy-tabix.

*process 2nd loop from set index.

LOOP AT <GT_ITEM> INTO <GS_ITEM> FROM <LV_INDEX>

*come out of 2nd loop for unmatched records.

IF <GS_ITEM-F1> NE <GS_BASE –F1>

EXIT.

ENDIF.

*process data

ENDLOOP.“ 2nd Loop

ENDIF.

ENDLOOP. “1st Loop

Delete and copy internal tables outside of loop statements as much as possible.
Copy and Delete Internal tables outside of loop statements for better performance

Note:

a. Add an additional fields (deletion flag ) to the required internal table, set the flag value as ‘X’ for the
unwanted records
b. Delete an internal table outside of the loop statements where the deletion flag is ‘X’.

Copy internal table

*not advisable

LOOP AT <GT_BASE> INTO <GS_BASE>


BY MR. BABU (OASIS TECHNOLOGIES)
*copy work area

<gs_temp> = <gs_base>

APPEND <GS_TEMP> TO <GTTEMP>

ENDLOOP.

*advisable

gt_temp [] = gt_base[]

DELETE <GT_TEMP> WHERE <F1> NE <GS_FIELD -VALUE>.

Delete Internal tables

LOOP AT <GT_FINAL > TO <GS_FINAL>

READ TABLE <GT_DBTABLE>

IF SY-SUBRC EQ 0.

ELSE.

*not advisable

*DELETE <GT_FINAL> WHERE…..

*Set deletion flag

<gs_final-del_flag> = ‘X’

MODIFY <GT_FINAL> FROM <GS_FINAL>

TRANSPORTING <DEL_FLAG>

ENDIF.

ENDLOOP.

*Delete internal tables – advisable

DELETE <GT_FINAL > WHERE <DEL_FLAG> = ‘X’.

Modify , delete, update and insert database tables outside of loop statements for better
performance.
Modify, Update, Insert and Delete data base tables outside of loops for better performance
BY MR. BABU (OASIS TECHNOLOGIES)
LOOP AT <GT_BASE> INTO <GS_BASE>

*Read tables

READ TABLE -------

IF SY-SUBRC EQ 0.

*process data

ELSE.

MOVE:<GS_BASE-F1> TO <GS_DBTAB-F1>

APPEND: <GS_DBTAB> TO <GT_DBTAB>.

ENDIF.

ENDLOOP.

*Delete, modify---------DB Tables

MODIFY/DELETE <DBTAB> FROM TABLE <GT_DBTAB>.

IF SY-SUBRC EQ 0.

COMMIT WORK

ENDIF.

Data declarations:
 Avoid using TABLES statement as much as possible since it creates unwanted work areas.
 Avoid declaring or defining internal tables WITH HEADER LINES and OCCURS statement.
 Avoid declaring field strings since they are outdated.

Note:

a. Declare types with the required fields, declare Work areas or field symbols and internal tables by
referring the defined types.
b. Declare internal tables without HEADER LINES and without OCCURS statements.

Ex: *Not advisable

DATA: BEGIN OF <GS_DBTAB>

END OF <GS_DBTAB>.
BY MR. BABU (OASIS TECHNOLOGIES)
TYPES: BEGIN OF <TYP_DBTAB>.

<F1> TYPE <DE/DBTAB-F1/------>,

ENDOF <TYP_DBTAB>.

*WORK AREAS AND INTERNAL TABLES.

DATA: <GS_DBTAB> TYPE <TYP_DBTAB>,

<GT_DBTAB> TYPE TABLE OF <TYP_DBTAB>.


BY MR. BABU (OASIS TECHNOLOGIES)
Vii Functiona Process Flows
Functional T-codes: They can be recognized as below

Creation: Most of the Functional T-codes end with *1

Ex: XD01- Create Customer,

VA01-Create Sales Order

MM01-Create Material

………………………

Change: Most of the Functional T-codes end with *2

Ex: XD02- Change Customer,

VA02-Change Sales Order

MM02-Change Material

………………………

Display: Most of the Functional T-codes end with *3

Ex: XD03- Display Customer,

VA03- Display Sales Order

MM03-Display Material

………………………

You might also like