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

abap-oops

The document provides an overview of Object-Oriented Programming (OOP) concepts, emphasizing the distinction between procedural and object-oriented approaches, and detailing key features such as encapsulation, inheritance, and polymorphism. It explains the structure of classes and objects, including local and global classes in ABAP, and outlines the components necessary for implementing OOP in SAP ABAP, particularly through the ALV Grid control. Additionally, it describes the sales and distribution process flow in SAP, highlighting various transactions and tables involved.

Uploaded by

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

abap-oops

The document provides an overview of Object-Oriented Programming (OOP) concepts, emphasizing the distinction between procedural and object-oriented approaches, and detailing key features such as encapsulation, inheritance, and polymorphism. It explains the structure of classes and objects, including local and global classes in ABAP, and outlines the components necessary for implementing OOP in SAP ABAP, particularly through the ALV Grid control. Additionally, it describes the sales and distribution process flow in SAP, highlighting various transactions and tables involved.

Uploaded by

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

Understanding the concepts of Object Oriented Programming

By Jaya Vani B, YASH Technologies

What is Object Orientation?


In the past, information systems used to be defined primarily by their functionality: Data and
functions were kept separate and linked together by means of input and output relations.

The object-oriented approach, however, focuses on objects that represent abstract or concrete
things of the real world. These objects are first defined by their character and their properties,
which are represented by their internal structure and their attributes (data). The behavior of
these objects is described by methods (functionality).

Comparison between Procedural and Object Oriented Programming

Features Procedure Oriented Object Oriented approach


approach
Emphasis Emphasis on tasks Emphasis on things that does
those tasks.

Modularization Programs are divided into Programs are organized into


smaller programs known classes and objects and the
as functions functionalities are embedded
into methods of a class.
Data security Most of the functions Data can be hidden and
share global data cannot be accessed by
external sources.
Extensibility Relatively more time New data and functions can
consuming to modify for be easily added whenever
extending existing necessary
functionality.

Object Oriented Approach - key features

1. Better Programming Structure.


2. Real world entity can be modeled very well.
3. Stress on data security and access.
4. Reduction in code redundancy.
5. Data encapsulation and abstraction.
What are Objects and Classes?

Objects: An object is a section of source code that contains data and provides services.
The data forms the attributes of the object. The services are known as methods (also
known as operations or functions). They form a capsule which combines the character
to the respective behavior. Objects should enable programmers to map a real problem
and its proposed software solution on a one-to-one basis.

Classes: Classes describe objects. From a technical point of view, objects are runtime
instances of a class. In theory, you can create any number of objects based on a single
class. Each instance (object) of a class has a unique identity and its own set of values for
its attributes.

Local and Global Classes

As mentioned earlier a class is an abstract description of an object. Classes in ABAP Objects can
be declared either globally or locally.

Global Class: Global classes and interfaces are defined in the Class Builder (Transaction SE24) in
the ABAP Workbench. They are stored centrally in class pools in the class library in the R/3
Repository. All of the ABAP programs in an R/3 System can access the global classes

Local Class: Local classes are define in an ABAP program (Transaction SE38) and can only be
used in the program in which they are defined.

Global Class Local Class


Accessed By Any program Only the program where it is defined.
Stored In In the Class Repository Only in the program where it is defined.
Created By Created using transaction SE24 Created using SE38
Namespace Must begin with Y or Z Can begin with any character

Local Classes

Every class will have two sections.

(1) Definition. (2) Implementation

Definition: This section is used to declare the components of the classes such as attributes,
methods, events .They are enclosed in the ABAP statements CLASS ... ENDCLASS.
CLASS <class> DEFINITION.
...
ENDCLASS.

Implementation: This section of a class contains the implementation of all methods of the
class. The implementation part of a local class is a processing block.

CLASS <class> IMPLEMENTATION.


...
ENDCLASS.

Structure of a Class

The following statements define the structure of a class:

1. A class contains components


2. Each component is assigned to a visibility section
3. Classes implement methods

1. Components of a Class are as follow:

Attributes:- Any data,constants,types declared within a class form the attribute of


the class.

Methods:- Block of code, providing some functionality offered by the class. Can be
compared to function modules. They can access all of the attributes of a class.

Methods are defined in the definition part of a class and implement it in the
implementation part using the following processing block:

METHOD <meth>.

...

ENDMETHOD.

Methods are called using the CALL METHOD statement.

Events:- A mechanism set within a class which can help a class to trigger methods of
other class.
Interfaces:- Interfaces are independent structures that you can implement in a class
to extend the scope of that class.

Instance and Static Components:

Instance components exist separately in each instance (object) of the class and are
referred using instance component selector using ‘’.

Static components only exist once per class and are valid for all instances of the class.
They are declared with the CLASS- keywords

Static components can be used without even creating an instance of the class and are
referred to using static component selector ‘ =>’ .

2. Visibility of Components

Each class component has a visibility. In ABAP Objects the whole class definition is separated
into three visibility sections: PUBLIC, PROTECTED, and PRIVATE.

Data declared in public section can be accessed by the class itself, by its subclasses as
well as by other users outside the class.

Data declared in the protected section can be accessed by the class itself, and also by
its subclasses but not by external users outside the class.

Data declared in the private section can be accessed by the class only, but not by its
subclasses and by external users outside the class.

CLASS <class> DEFINITION.


PUBLIC SECTION.
...
PROTECTED SECTION.
...
PRIVATE SECTION.
...
ENDCLASS.

We shall see an example on Visibility of Components once we become familiar with


attributes of ABAP Objects

Step1 is Create a reference variable with reference to the class.

Syntax: DATA : <object name> TYPE REF TO <class name>.


Step 2 : Create an object from the reference variable:-

Syntax: CREATE OBJECT <object name> .

Output for the above code is

Attributes of Object Oriented Programming:

 Inheritance.
 Abstraction.
 Encapsulation.
 Polymorphism

Inheritance is the concept of adopting the features from the parent and reusing them . It
involves passing the behavior of a class to another class. You can use an existing class to derive
a new class. Derived classes inherit the data and methods of the super class. However, they can
overwrite existing methods, and also add new ones.

Inheritance is of two types: Single Inheritance and Multiple Inheritance

Single Inheriting: Acquiring the properties from a single parent. (Children can be more).

Example for Single Inheritance

Multiple inheritance: Acquiring the properties from more than one parent.

Example

Syntax : CLASS <subclass> DEFINITION INHERITING FROM <superclass>.

Let us see a very simple example for creating subclass(child) from a superclass(parent)

Multiple Inheritance is not supported by ABAP.

Output is as follows :

Abstraction: Everything is visualized in terms of classes and objects.

Encapsulation The wrapping up of data and methods into a single unit (called class) is known as
Encapsulation. The data is not accessible to the outside world only those methods, which are
wrapped in the class, can access it.

Polymorphism: Methods of same name behave differently in different classes. Identical


(identically-named) methods behave differently in different classes. Object-oriented
programming contains constructions called interfaces. They enable you to address methods
with the same name in different objects. Although the form of address is always the same, the
implementation of the method is specific to a particular class.

OOPs ALV Concept in SAP ABAP

ALV
ABAP List Viewer is used to enhance the readability and functionality of any report output. We
can develop ALV using different ways like using type pool SLIS or using the class
Cl_GUI_ALV_GRID. In case of Object-Oriented concept, the Control Framework is required as it
provides global classes for various functionalities.

CL_GUI_ALV_GRID
It is the wrapper class implemented to encapsulate ALV Grid functionality for list display. ALV
Grid control is a flexible tool which provides following capabilities:

 For building and displaying interactive, non-hierarchical and modern-design lists.


 Provides typical list functions such as sorting, filtering, summing etc.
 Provides common list operations and can be enhanced by user-defined options.

Basic Components required for ALV Grid Control are:

1. List Data : Data to be listed is populated in an internal table. This table can be of any flat
type
2. Field Catalog: This is an internal table which contains the list of fields as per
specification. It comprises of some additional information about display options for each
column to be displayed. It must be referenced to the dictionary type “LVC_T_FCAT”
while the work-area should be of type “LVC_S_FCAT”. Function
“LVC_FIELDCATALOG_MERGE” can also be used to get field catalog by passing structure
name.
3. Container: Container is a storage area where the list will be displayed. It should be of
type “CL_GUI_CUSTOM_CONTAINER”. Other Container Classes are:
o CL_GUI_DOCKING_CONTAINER- For displaying multiple ALV’s by using methods
such as dock_at_left, dock_at_right, dock_at_top, dock_at_bottom. Internal
tables can be displayed in these containers.
o CL_GUI_EASY_SPLITTER_CONTAINER- For displaying two ALV Grids on single
screen, container is splitted into two containers by using this class.
o CL_GUI_DIALOGBOX_CONTAINER- This is used in case of Interactive ALV, where
details list will be displayed in dialog box. For this functionality refer to example
BCALV_GRID_02.
4. Layout Structure: It is a structure to specify general layout options for the grid. With this
structure we can set general display options, grid customizing, totals options, color
adjustments etc. The layout structure must be of type “LVC_S_LAYO”.
5. Event Handler: For handling events, we need to define and implement an event handler
class triggered by the ALV Grid instance. After creating ALV Grid instance, we must
register an instance of this event handler class to handle ALV Grid events.
Various Events are as follows-
o Print_Top_Of_Page: Used for Headers. Handler is ‘SET HANDLER’.
o Print_End_Of_Page: Used for Footers. Handler is ‘SET HANDLER’.
o OnDrag : This event is used to ‘fetch’ information from the drag source.
o OnDrop : This event is used to use the dragged information in combination with
drop source. Here, it should be checked whether the operation is successful.
o OnDropComplete: This event is used to change the state after a successful drag
and drop operation. For example: update the used internal table if a row has
been moved.NOTE: For Drag and Drop functionality refer to these standard
examples-BCALV_DND_01- Drag ALV row to Tree Folder
BCALV_DND_02- Drag Icons from Tree to rows of Grid
BCALV_DND_03- Drag & Drop on cells of grid
BCALV_DND_04- Drag & Drop within ALV Grid Control
BCALV_GRID_DND_TREE- ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE- ALV Grid: Drag and Drop with ALV Tree
(Simple)
6. Additional Data: To trigger some additional features of ALV Grid we can have some
additional data to pass as parameters. For example, initial sorting criteria (class used is
LVC_S_SORT), buttons to be deactivated, GUI Status and title etc.

General Declarations and Steps to Create Object-oriented ALV:

 Add custom control on screen related to container.


For example:
DATA: gc_custom_control_name TYPE scrfname VALUE ‘CC_ALV’.
 Create object of class CL_GUI_CUSTOM_CONTAINER for container.
For example:
Ob_custom type reference to cl_gui_custom_container.
Create object ob_custom
Exporting
container_name = ‘CONTAINER’.
 Create object of class CL_GUI_ALV_GRID for putting Grid in above container.
For example:
Ob_grid type reference to cl_gui_grid_display.
Create object ob_grid
Exporting
i_parent = ob_custom.
 Populate the internal table that you want to display on the GRID.
For example:
This Internal table is filled with data from Sflight.
Data: t_sflight type standard table of Sflight.
 Call the screen that contains Custom Container which is done at PBO of screen.
 Method SET_TABLE_FOR_FIRST_DISPLAY of class CL_GUI_ALV_GRID is used to display
the output.
For example:
CALL METHOD ob_grid->set_table_for_first_display
exporting
i_structure_name = ‘SFLIGHT’
Is_layout = gs_layout
changing
it_outtab = T_SFLIGHT []
it_fieldcatalog = gt_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.

Example for Docking Container using Object-Oriented ALV


Step1:
Create Two Docking Containers for Two Grids using Following Code.
DATA: r_grid1 TYPE REF TO cl_gui_alv_grid,
r_grid2 TYPE REF TO cl_gui_alv_grid,
g_dock1 TYPE REF TO cl_gui_docking_container,
g_dock2 TYPE REF TO cl_gui_docking_container,

IF g_dock1 IS INITIAL.
CREATE OBJECT g_dock1
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock1->dock_at_left
extension = 300.
CREATE OBJECT r_grid1
EXPORTING
i_parent = g_dock1.
ENDIF.

IF g_dock2 IS INITIAL.
CREATE OBJECT g_dock2
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock2->dock_at_bottom
extension = 100.
CREATE OBJECT r_grid2
EXPORTING
i_parent = g_dock2.
ENDIF.

Step2:
Take two internal tables and populate them with desired data.
For example:
it_tab, it_count.

Also fill the field catalog with corresponding structures of internal tables.

Step3:
Set internal table it_tab to grid r_grid1.
IF it_tab[] IS INITIAL.
CALL METHOD r_grid1->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = it_tab
it_fieldcatalog = gt_fieldcat.
ENDIF.

Step4:
Set internal table it_count to grid r_grid2.
IF NOT it_count[] IS INITIAL.
CALL METHOD r_grid2->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = it_count
it_fieldcatalog = gt_fieldcat1.
ENDIF.
Screen-shots for Output of ALV for displaying two internal tables in two different Docking
Containers along with Selection-screen:

we can display more than one internal table on the same screen as selection-screen unlike ALV
using Type-pool SLIS
SD FLOW IN SAP

SD PROCESS FLOW

1.Sales Inquriy
2.Quotation.
3.sales order.
4.Delivery/Shipping
5.Billing.
6. Invoice

sales order - Transaction VA01 - Tables VBAK, VBAP, VBEP, VBKD, VBPA, VBUK, VBUP.

Delivery - Transaction VL01N - Tables LIKP, LIPS, VBUK, VBUP.

Goods issue - Transaction VL02N - Tables MKPF, MSEG

Billing document - Transaction VF01 - Tables VBRK, VBRP.

Customer is returning...

Return order - Transaction VA01 - Tables VBAK, VBAP, VBEP, VBKD, VBPA, VBUK, VBUP.

Returns delivery - Transaction VL01N - Tables LIKP, LIPS, VBUK, VBUP.

Goods Receipt - Transaction VL02N - Tables MKPF, MSEG

Credit memo - Transaction VF01 - Tables VBRK, VBRP.

Customer wants some money back.

Credit memo request - Transaction VA01 - Tables VBAK, VBAP, VBEP, VBKD, VBPA, VBUK, VBUP.

Credit memo - Transaction VF01 - Tables VBRK, VBRP.

Customer was charged less money ..Meaning we want some money back from customer..

Debit memo request - Transaction VA01 - Tables VBAK, VBAP, VBEP, VBKD, VBPA, VBUK, VBUP.

Debit memo - Transaction VF01 - Tables VBRK, VBRP.


The sales documents you create are individual documents but they can also form part of a chain
of inter-related documents. For example, you may record a customer’s telephone inquiry in the
system. The customer next requests a quotation, which you then create by referring to the
inquiry. The customer later places an order on the basis of the quotation and you create a sales
order with reference to the quotation. You ship the goods and bill the customer. After delivery
of the goods, the customer claims credit for some damaged goods and you create a free-of-
charge delivery with reference to the sales order. The entire chain of documents – the inquiry,
the quotation, the sales order, the delivery, the invoice, and the subsequent delivery free of
charge – creates a document flow or history. The flow of data from one document into another
reduces manual activity and makes problem resolution easier. Inquiry and quotation
management in the Sales Information System help you to plan and control your sales.

MM FLOW IN SAP

MM Process Flow

PR >Release the PR>RFQ>Quotation>Quotation Comparison>PO>Release the PO>GR>Invoice


Verification
The typical procurement cycle for a service or material consists of the following phases:

1. Determination of Requirements
Materials requirements are identified either in the user departments or via materials planning
and control. (This can cover both MRP proper and the demand-based approach to inventory
control. The regular checking of stock levels of materials defined by master records, use of the
order-point method, and forecasting on the basis of past usage are important aspects of the
latter.) You can enter purchase requisitions yourself, or they can be generated automatically by
the materials planning and control system.
Purchase Requisition
ME51N – Create ME52N – Change ME53N - Display

2. Source Determination
The Purchasing component helps you identify potential sources of supply based on past orders
and existing longer-term purchase agreements. This speeds the process of creating requests for
quotation (RFQs), which can be sent to vendors electronically via SAP EDI, if desired.
Request for Quotation (RFQ)
ME41 – Create ME42 – Change ME43 – Display ME44 – Maintain Supplement ME45 – Release
Quotation
ME47 – Maintain ME48 – Display ME49 – Price Comparison

3. Vendor Selection and Comparison of Quotations


The system is capable of simulating pricing scenarios, allowing you to compare a number of
different quotations. Rejection letters can be sent automatically.
4. Purchase Order Processing
The Purchasing system adopts information from the requisition and the quotation to help you
create a purchase order. As with purchase requisitions, you can generate Pos yourself or have
the system generate them automatically. Vendor scheduling agreements and contracts (in the
SAP System, types of longer-term purchase agreement) are also supported.
Purchase Order
ME21N – Create ME22N – Change ME23N – Display

5. Purchase Order Follow-Up


The system checks the reminder periods you have specified and - if necessary - automatically
prints reminders or expediters at the predefined intervals. It also provides you with an up-to-
date status of all purchase requisitions, quotations, and purchase orders.

6. Goods Receiving and Inventory Management


Goods Receiving personnel can confirm the receipt of goods simply by entering the Po number.
By specifying permissible tolerances, buyers can limit over- and underdeliveries of ordered
goods.
Goods Movement – MIGO

7. Invoice Verification
The system supports the checking and matching of invoices. The accounts payable clerk is
notified of quantity and price variances because the system has access to PO and goods receipt
data. This speeds the process of auditing and clearing invoices for payment.
----------------------------------------------------------------------------------------------------------------------
Integration Points for SD (Sales) and MM
1. During the creation of Sales Order Availability check is carried out which is integrated with
Inventory management
2. During the Delivery Creation the Stock is removed from the Inventory (Once u do Delivery a
material document is created triggering the Movement of material)
----------------------------------------------------------------------------------------------------------------------------
Display Document Flow & Status Overview are the two buttons on the right side of application
tool bar to click (See VA03 Display Sales order: Initial screen)

MM Cycle:
Purchase Requisition-> Staff in an organization places Purchase requisition for want of some
goods/products - ME51

Request for Quotation(RFQ)-> The Purchase dept in the organization calls/requests for the
quotation for the products against which PR was raised. - ME41

Vendor Evaluation->after receiving the RFQ's, after comparison a Vendor is finalized based on
the terms and conditions.

Purchase Order (PO) -> Purchase order was issued to that vendor asking him to supply the
goods/products -ME21N
Goods Receipt Note (GRN) ->Vendor supplies the material/Products to the organization
MB01
Goods Issue (GI) -> People receives their respective items for which they have placed the
Requisitions

Invoice Verification-> Along with the Material Vendor submits a Invoice for which the Company
Pays the amount - MIRO

Data to FI -> data will be posted to FI as per the vendor invoices

RFQ to Vendor - ME41


Raising Quotation - ME47
Comparison of Price - ME49
Creation of PO - ME21N
Goods Receipt - MIGO
Invoice (Bill Passing) - MIRO
Goods Issue - MB1A
Physical Inventory - MI01( Create doc)
MI04 (Enter Count)
MI07 (Post)

Common Tables used by SAP MM:


Below are few important Common Tables used in Materials Management Modules:
EINA Purchasing Info Record- General Data
EINE Purchasing Info Record- Purchasing Organization Data
MAKT Material Descriptions
MARA General Material Data
MARC Plant Data for Material
MARD Storage Location Data for Material
MAST Material to BOM Link
MBEW Material Valuation
MKPF Header- Material Document
MSEG Document Segment- Material
MVER Material Consumption
MVKE Sales Data for materials
RKPF Document Header- Reservation
T023 Mat. groups
T024 Purchasing Groups
T156 Movement Type
T157H Help Texts for Movement Types
MOFF Lists what views have not been created
A501 Plant/Material
EBAN Purchase Requisition
EBKN Purchase Requisition Account Assignment
EKAB Release Documentation
EKBE History per Purchasing Document
EKET Scheduling Agreement Schedule Lines
EKKN Account Assignment in Purchasing Document
EKKO Purchasing Document Header
EKPO Purchasing Document Item
IKPF Header- Physical Inventory Document
ISEG Physical Inventory Document Items
LFA1 Vendor Master (General section)
LFB1 Vendor Master (Company Code)
NRIV Number range intervals
RESB Reservation/dependent requirements
T161T Texts for Purchasing Document Types

Introduction to SAP ABAP ALV with OOPs concept

In this article we will see of how to make the ABAP report an interactive one.

One way to make a report interactive is using ALV tool. I will give a brief idea of what ALV is all
about using OOPs concept.

ABAP List Viewers (ALV):

The name itself indicates that the output view of a report is in the form of a list. This list
can be displayed in two forms

1. ALV List Form


2. ALV Grid Form
This article covers only ALV grid form. This is the most preferable form because of its GUI
capability. When coming to the implementation part of ALV Grid using OOPs concept, we can
use the existing classes for generating ALV output: Here I am listing some of the widely used
classes and its purpose:

1. CL_GUI_ALV_GRI
2. CL_GUI_CUSTOM_CONTANIER
3. CL_GUI_SPLITTER_CONTAINER
4. CL_GUI_CONTAINER
5. CL_DD_DOCUMENT
6. CL_GUI_HTML_VIEWER
7. CL_ALV_CHANGED_DATA_PROTOCAL
CL_GUI_ALV_GRID: This class contains all the methods required to create an ALV and holds the
events required for the generated ALV. The methods in this class are useful for:

1. Setting the field catalog and its layout


2. For assigning the ALV to the Custom container
3. For changing the field catalog contents
4. For adjusting the ALV display and the list goes like this.
I will explain how to use the methods and events with an example at the end of this article.

CL_GUI_CUSTOM_CONTAINER: It holds the Custom control that is created on the screen


layout. The link to the custom control to the ALV will be done using this container class.
CL_GUI_SPLITTER_CONTANIER: Using this class we can split the container into several parts
based on the requirement.

For instance, there may be a requirement in which top portion of the ALV Grid must hold the
company logo and some other details like date and user ID and the remaining part must hold
the loaded data. In this case we can use this class to split the container into two parts one for
holding the company details and the other contains all the records.

CL_GUI_CONTAINER: This class is also useful while splitting a container. Each container part
that is separated using the above class holds the form of this class.

CL_DD_DOCUMENT: This class is used to write text or labels or variables or logos etc., on the
container layout.

CL_ALV_CHANGED_DATA_PROTOCAL: If the ALV is in edit mode then the changed values can
be viewed through this class.

The following example demonstrates how to make use of the methods and events of
CL_GUI_ALV_GRID.

Note: This program is not specific to any application. It will give the basic idea of implementing
the double click, hotspot, data change, tool bar and user command events in ALV.
SAP Reports Interview Questions And Answers

How can validate input values in selection screen and which event was fired?
Answer1:
We can Validate Selection Screen With the Help of the Following Events, the Event Follows the
Same hierachy.

AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON BLOCK
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN.

Answer2:

At selection-screen on
select stmt ------------------ where = .
if sy-subrc = 0.
validation success for LOw value in selection screen
At selection-screen on
select stmt-------------------- where =
if sy-subrc <> 0.
validation failure on high value in the selection field.
else
success.
endif

BDC Transaction code?


Transaction code for bdc :SHDB

How to navigate basic list to secondary list?

We can Navigate from basic list to secondary list with the help the event called AT LINE-
SELECTION. for every Secondary List the System Field SY-LSIND increases by 1. So there will be
Totally 21 list possible in SAP.

One Basic List 20 Secondary List.

Which is the First character of creating LockObject?


LockObjects always starts with character 'E'.
What is the Difference between Data Element and Domain?

Answer1:

Domain: Defines the attributes such as length,type and possible value range.
Data element; An intermediate object between domain and table type

Answer2:

Domain : technical attributes of dataelement is called domain.


Dataelement : Symantic attributes are called dataelement.

How many types of standard SAP Internal Tables?

1)standered table

2)index table

3)hashed table

4)sorted table

What is the Difference Between Tablecontrols and Step Loops?

Table controls have both horizontal and vertical scrollers and cursor control logic is designed
implicitly.
Step loops have only horizontal scrollers and cursor control logic is to be designed by the user
explicitly.

What are the Events in Dialog Programs?

Events in Dialog Programming are:


PBO-Process Before Output
PAI-Process AFter Input
POH-Process on Help Request
POV-Process on Value Request

How many ways you can create Table?

User can create a Database table in two ways.


1.Top-to-bottom approach: In this approach, first fields are defined and later domain and data
element are defined.

2.Bottom-to-top approach: In this approach, first domain and data element are defined and
later fields are defined.

What are the Cluster Tables?


Cluster tables contain continuous text, for example, documentation. Several cluster tables can
be combined to form a table cluster. Several logical lines of different tables are combined to
form a physical record in this table type. This permits object-by-object storage or object-by-
object access. In order to combine tables in clusters, at least parts of the keys must agree.
Several cluster tables are stored in one corresponding table on the database.

What are function modules in LDB?

Function modules in LDB's are

get
put
get late

What are Difference Between Classical Batch Input and Call Transaction?

Answer1:

In Batch input many transactions can be executed, where as in Call transcation only one
transactioin can be executed.
BI is a background process, Ct can be either background or foreground .
BI is Synchronous process, Ct is both Asynchronous & Synchronous.
BI Sessions cannot be runed parallel.
Log file is generated automaticly in BI, errors can be found through BDCMSGCOLL.

Answer2:

1.batch input works for multiple applications where as call transactions doen't work

2.batch input has an implicit log file with it. where as call transaction doesn't have

3.batch input has sy-subrc check with the database where as call transaction doesn't have so
call transaction is fast.
How can you call the Sessions?

using transaction code SM35

Can you call Report in SAP Script?

Yes, we can.
Just write in Line editor:
/:perform f_display_report
--------------
----------
----------
/:endperform
THIS PERFORM WOULD BE DECLARED IN THE PRINT PROGRAMME IN WHICH YOU CAN ALWAYS
WRITE STATEMENT
SUBMIT REPORT...

How to Upload Logo to Layout Set and what is Program Name?

You can also upload a Logo in BMP format - it has to be saved as "%^ Colours if it is a colour
Bitmap.

If you don't save a colour Bitmap as 256 Colours then it will be uploaded in Black.
This can be done in Smart Forms, SAPScript or Transaction SE78

Question 1: What is the difference between User Exit and Function Exit?
User Exit Customer Exit
User exit is implemented in the form of a A customer exit can be implemented as:
Subroutine i.e. PERFORM xxx.  Function exit
Example: INCLUDE MVF5AFZZ   Screen Exit
PERFORM  Menu Exit
userexit_save_document_prepare.  Field Exit
Example: CALL Customer function ‘xxx’
INCLUDE xxx.
You modify this include.
In case of a PERFORM, you have access to You have access only to the importing,
almost all the data. So you have better exporting, changing and tables parameter of
control, but more risk of making the system the Function Module. So you have limited
unstable. access to data.
User exit is considered a modification and A customer exit is considered an
not an enhancement. enhancement.
You need Access Key for User Exit. You do not need access key.
Changes are lost in case of an upgrade. Changes are upgrade compatible.
User exit is the earliest form of change Customer exits came later and they
option offered by SAP. overcome the shortcomings of User Exit.
No such thing is required here. To activate a function exit, you need to
create a project in SMOD and activate the
project.

What is the difference between RFC and BAPI?


BAPI RFC
Just as Google offers Image/Chart/Map APIs RFC is nothing but a remote enabled
OR Facebook offers APIs for Comment/Like, function module. So if there is a Function
SAP offers APIs in the form of BAPIs. BAPI is Module in SAP system 1 on server X , it can
a library of function modules released by be called from a SAP system 2 residing on
SAP to the public so that they can interface server Y.
with SAP.
There is a Business Object Associated with a No Business Object is associated with a RFC.
BAPI. So a BAPI has an Interface, Key Field,
Attributes, Methods, and Events.
Outside world (JAVA, VB, .Net or any Non Non–SAP world cannot connect to SAP using
SAP system) can connect to SAP using a RFC.
BAPI.
Error or Success messages are returned in a RFC does not have a return table.
RETURN table.

Question 3:What is the difference between SAPSCRIPT and SMARTFORM?


SAPSCRIPT SMARTFORM
SAPSCRIPT is client dependent. SMARTFORM is client independent.
SAPSCRIPT does not generate any Function SMARTFORM generates a Function Module
module. when activated.
Main Window is must. You can create a SMARTFORM without a
Main Window.
SAPSCRIPT can be converted to SMARTFORMS cannot be converted to
SMARTFORMS. Use Program SF_MIGRATE. SCRIPT.
Only one Page format is possible Multiple page formats are possible.
Such thing is not possible in SCRIPT. You can create multiple copies of a
SMARTFORM using the Copies Window.
PROTECT … ENDPROTECT command is The Protect Checkbox can be ticked for Page
used for Page protection. Protection.

The way SMARTFORM is developed and the way in which SCRIPT is developed is entirely
different. Not listing down those here. That would be too much.

Question 4:What is the difference between Call Transaction Method and the Session
method ?

Session Method Call Transaction


Session method id generally used when Call transaction method is when the data
the data volume is huge. volume is low
Session method is slow as compared to Call Transaction method is relatively faster
Call transaction. than Session method.
SAP Database is updated when you SAP Database is updated during the
process the sessions. You need to process execution of the batch input program.
the sessions separately via SM35.
Errors are automatically handled during Errors should be handled in the batch
the processing of the batch input session. input program.

Question 5: What is the difference between BDC and BAPI?

BAPI BDC
BAPI is faster than BDC. BDC is relatively slower than BAPI.
BAPI directly updates database. BDC goes through all the screens as a
normal user would do and hence it is
slower.
No such processing options are available Background and Foreground processing
in BAPI. options are available for BDC.
BAPI would generally used for small data BDCs would be preferred for large
uploads. volumes of data upload since background
processing option is available.
For processing errors, the Return Errors can be processed in SM35 for
Parameters for BAPI should be used.This session method and in the batch input
parameter returns exception messages or program for Call Transaction method.
success messages to the calling program.
Question 6: What is the difference between macro and subroutine?

Macro Subroutine
Macro can be called only in the program it is Subroutine can be called from other
defined. programs also.
Macro can have maximum 9 parameters. Can have any number of parameters.
Macro can be called only after its definition. This is not true for Subroutine.
A macro is defined inside: Subroutine is defined inside:
DEFINE … FORM …..
…. …..
END-OF-DEFINITION. ENDFORM.
Macro is used when same thing is to be done Subroutine is used for modularization.
in a program a number of times.

Question 7: What is the difference between SAP memory and ABAP memory?

SAP Memory ABAP Memory


When you are using the SET/GET Parameter When you are using the EXPORT IMPORT
ID command, you are using the SAP Statements, you are using the ABAP
Memory. Memory.
SAP Memory is User Specific. ABAP Memory is User and Transaction
What does this mean?The data stored in Specific.What does this mean? The data
SAP memory can be accesses via any session stored in ABAP memory can be accessed
from a terminal. only in one session. If you are creating
another session, you cannot use ABAP
memory.

You might also like