0% found this document useful (0 votes)
30 views191 pages

ABAP Interview Questions and Answer in Detail

This document outlines a comprehensive SAP ABAP course designed to help individuals prepare for interviews by providing answers to common questions and revising key concepts. It covers various topics such as Data Dictionary, Reports, BDC, and different types of tables, along with their characteristics and differences. Additionally, it includes insights into SAP architecture, development life cycle, and indexing, making it a valuable resource for aspiring ABAP developers.

Uploaded by

Lucy Kumari
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)
30 views191 pages

ABAP Interview Questions and Answer in Detail

This document outlines a comprehensive SAP ABAP course designed to help individuals prepare for interviews by providing answers to common questions and revising key concepts. It covers various topics such as Data Dictionary, Reports, BDC, and different types of tables, along with their characteristics and differences. Additionally, it includes insights into SAP architecture, development life cycle, and indexing, making it a valuable resource for aspiring ABAP developers.

Uploaded by

Lucy Kumari
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/ 191

Welcome To SAP-ABAP I Q Series

By Pankaj Kumar
Mob/WhatsApp – 8971472172
Email – [email protected]
Introduction – SAP ABAP Question’s Answer – Complete Set

This Course will help you to prepare the SAP ABAP Interview Question’s Answer

This Course will help you give the answer of any kind of SAP ABAP Question

This course is not simply Questions and answer but here I have tried to make you revise
the concept as well wherever needed.

In this course I have marked Question as VVI which are asked very frequently in
Interview
Area Covered and some Questions Example

Data Dictionary: - Table, Views, Search Help, Lock Objects, Data types etc.

What is the difference between Transparent Table, Pool table and Cluster Table?

What is Data Class?

What is Delivery Class?

What is difference between Table and View?

What is difference between Table and Structure?

And So many such questions


Report

Report: Events, Data types, System Variables, OPEN SQL, ALV etc.
1. What are the Non Numeric Data types in ABAP
2. What is user defined data types in ABAP?
3. What are the different system variables in ABAP?
4. What are the important/frequently used string operation in ABAP?
And Many More 5. What are the frequently used Character Operation in ABAP?
Such Questions 6. What is Internal tables?
7. What is difference between Internal Table Vs DB Table
8. What is the difference between Refresh, Clear and Free
9. What is the different types of internal table operation
What is the Transport Request and What is the task?
Explore next What is the difference between TR and Tasks?
page for Answers What is the significance of the Standard Recording Routine?
What are the main data types in ABAP?
What are the Numeric data types in ABAP? Given the answer in detail
BDC

BDC: Different Modes, Call Transaction and Session Method etc.


1
What is WRICEF?

WRICEF=> ABAP is used to develop the WRICEF object.


W=> Workflow
R=> Report (SE38)
I => Interface (IDOC,ALE,BAPI, RFC FM)
C=> Conversion(LSMW, BDC,BAPI)
E => Enhancement(Exit, BADI, Implicit enhancement, Explicit
Enhancement, Switch framework, BTE )
F => Forms(Smart Forms, SAP Scripts, ADOBE forms)
What is R3 ARCHITECUTRE?

R3
PRESENTATION SERVER ARCHITECTURE

Application Server Layer(DD=>SE11)

WORK PROCESS ICM DIPATCHER BUFFER

Database layer
Oracle, MYSQL, SYBASE,DB2,
DB6,HANA
What is R2 Architecture?

PRESENTATION SERVER

R2
ARCHITECTURE

Application Server Layer Application server +


Database Server => Tightly
Database layer integrated.
WORK
Oracle, PROCESS,
MYSQL, ICM
SYBASE,DB2,
DB6,HANA
What is Dispatcher and What are the different work processes?

User Application Server Monitoring - SM51,


Work process Monitoring: -SM66

DISPATCHER( Taking the request from the user and identifies what kind of request it is and
then it assigns to the correct wp)

UPDATE WP
DATABASE BACKGROUND
DIALOGUE WP SPOOL ENQUEUE WP( TO
USER UPDATE WP(BACKGROUND
WP(PRINT, HANDLE THE LOCKING
INTERACTION REQUESTS JOB)
FAX,EMAIL) MECHANISM)
( UPDATE / Batch Process
Function Module
)
What is the Architecture of the Work Process?

SCREEN PROCESSOR

WORK PROCESS
ABAP PROCESSOR

OPEN SQL =>DATABASE ABSTRACTION INTERFACE


=>NATIVE LANGUAGE OF THE UNDERLYING DB
Development Life Cycle

VVI
Solution Architect

Technical Architect

ABAP
FS TD/TS
DEVELOPER

TRANSPROT TRANSPROT TRANSPROT

DEV (UNIT QUA(DVT, FIT)


PRODUCTION
TESTING) DESIGN VALIDATION TESTING,
What is the difference between Master data and Transaction Data?

VVI

Master data Transaction data


It changes very rarely It changes very frequently
e.g. Material Master, e.g. Purchase Order, Sales order
STUDENT ID, ADDRESS Price of the article
EMPLOYEE Id , address
2
What are the different types of tables?
VVI

Table

Transparent Table Pool Table Cluster Table

e.g. ZDEMOTEST POOL


POOL Cluster
TABLE 2
SAME NAME, SAME FIELDS TABLE 1 Cluster TABLE 2
AND SAME NUMBER OF TABLE 1
FIELDS POOL
One to TABLE 3 Cluster Cluster
TABLE 3 TABLE 4
One
Many
to One POOL
ZDEMOTEST TABLE 4
Many to
Table Pool Table One
Cluster
How the data of Cluster tables Stores in the Table Cluster?

EXAMPLE FOR CLUSTER TABLE AND TABLE CLUSTER

Credit: SAP Standard Documentation


How the data of Pool tables stored in Table Pool?

ZSTUDENT(POOL TABLE) ZEMPLOYEE(POOL TABLE)

Student_id Name EMPLOYEE_ID EMPLOYEE_NAME


1 RAM 1 MR. JAMES BOND
2 LAKSHMAN 2 MR. NAG SEN

TABLE POOL DATABASE

TABNAME VARKEY VARLEN VARDATA


ZSTUDENT 1 3 RAM
ZSTUDENT 2 8 LAKSHMAN
ZEMPLOYEE 1 12 MR. JAMES BOND
ZEMPLOYEE 2 9 MR. NAG SEN
What are the difference between Transparent, Pool and Cluster Table??

VVI
How many types of table and what is the difference b/w them?

Criteria/Name
Transparent Table Pool table Cluster table
Relationship Many(application layer) to One(database layer)
One to One Relationship b/w application server Many(AL) to one(DB) relation
and database relation

Index No Secondary Index Can created


Secondary Index No Secondary Index
Support:

Open SQL only No Native SQL


SQL Support Open SQL + Native SQL Open SQL Only No SQL

Data Master/Transaction data=> Application Data System Related Information: Used to store large number of logically related
Parameter, Screen Sequences continuous records e.g. Document
Match Code Objects, Look up value/Drop Down
Values, Secondary Index

Medium Table Small Table Very Big table


Size

Benefits General data. All the data at application layer to get at one time 5 to 10 times compression
What is Foreign key relation ship and what are the another terms used for this?

Zstudent_main Student Student f name Student l name


CHECK TABLE Id(PRIMARY KEY)
1 Pankaj Kumar
FOREING KEY
RELATIONSHIP 2 Siva Ram

FOREIGN zstudent_mob(FOREIGN TABLE) Check Table/Referential Integrity


KEY
Student id counter Mobile number
1 1 9000876527
1 2 9839080238 q. What is the use of Check table
2 1 8239402392 Concept?
3 1 2345345245
What is Value Table ? VI
What is the difference between Check table and Value table?

Check table Value table


• It is at field level in database table • It is at domain level
• It will be behave like as search help • This will not behave like a search help. This will only
• This is to validate the data proposed as a check when you are going to create the
foreign key relationship for a field on table level
• It is not for validation of the data
What is Client Dependent and What is Client Independent

Client dependent Vs Client Dependent

EPT

EPT800 EPT810

sap

EPT820 EPT830

What field can be used for the purpose of making a table Client Dependent ?
Ans: - MANDT
Primary Index and Secondary Index

Indexing Primary Index


Purchase Order, Item
Purchase Order item
1 10
vbap 1 20
2 10
2 20
3 10
Purchase Order item Material
1 10 laptop
1 20 mobile
2 10 laptop
2 20 pen
3 10 Book

Q. What is Primary Index and when Primary Index is generated?


What is Index and what are the different types of index

Ans:- > Index is the sorted content in the separate memory pointing to the original content.

Index

Secondary Index
Primary Index Manually
Gets created
automatically
Max Index: 9/16
Based Primary Key
Why we are not supposed to create many Secondary Indexes?

Ans:- Database Over Head.


Secondary Index

Secondary Index:
By default Primary index gets created on the primary key of the table.

If you have multiple searching(Select Query) performed on the non primary key field of the database table
then you can create the Secondary index in order to improve the performance.

More than 9/16 Secondary Index is not supposed to create because more secondary index overall can hamper
the performance because if you do any changes in the record of the database, database has to adjust all the
connected secondary index accordingly.
What is the difference between Primary Index and Secondary Index?

Primary Index Vs Secondary Index


Primary Index Secondary Index
• It is by default gets created on Primary • This is explicitly / manually need to be
Key created.

• There can be one and only one • There can be 0 or Multiple secondary
Primary Index on a DB Table. i.e. Index for a table.
Minimum and Maximum Primary
index on a table is ONE.
Buffer: What is Buffer? What is the use of Buffer?

PRESENTATION SERVER

TSTC
Application Server R3
SELECT * FROM MARA BUFFER
ARCHITECTURE
FLAG = INVALID
REDUCED NETWORK LOAD
HIT ON THE DATABASE IS GOING TO BE DECREASED

Database layer
Buffer

What are the different types of Buffer?


When the Single Record Buffer should be used and when it should not be used? IMPORTANT
When the Generic Record Buffer should be used and when it should not be used?
When the Full Record Buffering should be used and it should not be used.?
Buffer:
1. Single Record Buffer
If you have the large table then you can enable the single record buffer
Whatever the record you are going to read from the database that only is put into
the Buffer
SELECT SINGLE FROM <TABLE> WHERE KEY = <fkadfjk>
2. Generic Buffer
SELECT * FROM MAKT INTO TABLE IT_TAB WHERE MATNR = ‘38’.
3. Full Buffer
If you see that all the data from a particular table is accessed very frequently. And
if you see that this table is small table then you can enable the full buffer.
Any kind of query

Notes:
If your data is going to change frequently then never use buffer
Where you can use the buffering?
1. If your data is very rarely changed
Buffer Analysis: ST10

•Direct Reads – This gives the number of SELECT queries on a particular table in which the entire primary key was specified in
the WHERE clause.

•Seq. Reads – This gives the number of SELECT queries on a particular table in which the entire primary key was NOT specified in
the WHERE clause. There can more than one record satisfying the WHERE clause.

•Changes – This gives the number of write access (INSERT/UPDATE/MODIFY/DELETE) on a particular table.

•Total – This is the total number of accesses (read + write) to a particular table in the time frame chosen and in the server chosen.
Total = Direct Read + Seq. Reads + Changes.
•Changes/Total % = Also termed as “Change Rate”, this is the % of accesses that are write accesses.

Blog Reference: https://blogs.sap.com/2015/08/27/to-buffer-or-not-to-buffer-a-database-table/


Buffering: It is a mechanism to improve the performance

Buffered Table: The table for which buffering is enabled


Single record buffer:

When Should you Use Single-Record Buffering?


Single-record buffering should be used particularly for large tables where only a few records are accessed with SELECT
SINGLE. The size of the records being accessed should be between 100 and 200 KB.

Access to Buffered Data


All accesses that are not submitted with SELECT SINGLE go directly to the database, bypassing the buffer. This applies
even if the complete key is specified in the SELECT statement.
If you access a record which is not yet buffered with SELECT SINGLE, there is a database access to load the record. This
record is marked in the buffer as non-existent if the table does not contain a record with the specified key. This prevents
another database access when accessing the table at a later time with the same key.
Generic Record Buffer:

When To Use Generic Buffering:


● When generic areas are needed.
You must generically buffer a table if only certain generic areas of the table are needed for processing.
● For client-specific tables
Client-specific, fully-buffered tables are automatically generically buffered since it is not possible to work in all clients at
the same time on an application server. The client field is the generic key.
● For language-specific tables
Language-specific tables are another example when we recommend you use generic buffering. In most cases, only
records of one language are needed on an application server. In this case, the generic key includes all the key fields
up to and including the language field.
3
What is the difference between Domain and Data element? VVI
VVI

Data Element Vs Domain


Data Element Domain
• Semantic Meaning/Description • Technical Description
• No Value table at data element • Value Table can be defined at domain level
• Search Help • No Search Help
• Parameter • No Parameter
• One data element can use one domain at a time • One domain can be used in multiple data element
• No Such Restriction as domain • Restrict the input value by maintaining the value
• No Conversion Exit under fixed value
DOMAIN • Conversion Exit

DE1
DE2 DE3
TB1
TB2 TB3
What is the difference between INCLUDE STRUCTURE VS APPEND STRUCTURE VVI

What is the difference between INCLUDE STRUCTURE VS APPEND STRUCTURE

INCLUDE STRUCTURE APPEND STRUCTURE


• It can be included • It will be appended only at
anywhere in the table last
• You can not use this include • This is a mechanism to
structure( Created by you) enhance the SAP Standard
in standard Table Table
However with the help of • This can’t be used in more
Customizing include(CI_) , than one table
standard table can be
enhanced. This customizing
include is given by SAP.
* Include structures can be
used in many tables
What is the difference between table and Structure? VVI

Different View
Search Help
Customizing Structure

Table Structure

1. It contains the Physical data 1. It doesn’t contain any physical data

2. It do have the technical setting( 2. No Technical Setting


Buffering , Size Category, Data Class )
3. No indexes
3. Index

4. Delivery and maintenance( 4. No Delivery and maintenance


Delivery Class )

5. Primary key ( mandatory ) 5. Not required


What is the Data Class and what are the different data Classes? VI

IMPORTANT

Data Class: It is to categorize the data.

APPL1
TRANSACTION
APPL2
APPL0 DATA
ORGANIZATION USER DATA
MASTER DATA VERY
AL / USR1
RARELY MODIFIED FREQUENTLY
CUSTOMIZING
CHANGED
What is size Category? Important

0-10000 IMPORTANT

Ans. -> Size Category help database to organize the data in


efficient way in the memory.

SIZE CATEGORY:

EMPLOYEE EMPLOYEE INITIAL EXTENT


D ID NAME
1 Ram
FIRST EXTENT
2 Sita
3 Gayatri
4 Anuradha 2nd EXTENT
5 Neha
What is Delivery Class and what is its Importance?

Delivery Class: It decides how the transport management is going to happen in Very IMPORTANT
case of development or implementation or update or roll out

Workbench TR

CUSTOMIZING TR
4th
What is View and What are different types of View?
VIEW VVI

View: Different way of looking into the data from one table or more than one table
View doesn’t contain the data physically/Permanently
View shows the data by fetching the data from the single/different table at run time

View

Database View(minimum Projection View(Only Maintenance


2 tables) One table)- View(one/multiple):- Help View(Minimum 2
Gets the data from 2 or From One table you are This is used to maintain the tables):-
more than 2 tables based going to select some data in the tables related This help view is used in
on inner join fields with foreign key relationship search help.
together
What is the difference between View and Table ? VVI

Table View
• 1. It stores the physical data/actual data • 1. It will fetch the data at run time from the
single/multiple table based on the view type
• 2. Because it contains the data it will be having –
Delivery Class and Technical settings • 2. Since it doesn’t contain the data it doesn’t have the
deliver Class and Technical settings
-> 3. able is of 3 types: Transparent , Pool and Cluster
• 3. View is of four types: 1. Database view, 2. Projection,
Index 3. Maintenance and 4. Help view

No Index
What is the different data types under data dictionary which can be defined or created?

Data types

Data Element Structure Table Type

Group of field Table type contains the


Semantic information
Work area structure inside it.
Type table of
This structure
determines the line type
of the table

With reference to it we
can define the internal
table.
type
What is type group? IMPORTANT

Type group is nothing but collection of types.

It is collection of table types , Structures and Constants

Types:

Constants:

What is the important point about the type group when we create a table type and structure and
constants wrt to Naming convention.

Type Groups:-> slis / abc


Types: <type_group>_
Types: <type_group>_
Constants: <type_group>_
What is search help and what are the different types of search help Very Important

Where we can assign the search help?


Ans. At data element level
At table field level SEARCH HELP

ELEMENTARY SEARCH HELP =>


YOU ARE GOING TO GET THE DATA COLLECTIVE SEARCH HELP
FROM A TABLE / VIEW

ELMENTARY SEARCH ELMENTARY SEARCH Collective Search


HELP 1 HELP 2 Help
What is Hierarchy / Precedence level of the search help? Important

Data: p_matnr type char18 matchcodeobject <search help>

SEARCH HELP

Priority of Search Help

Lower
FIXED VALUE

Search help at data


CHECK TABLE element level

SEARCH HELP
Search help at field
Higher
lelvel
At selection-screen
on value request for
p_matnr
5
What is Lock? And What is Lock Object in SAP DD VVI

Lock: Locking mechanism is used to maintain the integrity and consistency of the database table

Lock Object: It is the technical object through which in SAP, we maintain the Lock.

Q. When we create the lock object is there any function module gets generated after activation of the
lock object ?
Ans.-> Yes

Q. When we are going to create the lock object what naming convention we need to follow
Ans. Name must be started with EZ_ OR EY_.

Function Module

Enqueue_<lock Object> Dequeue_<lock Object>


What are the different types of Lock ?

Locking Concept in Data Dictionary:- VVI

S E X-O
Lock

Read Lock or Shared Write Lock or Exclusive


Lock(S) Lock or Exclusive and
Cumulative(E)
Exclusive but not Optimistic Lock(O)
At The same Time two
Cumulative Lock(X) By this two
or more than two If one person is trying to
user/Program can go
person/Program can change the record in a
It is the same as write into the change mode,
read the table data. table then another
Lock. But here even in but as soon as any one
person won’t be able to
same session and in the of them change some
If someone else is trying change the record in
same program by the data and click on the
to change the data then the table.
same user, lock can not save button then lock
he will not be able to By the same user and
be applied multiple gets converted into
change because some same program within
times WRITE lock
has already put the same session lock can
Read lock be applied multiple
times
What are the function module gets generated when a lock objects gets activated?

And what are the differences between them?

ENQUEUE To lock the entries in the table

To Release the lock from the


DEQUEUE
table entries
6
What is development lifecycle in SAP? What is Transport Request and When to choose Customizing and When to choose
workbench request?

DEV QUA PRE PRO(UAT) PRO

What are the important T-Codes for Transport management?

TRANSPORT REQUEST(SE09,SE10,SE01)

What is Workbench TR

WORKBENCH( ABAP CODE,


CUSTOMIZING( CUSTOMIZING TABLE )
TABLE DEFINITION )
What is Transport Requests(Main Engine) and What is tasks(Boggie)?

TR

TASK1

TASK2

TASK3
What is the difference between TR and Tasks?

TR vs TASKS
TRNASPORT REQUEST TASK
1. TR is like main engine of the TRAIN with which • It is like Bogies of the train which is attached with a
multiple bogies are attached. main engine( TR)
i.e. One TR can have multiple Tasks. i.e. One Task can have only one TR.
2. Under one TR multiple user can work at a time 2. Under one task only one user can work at a time
3. A TR can be released only when all the TASKS are 3. Task can be released independently.
released.
What is the significance of Standard Recording Routine?
Ans. If this is selected then only the TR will be asked when you save the entries in TMG ( SM30 ).

T- CODE SE54

se54
What are the main datatypes in ABAP?
Abap data types

Elementary Data Types User Defined Data Type


Predefined Data Type/Inbuilt
data type

Numeric Data Type


F( Float data type ) Non - Numeric Data Type
, C => CHARACTER
I(Integer), N => Numeric
P(Packed), D => Date
X(HexaDecimal ) T => Time
S=> String
What are the Numeric data types in ABAP? Give the answer
in detail

FIX - P
Numeric Data Types
111111….up to 64 times 1
2^64

Type Description Initial Value Length Left Justified/ Right


Justified
i Integer – 1, 2, 3, 4, 5, 0 8 Bytes(64 bits) = 2^64 Right Justified
-5, -10, -16

f Float Data 0,0000000000000000E+00 Right Justified

p Packed data type 0 1 - 65535 Right Justified


2.67, 2.98

X Hexa Decimal 00 6 Characters It is padded with the


Represenation 0
7
What are the Non Numeric Data types in ABAP?

CNDTS Lv_test type


numc5
Non-Numeric Data Types
111111….up to 64 times 1
2^64 Lv_test = 5
Type Description Initial Value Length Left Justified/
Right Justified
C Character – eg. 8 Bytes(64 bits) = Left Justified
Write: lv_test.
‘ram’, ‘shyam’,’a’, ‘b’ 2^64 00005

N Character Numeric 0 It is padded with


Data – Represented the 0
in the character
format

D Date Data type: 00000000 8 Character NA


20200811,
T Time: 075430 000000 6 Characters NA
STRING Left justified
What is user defined data types in ABAP? Important

User Defined Data type

User defined data type

DATA ELEMENT STRUCTURE TABLE TYPE

All this user defined data types can be declared / defined in two ways –
1. Global declaration using SE11 – data Element, Structure and Table type
2. Local Declaration – Only possible for Structure and Table types

Work Area Internal Table


What are the different system variables in ABAP? VI

Loop at it_tab
System Variable: into wa.
Its value get determined at runtime Sy-index
Sy-tabix
SY-SUBRC
endloop
IF SUCCESSFUL SY-FDPOS
THEN IT’S VALUE SY-TABIX THE CURRENT
SY-DATUM SY-INDEX
WILL BE 0 Current SY-UZEIT POSITION OF SY-ZONLO
CURRENT DATE Current
OTHERWISE Record of CURRENT TIME CHARACTER/ST Current Time
OF THE SYSTEM Loop
VALUE WILL BE internal OF THE SYSTEM RING WHICH Zone
Pass
OTHER THAN 0 Table YOU ARE
SEARCHING

Q. What is the structure name which holds all the system variable ?
Ans -> SYST.
What are the important/frequently used string operation in ABAP?

String Operation

Different types of String Operation:-


1. Concatenation
2. Replace
3. Search
4. Split
5. Offset
6. Shift
7. STRLN
8. Condense
What are the frequently used Character Operation in ABAP?

Character Operations-
IF ‘AABBCCEE’ CN ‘ABCD’

Character Operation

CO => Contains Only from


CN => Contains Not only from

CA => Contains any from


NA => Contains not any from

CS => Contains String


NS => Contains no string

CP => Contains Pattern


NP => Contains No Pattern
What is Internal tables? VVI

ANS. -> It is nothing but temporary table which is created within the program session to hold the
multiple records during run time. As soon as program execution is finished Internal table temporary
memory area gets released and hence content of it also destroyed.

It doesn’t store the records permanently.


What is difference between Internal Table Vs DB Table VVI

Internal Table DB Table


• Temporary - It’s get stored in temporary memory during • Permanent - It’s stored in the permanent memory. Not
the run time/session of the program. only during the program session.
• As soon as program session gets over, automatically
content of the internal table gets deleted and memory • Even after session termination/completion DB always
also gets cleared exist.
• Can not be created through SE11 • DD table(DB Table) can be created through SE 11
• Three different types of IT => • Three types of DB Table –
Standard Internal table, Sorted Internal Table, and • Transparent Table, Pool table and Cluster
Hashed Internal Table
• Technical Settings
No Technical Settings
What is internal table and What are its types?
Index Table
Internal Table
It can store the multiple records at a time
during the program temporarily .

Standard Internal Table Sorted Internal Table Hashed Internal Table


Operation: 1. Append
1. Append 2. Insert(Index)
2. Insert(Index) 3. Read
3. Read 4. Sort
4. Sort 5. Modify(Index)
5. Modify(Index)
Read < 5. Delete(Index)
table> into wa index 2 Index based search or any
5. Delete(Index)
operation is not possible in
hashed internal table. Only
possible in Index Table( Standard
Table and Sorted Table )
What is the difference between Refresh, Clear and Free ( VVI )

Refresh: Clear: Free:


It will erase the content It will erase the FIRST It will erase the value
content(value) and + Extra extent + Initial
extra Extent Extent

Refresh can be used for Clear Can be used for Free can be used free
Internal table Work Area and the object memory
Internal Table Both

Matnr mtart Initial Extent


1 roh 1st Extent
2 roh 2nd Extent
3 fert 3rd Extent
4 fert 4th Extent
What is the different types of internal table operation we have?

Internal Table Operations –

i. APPEND
ii. INSERT
iii. SORT
iv. DESCRIBE TABLE
v. READ TABLE WITH KEY – ( WITH SEQUENTIAL AND BINARY SEARCH)
vi. READ TABLE WITH INDEX – Very Fast
vii. LOOP....ENDLOOP.
viii. MODIFY
ix. DELETE
x. DELETE ADJACENT DUPLICATES
xi. CLEAR, REFRESH, FREE
xii. APPEND LINES OF
xiii. INSERT LINES OF
xiv. MOVE
xv. COLLECT
=> COLLECT STATEMENT ADD THE NUMERIC DATA TYPE FIELD TOGETHER IF LEFT SIDE FIELDS VALUE IS SAME.
=>APPEND STATEMENT WILL SIMPLY APPEND THE RECORD
8
What is field symbols and of how many types? Important

Field Symbol
It is a place holder for the data object ( Variable )

Typed Field Symbol( Fixed type


field symbol)
Generic Field Symbol
FIELD-SYMBOLS: <FS_FT> TYPE
i/c/string/p/structure/.

FIELD-SYMBOL : <FS_GEN> TYPE ANY


FIELD-SYMBOL : <FS_GEN> TYPE ANY.
TABLE.
 It will point any type of data object
 It will point any internal table
What is Data References?

Data References –
It’s Pointer to any Data object.
C Pointer – It’s a variable which stores the address of another variable

Typed Data reference


Generic Data Reference
Data: LV_TEST type ref to c/I/P/data
DATA: LV_TEST TYPE REF TO DATA
element.

Data: lv_dr type ref to i. x


Create data lv_dr. 500

Lv_dr->* = 500
10000
Lv_dr = 100
What are the pillars of dynamic programming

DYNAMIC PROGROMMING

FIELD – SYMBOLS DATA REFERENCES Object References(OOPS)


What are the control statements have in SAP ABAP? Very Important

Control Statement

1. IF <cond>
code..
ELSEIF <cond>
code…
ELSEIF <cond>
code..
ELSE
IF <cond>
code..
endif.
code..
ENDIF.

2. BREAK;
3. CONTINUE;
What is the difference between SY-TABIX VS SY-INDEX ? VVI
Loop at it_mara into wa_mara.
VVI

Endloop.

SY-TABIX( LOOP AND ENDLOOP ) SY-INDEX( NO IMPACT INSIDE LOOP AND ENDLOOP)
• IT POINTS THE CURRENT RECORD OF THE INTERNAL • IT POINTS THE CURRENT ITERATION OF THE LOOP
TABLE • THIS IS APPLICATION INSIDE ANY DO….ENDDO AND
• IT IS APPLICABLE INSIDE THE LOOP ….. ENDLOOP WHILE … ENDWHILE.
STATEMENT.
What is SQL and what are its types? Important

SQL(structured Query Language)

OPEN SQL(INDEDPENDENT OF NATIVE SQL(SPECIFIC TO DATABASE)


DATABASE)

What is the difference between Open SQL and NATIVE SQL?


Does Database understand the Open SQL Directly ? Ans. => No Important

Which component of application server layer is responsible for converting the OPEN SQL into the
Native SQL?
Ans. – Database Abstraction Interface

OPEN SQL
DATABASE ABSTRACTION
INTERFACE

MAX
What are the different types of OPEN SQL language

OPEN SQL

DDL DML
DQL DCL(DB ADMIN)
Defining DELETE,
ALL TYEPS SELECT GRANT
TABLE(create, alter ) MODIFY,UPDATE,ISER
QUERY REVOKE
SE11 ( ABAP ) T

What Properties a transaction or a database need to follow?

Answer Is – It has to follow the ACID properties -


ACID =>
A =>Atomicity => Either full or None
C=>Consistency =>
I => Isolation
D=> Durability
What are the different types of Joins? Important

3. Before NE 7.40
2.

1.

4.
What is the syntaxes for INNER JOIN and LEFT OUTER JOIN – Give some Example

*SELECT matnr spras maktx UP TO 10 ROWS FROM makt INTO TABLE it_tab.
SELECT mara~matnr mtart werks
FROM mara INNER JOIN marc ON mara~matnr = marc~matnr
inner JOIN makt on MARA-MATNR = MARKT-MATNR

INTO TABLE it_tab.

"INNER JOIN
SELECT mara~matnr mtart werks
FROM mara INNER JOIN marc ON mara~matnr = marc~matnr APPENDING
CORRESPONDING FIELDS OF TABLE it_tab.

*
"LEFT OUTER
SELECT mara~matnr mtart werks
FROM mara LEFT OUTER JOIN marc
ON mara~matnr = marc~matnr INTO TABLE it_tab.
What are the important internal table operations?

Ans. INSERT, UPDATE, MODIFY, SEARCH(READ),APPEND,SORT


What is the difference between Update and Modify?

VVI

UPDATE MODIFY
• it tries to find out the key first if it’s there it’ll update or • it tries to find out the key if it’s present then it’ll update
else it’ll leave. and if it’s not present then it’ll insert.

• UPDATE key word doesn’t to SUPPORT to the internal • MODIFY supports both Internal table and DB Table.
table. It supports only DB Table.

• UPDATE = MODIFY - INSERT • MODIFY = INSERT + UPDATE


9
What is the consideration in case of HANA Database and NON HANA DB with respect to INNER JOIN and FOR ALL ENTRIES?

DB INNER JOIN FOR ALL ENTRIES

HANA UP TO 20 Tables(NW7.40) can be FOR ALL ENTRIES can also be


used in HANA db. used.

NON HANA(ORACLE ETC) Not recommended on more than 2 In case of more than 2 tables
tables. use FOR ALL ENTRIES
What are the different types of internal table and what are basic Detail? VI

You can use append, but your data should follow the sorting
criteria
What is Primary key and secondary key and how it is defined in different internal table? VI

NOTE: IF YOU DON’T DEFINE ANY KEY EXPLICITELY THEN STANDARD KEY WILL BE PRIMARY KEY
I.E. NON NUMERIC KEY COLUMN COMBINATION WILL BE STANDARD KEY
Q. What is the difference between Standard internal table, Sorted Internal table and Hashed Internal Table? VI

Difference between Standard, Sorted and Hashed Internal table

APPEND + INSERT 3.APPEND+INSERT


BOTH POSSIBLE BOTH POSSIBLE
What are the different Modularization Techniques? And Why Modularization is its benefit?
10
What is the Mandatory Check for ALL Entries ? VVVI

Ans.
Do the INITIALITY Check for the table on which FOR ALL ENTRIES is going to be applied
i.e. Internal table must be filled then only FOR ALL ENTRIES Work properly.

What are optional best practices before using FOR ALL ENTRIES?
Ans. –
Sort the internal table on the fields where you want to use in where condition and delete adjacent
duplicates.
Remove the adjacent duplicates from the internal table on which FOR ALL ENTRIES is applied.
Select all the Key fields in Select Query if you don’t want to have the data lost( deletion of duplicate
record )

If the Internal table records is not filled then what impact will be when we use the FOR ALL ENTRIES?

All the records from the DB will be fetched. Though it is not supposed to fetch any record - All the
records from the DB will be fetched.
What is the difference between Pass by Value and pass by reference?

Pass by value: Pass by reference:

1. Data access happens by copying the value 1. Data access happens by passing the
from one variable to another variable. address of one variable to another.

2. With respect to subroutine: Changing the 2. With respect to subroutine: Changing


value in Formal parameter will not reflect back the value in Formal parameter will reflect
into the actual parameter. back into the actual parameter.

Q. In case of RFC Function module, Is it possible to have the pass by reference Parameters? VVI
Ans. -> No
Why?
Ans. -> Because, memory reference is not possible in two different session/system.
What is RFC Function Module?

RFC FM
this is basically a FM only but it can be called from outside of the current system

.net /
SAP2 java/vb

SAP1( RFC FM )

HTTPS
based SAP3
application
What is Function Module in SAP Important

Function Module is one of the most popular modularization technique in SAP.

SAP has created many standard function module and we directly use it without
understanding actual implementation process.

All the Function Modules must required a Function Group

What is Function Group?

1. It is collection of function modules which governs the function module source code.
2. All the function group is having a Master program associated with it.
3. That Master Program contains all the function modules in form of INCLUDES.
4. Whenever a function module are loaded complete function group is loaded into
What are the extra steps than normal FM need to be taken while creating the RFC FM

Extra Steps to create the RFC FM:-


1.Select the REMOTE ENABLED OPTION from attribute
2.Make sure all the parameters should be of type PASS BY
VALUE
What is Update FM ?

Update Function Module is the type of FM which is used to achieve the SAP LUW ( Either all or none )
and performance.

Function module
What is the different types of Function Module and what are the differences between them?

FM

Normal / Regular FM RFC FM UPDATE FM


1. You can call from same system or 1. This is generally used to update the
1. It can be called inside the system. from another possible. Database record

2. Here Pass by value + Pass by Reference both 2. In RFC function module you can only 2. Update FM can be called from the same system. (
have Pass by Value. if you want to use in another system then
is fine Background RFC / trfc / qrfc )
3. In the same system if you are going
to add the DESTINATION 3. This is used to achieve generally the
NONE’ while calling the RFC then it’ll be SAP LUW
called in separate session
4. Some time we use from performance
perspective also
5. When COMMIT WORK gets executed
then Update gets starts getting executed
When update function Module gets Triggered? VVI

Ans. ON COMMIT WORK

If a update function module gets failed, under which transaction we can see that?
Or VVI
What is the T-Code for monitoring the Update function module failures?

Ans. SM13
What is the Syntax for Update Function module?

Will the update function module gets triggered asynchronously or Synchronously when it is called?
Ans. -> Asynchronously(in parallel).

For what purpose generally we use the Update function module?

For SAP LUW( Either ALL or None ) and Performance Improvement


Q. When more than one Update FMs are there where is stored and what sequence it triggered?

Ans. In Update Queue and it gets triggered in the sequence in which it’s
registered and priority of the update function ( type of the update FM ).
What are the different types of Update function module and there differences?
What is Collective Run Update Function Module

COLLECTIVE RUN – UPDATE FUNCTION MODULE


From Below Diagram – Show that the sequence of Update FM execution
What will be sequence of Update FM in below Diagram?
11
What is select Options? Important
Questions
Select Options:-
It is an internal table with header line containing the field
• SIGN( IN, EX )
• OPTION ( EQ, GT,GE,LT,LE,NE )
• LOW
• HIGH
What is the event and what are those events in Report VVI

Definition: It is triggering mechanism with the help of which when we take


any action (F8 , Enter ) then particular section of code is executed.

Basic Report Event

AT LINE SELECTION
AT USER COMMAND
AT PFn(AT PF5, ATPF6 etc.)
Top of page during Line selection
End of page during Line selection
What are the different events and how is their flow in the Program? VVI
What is the difference between At selection Screen Outputs and At selection Screen VVI

At selection screen At selection screen output


• 1. Validation Purpose • Whenever any screen properties need to be changed
then this event is required.
• When we take any action on the selection screen At • Just Before displaying the selection screen this event
selection screen events gets triggered gets triggered.

• PAI of Module pool • PBO of the Module Pool


What happens when you press F8 on report selection screen and when you press Enter ?

F8=> COMPLETE PROGRAM WILL BE EXECUTED (I.E. ALL THE ALL THE EVENTS WILL BE TRIGGERED )

ENTER => if selection ONLY Two Events AT SELECTION SCREEN and AT SELECTION SCREEN OUTPUT
EVENT WILL BE TRIGGERED

What is the difference between LOAD OF PROGRAM and INITIALIZATION Events?(VVI) VVI

LOAD OF PROGRAM INITIALIZATION


1. LOAD OF PROGRAM Event will be called first 1. INTIALIZATION Event will be called after the
When a Program is executed LOAD OF PROGRAM - When a Program is
2. Load of Program Event will not be called in a executed
program when a subroutine of this program is 2. INITIALIZATION EVENT will be called in a
called from another program program when a subroutine of this program
3. This will be called only when a program is is called from another program
called through SUBMIT or F8. 3. This will be called Every time when a
4. This will be by Default event. program is accessed by any
means(SUBROUTINE)
4. INITIALIZATION need to be declared
What are the different Message types in ABAP

Below are the important message types in ABAP Which is frequently used

I-> Information message


W-> Warning message
E-> Error Message
A-> Abort Message
S-> Successful
X->For displaying the DUMP

Syntax:
MESSAGE <MESSAGE TEXT> type <MESSAGE TYPE>.
MESSAGE MSGNO(MSGID) WITH LV_PH1 LVPH2
What is the difference between Information Message and Warning message?

Information Message Warning Message

It gives the Information in pop up and Program flows as It gives you the message and it enables the selection screen
usual and it will not give you the option to change the value to enter the new value.
on selection screen. If you realize that value is correct then you can press enter
and it will move ahead from the previous step.
If you are correcting the data and press Enter then it will run
from beginning( at selection screen ).

Report: A Report:
Line 1 Line 1
Line 2 Line 2
Line 3: Information message - ok Line 3: Warning Message
Line 4 Line 4
Line5 Line5
What is the difference between Information Message, Error Message, Abort Message?

Information Message Error Message Abort Message(A):

Information Message You must have to correct the As soon as this abort
It gives the Information and Program flows as error. message encounters,
usual and it will not give you the option to change Every time program runs from Program come out from
the value on selection screen beginning the flow and go to initial
( At Selection ) sap screen.
when you press enter

SHORT DUMP: TYPE ‘X’.


When the TOP-OF-PAGE Events Triggers? VVI

When the first WRITE STATEMENT Executed.


12
Through which events we can achieve the interactive report?

Interactive Report can be achieved through –


1. AT LINE SELECTION
2. AT USER COMMAND
3. AT PFn( OBSOLETE )

What are techniques used to capture the value from Output screen(LPS)?

To capture the value below techniques are used


1. HIDE TECHNIQUE
2. GET CURSOR
3. SY-LIZEL
What is the difference between Hide Technique, Get Cursor Technique and SY-LISEL Technique?

IMPORTANT

HIDE Technique GET CURSOR Technique SY-LIZEL


1. It captures all the value written 1. It captures only that It captures the complete
with WRITE statement field value on which we content of that particular
double CLICK line

3. You have to take care of


2. You don’t have to bother about 2. You have to take care of
the conversion exit. the conversion Exit.
conversion Exit routine
3. It is quite tricky –
3. It’s very easy to get the Either use the offset
3. It’s very easy to get the data in data in the program or
the program you can use the split
command
What is the difference between AT LINE SELECTION and AT USER COMMAND?

At line selection At user – Command


It gets triggered It gets triggered
• When you double click on the line or • Doesn’t work with Double Click
• when you press F2 function key by putting the • When user take any action with the help of
cursor on the line. button where function Code is assigned
• If you click on the detail button then also it • It doesn’t get trigger with – Pick(F2)/Detail
gets triggered button.
In AT PFn what is the range for n.

Ans. - 0<n<25 :

Note: It has been Obsolete – Not supposed to be used.


What are the different Control Break Statements? VVI

AT END OF
VVI tricky

Suppose you have a internal table with 5 fields and you have written AT NEW <FIELD3>
If FIELD2 values changes then AT NEW will trigger or not?

Ans.- Yes it will trigger. Because if any value from left before control field changes AT NEW gets
triggered. So be careful while answering
What will be output for below set of records for AT NEW VVI

IT_MARA QUESTION
LOOP AT IT_MARA INTO WA_MARA. CODE

AT NEW weight.
WRITE: WA_MARA-MTART.
WRITE: WA_MARA-WEIGHT.
ENDAT
ENDLOOP. ANS.
MTART WEIGHT
FERT 0 1
FERT 0 2
ROH 0 3
HALB 0 6
HALB 0 7
HALB 8
What will be output for below set of records for AT NEW
Data types IT_MARA QUESTION
LOOP AT IT_MARA INTO WA_MARA. CODE
CHAR5 CHAR4 QUAN CHAR50
WA_MARA_C = WA_MARA.
AT NEW MTART.
WRITE: WA_MARA-MTART.
WRITE: WA_MARA-WEIGHT.
WRITE: WA_MARA-MAKTX.
ENDLOOP. ANS.
MTART WEIGHT MAKTX
FERT 20 IRON
FERT 0 *
ROH 0 *
HALB 0 *
HALB 0 *
What is the difference between AT NEW and ON CHANGE OF

13
What is the difference between AT NEW and ON CHANGE OF? VI

AT NEW ON CHANGE OF

1. Can be used inside only LOOP.. ENDLOOP 1. Can be used inside any kind of LOOP(
2. It triggers the control whenever any field DO..ENDDO, WHILE..ENDWHILE) and
from the left to the control field changes. LOOP..ENDLOOP as well.
3. Can’t be used with WHERE condition 2. It triggers the control when the particular
4. ELSE Clause can’t be used between AT NEW field is going to be changed.
and ENDAT. 3. Can be used with WHERE condition
5. AT NEW <FIELD> 4. ELSE Clause can be used without any problem
inside ON CHANGE OF and ENDON.
5. ON CHANGE OF <WA-FIELD>
What is the difference between Normal List and ALV Grid List

Reuse_alv_list_display Reuse_alv_grid_display
What type of extra field need to be added if we have to color a cell?

How to Color a particular Cell

1. To add a extra field(CELLCOLOR) of TABLE type LVC_T_SCOL in final


structure
2. Populate the final internal table with proper data like field name and color .
3. Layout-coltabi_fieldname = ‘CELLCOLOR’

Note: Cell Color takes priority over the row color


Rowcolor will take priority over the Column color

CELL COLOR Highest

ROW COLOR

COLUMN COLOR Lowest


What function modules are used to display the ALV block?

ALV BLOCK DISPLAY

REUSE_ALV_BLOCK_LIST_INIT
and REUSE_ALV_BLOCKED_LIST_DISPLAY.

VVI
If you want to make your ALV editable what to do?

If you want to edit a particular field then at field catalogue level set the
EDIT property for that particular field
For a particular field: FIELDCATALOGUE-<FIELD>, FEILDCATALOGUG-EDIT =
‘X’.
If you want to make whole ALV editable then use
LAYOUT-EDIT option.
What are the various tools are present to improve the code quality and improve the performance? VI
The various SAP Tools :
1. EPC – Extended Program Check
2. ATC – ABAP Test Cockpit
3. ST05/ST12/SE30/SAT

What is ATC and describe a little bit about it.?

ATC: ABAP Test Cockpit

Cockpit: It is central place from where you can manage everything

• ->Technical Correction
• -> Performance
• -> Code will optimized
• -> Functional Correction

Predefined variant: DEFAULT


Another Variant: PERFORMANC_DB and FUNCTIONAL_DB
What are the best practices for performance Improvement VVI
Best practices for performance improvement.
1. Inside the loop you don’t have to write the select Query
2. Avoid SELECT … ENDSELECT
2. In Select query the sequence of the field should be same as it’s there in the data base
3. You must have to limit the selected records
Technique to limit the record:
1. Use where condition( As Max as possible )
2. Use up to n Row
3. Packet Size
4. Don’t Use Select *
5. In where condition try to use those fields which is indexed
select matnr mtart from mara into it_tab where matnr eq/in
5. Non HANA DB( oracle, sybase, db2, db6, Informix , max ):
Don’t use Inner join for more than 2 tables
Don’t use the Aggregate function: MIN, MAX, AVG, SUM, COUNT
FOR ALL ENTRIES( MORE THAN 2 TABLES )
HANA DB: You can use as many tables for the inner join(20 TABLES)
MIN, MAX,AVG,SUM,COUNT
FDA with FOR ALL ENTRIES
6. Loop inside loop – you have to avoid this and =>use Parallel Cursor
7. Use the secondary Index wherever it requires => But be careful we are not supposed to create many secondary indexes
8. In case of large amount of data use binary search for READ statement
9. Don’t use Sort inside the loop “ very very bad performance wise
10. You can use LOOP AT GROUP BY instead of conventional control break
11. Loop at it_tab into wa using <secondary key>
What is Parallel Cursor and what steps need to be followed? VVI
Parallel Cursor
it is optimized way of processing the data in loop inside loop

Steps
1. Sort the data of Header table by VBELN( Sales order ) => OUTER LOOP
2. Sort the item table with the same field as header table(i.e. VBELN) => INNER LOOP
3. LOOP AT IT_HEADER INTO WA_HEADER
4. READ IT_ITEM TABLE WITH KEY VBELN = WA_HEADER-VBELN BINARY SEARCH
IF SY-SUBRC EQ 0.
DATA(LV_CURR_ROW_NO) = SY-TABIX.
ELSE.
CONTINUE.
ENDIF.
5. LOOP AT IT_ITEM INTO WA_ITEM FROM LV_CURRR_ROW_NO
IF WA_ITEM-VBELN = WA_HEADER-VBELN.
****Business Logic******
ELSE.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP
What are the different trace tools available?
TRACE

For ABAPER we mainly use now a days – ST12


Because it is combination of ST05 + SE30 + SAT ( SO MANY OPTIONS)
It provides the options of tracing the work Process Background Job etc.

ST05 – Trace( SQL Trace )

SE30/SAT => SQL Trace + ABAP Trace

Note: SAT is the replacement for SE30


ST12 => ST05 + SE30 + SAT
ST04 => BASIS PEOPLE
STAD => Work load Analysis
ST03 => BASIS PEOPLE
DBACOCKPIT => BASIS PEOPLE
What are the different types of file operation? VI

File Operation

AL11

Presentation Server File Operation Application Server File Operation

WRITE ON APPLICATION READ FROM APPLICATION


SERVER SERVER
OUTPUT INPUT
TRANSFER READ
14
How to write the file on the application server?
What are the steps to read the file from application server?
What is BDC? And where it is used?

BDC: Batch Data Communication

Batch: In Group
Data: Content
Communication: Transfer of data from one system to other system

BDC
Legacy System SAP SYSTEM

What is BDC?
When BDC? Material Creation : MM01 Customer Creation: Xd01
Why BDC? Material Change: MM02 Customer Change: Xd02
How BDC? Material Display: MM03 Customer Display: Xd03

Vendor Creation: XK01


Vendor change: XK02
Vendor Display: XK03
BDC Important Questions

Action: Madhu Q. What are the BDC Display Modes? – VVI

There are 3 Display Modes:-


1. A=> All Bdc->
2. E => Display the screen in case of Error only
3. N => None 1. Call
Transaction
LOOP AT IT_MARA. Q. What are the BDC Update Modes? – VVI 2. Session
Ans:- Method
CALL TRANSACTION ‘MM01’ 1. Synchronous
USING BDCDATA MODE ‘A’ 2. Asynchronous
UPDATE ‘A’
Q. What is the use of BDC_OKCODE in BDC
ENDLOOP.
Ans:-
This is used to capture the command.
e.g. When we are going to create the material, on the first screen after passing
all the data we have to press enter.
This ENTER will be captured by BDC_OKCODE
What is BDC SESSION METHOD?

Definition: It’s one of the powerful BDC technique which is used to process the large amount of data
In easy way because here the error handling and reprocessing the error content by correcting is very
easy.

Q. What is the t-code where we can see the created session and we can process the
session?
Ans – SM35
What is the difference between Call Transaction and session method? VVI

Call Transaction Session Method:

1. It is suitable for small amount of data 1. It’s good for large amount of data
2. It’ is very fast ( Why? Ans - if you use the 2. This session method is comparatively slow ( Why ? - It always run in
asynchronous mode(PARALLEL), it is going to be synchronous mode )
faster ) 3. Error handling is very easy – Why? When you get any error, you can
3. Error handling is difficult. Why? Every time if you manually correct that error by running in foreground and correct and
get some error you have to correct your file and bend and again execute in background.
remove the processed data and execute the 4. Only synchronous Mode is possible.
program 5. To process the recorded session you need to go to T-CODE SM35
4. Two running mode Synchronous and asynchronous. 6. Here need to open the session using BDC_OPEN_GROUP fm, Insert the
5. Here you don’t have to go to any other t-code data using BDC_INSER fm, close the session using BDC_CLOSE_GROUP
6. No need to open any session fm.
15
Q. What is the 2nd name of Session Method?

Ans. Batch Input method

Q. Which structures are referred while creating the BDC Internal table? -VVI

Ans.- BDCDATA

Q. What are the components of BDCDATA structure?

Ans.- PROGRAM,DYNPRO,DYNBEGIN,FNAM,FVAL
What are the function Modules involved for creating the Batch session method?

Ans. –
BDC_OPEN_GROUP. -> To open the session.
BDC_INSERT. -> To insert the transaction data
BDC_CLOSE_GROUP.-> To close the session.

What are the two methods to execute the BDC session method?

Ans. There are two methods –


1. Using SM35 – This is manual execution and
2. Executing the program RSBDCSUB – This is useful for automatic execution.
This program can scheduled in background on regular interval to execute the
session.
What is the use of HOLD DATE Parameters in BDC_OPEN_GROUP?

This parameter is used to lock the session up to the desired date by passing the date
value into it.
What is the use of KEEP Parameter in BDC_OPEN_GROUP FM?

Harkesh: While creating the FM if we pass the parameter as TRUE(‘X’) then after
successful execution of the session, session will still remain.
Do this
research If we pass the blank value (‘’) then session will be deleted automatically after
successful execution.
After 5
records if
internet is What is the importance of POST_LOCAL parameter in BDC_INSERT?
down in our
local desktop?
This is used to run the Update function module locally in same work process
rather than Update function Module.

i.e. It’s behavior is same as SET UPDATE TASK LOCAL


15
Which Structure is to used to collect the messages from Call Transaction? -VVI

Ans. - BDCMSGCOLL

What is the difference between Synchronous and Asynchronous Update? -VVI

Ans. – Below is the difference -

Synchronous Update( Asynchronous Update(


Sequential Update ) – Parallel ) –
1. It is slower 1. It is faster
2. The return code(sy-subrc 2. The return code(sy-subrc
value) of the Synchronous value) of the
update indicates the Asynchronous update
success or failure of the T- indicates the success or
Code + Update in Data in failure of the T-Code only
DB. not the update of data in
Which BDC method Allows multiple Transaction to be executed

Ans. – BDC Session Method allowed multiple Transaction to be inserted in one go


using the BDC_INSERT FM in a Single session.
What should be the approach to write a BDC program? VVI

1. Go to SHDB and record the transaction for which the data is to be created into the SAP System.
2. Use the Recording to create a Program automatically by clicking on Program Button .
3. Now modify that program as per your need.
4. Say if you are uploading an text file available in presentation server then use function modules to
upload excel file data into internal table.
5. Then put a loop on internal table to populate the data in BDCDATA internal table in such way that it should be
in form of same as the SHDB recording data .
6. Finally CALL TRANSACTION statement can be used to process the data present in the BDCDATA table and handle
the message in internal table of TYPE Table BDCMSGCOL
What is CTU Parameters in BDC? - VVI
CTU_PARAMS is a structure which has components used to control processing of CALL_TRANSACTION. This structure is used to provide display
mode, update mode, default size and more control components to the Call Transaction statement.

The different components available in CTU_PARAMS are:

DISMODE - Processing Mode


A - All Screens
N - No Screens
E - Only Error Screens

UPMODE - Update Mode


S - Synchronous
A - Asynchronous
L - Local

CATTMODE - CATT Means Computer Aided Test Tool


Blank - No CATT Mode,
N - CATT Without Single Screen Control
A - CATT With Single Screen Control

DEFSIZE - Default Size For Screen resolution. 'X' - Yes, ' ' - No.

RACOMMIT - Do not end transaction at COMMIT WORK. 'X' - Yes, ' ' - No.

NOBINPT - No batch input session active (that is, SY-BINPT = SPACE). SY-BINPT is always space during a CATT procedure. 'X' - Yes, ' ' - No.

NOBIEND – No Batch input session active after end of BDC data 'X' - Yes, ' ' - No.
Explain A Scenario Where NOBINPT Component OF CTU_PARAMS Can Be Used In BDC?

Ans.
The error message that usually comes in status bar while you are running the transaction online
might appear in a popup window when you are running that in batch. This will make your fields
disabled for input. This OPTIONS addition will remove this problem
What is the different F-Code and their meaning

F-CODE Explanation
/BBEG Restart the Transaction

/N Go to Next Transaction – Terminate the current Transaction, Mark the


transaction as incorrect, and pass to the next transaction.

/BDA Change the Screen processing from error only mode to All display mode

/BDE Change the Screen processing from all display mode to Error only Mode

/BEND End current Input batch session completely


How to create a Custom BAPI

1. Custom BAPI name must be started with ZBAPI/YBAPI

2. All the importing and exporting parameter’s name should be started ‘ZBAPI’

3. All the types for the parameters should be of structure type

4. because it’s RFC function module – so all the parameters must be pass by value

5. BAPI must have a retuning message parameter of type BAPIRET2

6. Once you register the RFC with Custom Object then it will become the BAPI

MATNR TYPE LS_MATNR ZBAPI_FM


RFC vs BAPI VVI

RFC BAPI

1. It is the procedural concept 1. It is the object oriented concept

2. All the RFC is not BAPI 2. All the BAPI must have to RFC

3. Communication with External world is little tricky 3. When an RFC gets registered with BO, then it
becomes the BAPI
4. RFC typically not represent a complete business unit
4. It is easy to communicate with External world(NON
sap system)

5. Typically BAPI represents a complete business unit


Enhancement

SAP ( Standard Program ) Enhancement

1. Direct Code Modification – Very Very risky. Not recommended at all.


Problem: 1. When new version of the SAP software comes and you install in your system then your custom code will be overwritten. Your hard work is gone.
2. There is very much possibility that you are going to disturb the SAP standard functionality

2. User Exit – It is in form of subroutine.


Name is started with user-exit*
All the user exits are segregated under the different INCLUDES
That INCLUDES is not going to be disturbed by SAP
RISK is also minimized over here because user exit is given only at some certain places
It requires the access key
More accessibility over the global variable – so the writing/maintaining the code is easy

Problem: It requires the Access Key. If you don’t want to get the access key you can use the implicit enhancement option
This user exit is only available in SD( Sales and Distribution )
Because we are going to use the subroutine to modify the code, there is a risk that we can disturb the potent ial global variable.
Customer Exit
CUSTOMER EXIT
CALL CUSTOMER-FUNCTION ‘XXX‘
Exporting
Importing
Tables
exception
Where XXX is 3 digit number which is representing the unique customer Exit
Function Module: <exit><program name which is calling this FM><3digit>
1. It is in form of Function Module
2. Here you neither require an access key nor Implicit enhancement because the place
where you are supposed to write the code will be under customer Name Space
3. You need to create a Project in order to implement the Customer Exit
How to Search the customer exit
1st Way: -
Identify the program and search globally with CALL CUSTOMER
2nd Way:-
Use the T-Code SMOD to Search the CUSTOMER EXIT
Difference b/w Customer exit and User Exit VVI

Customer Exit
User Exit
1. This is in form of FM
1.It is in form subroutine 2. It doesn’t require any access key
2.It requires the Access 3. You don’t have access for the global
3.You have the access for the global variable – only you can have the access
variable which is risky for parameters( importing exporting
4.It is only available in SD Module etc.)
5.It doesn’t require any project to be 4. It’s available in all module
created 5. It’s is not that much risky as user exit
6. You need to have created on project in
order to implement customer exit.
SMOD/CMOD VVI
SMOD: it is to find the Customer Exit

CMOD: it is to implement the customer Exit

Note: The same Customer Exit can not be implemented in two different project

Implicit Enhancement and Explicit Enhancement

Explicit Enhancement :
Enhancement section
Enhancement spot
Enhancement Point

Q. Difference Between Explicit and Implicit Enhancement ?


Q. What is the difference between enhancement section and enhancement point ?
Implicit Enhancement

1. Function Module: in beginning and at last


2. Subroutine: In beginning and at last
3. Class method: in beginning and at last

Explicit Enhancement

Enhancement Section
One section can be implemented at
Enhancement Point. one time.
Previous code will be also called Only one implementation will be
along with new code. called at one time.
Suppose another developer is going
to write the piece of code under the
same section then the previous code
will not work.
BADI: Business Add Ins
OOPS Oriented Concept
Basics of OOPS

1. Encapsulation: Putting attributes and methods together in the class


2. Inheritance: Child class/subclass is inheriting the property from the Super Class
3. Polymorphism: Same object is going to play the different role in different environment.
To achieve the polymorphism we are going to use the INETERFACE/ABSTRACT CLASS

Class:

Global Class(
SE24) Local Class (se38 )
Reusability No reusability
Class

Public Protected Private


It is only inside the Only within the same class
AT DIFFERENT PLACES subclass
LIKE PROGRAM
REPORT , FM

ZMB28APRREPORT.
Object : Instance of the Class. Once a class is instantiated, one memory area is allocated where all the
attributes and class are present OBJECT
BADI: Business Add Ins / How to find the BADI

BADI( TWO TYPES OF BADI)

NEW BADI/KERNAL
CLASSICAL BADI/OLD BADI 1. it’s implemented at KERNAL Level
1. It is implemented at application layer 2. It’s very fast because this BADI is implemented at Kernel level
2. It is relatively slow
3. It can be found by CL_EXITHANDLER Note: Kernel is the Core of SAP NetWeaver. This is Operating
System of the NetWeaver
3. It can be found by GET BADI and CALL BADI
How to find out the Classical BADI? VVI
How to Identify the BADI(Classical)

Ans. – 1ST Way-


Go to CL_EXITHANDLER
Go inside the method GET_INSTANCE
Put the break-point on GET_CLASSNAME_BY_INTERFACE
List down all the possible BADIs.

2nd Way – Using SE84/SE85/SPRO

How to Identify the New BADI?

Se18: To check out/Display the BADI definition


SE19: To implement the BADI
Q. Under BADI implementation is it important to activate all the methods of the implementing class? VVI
Ans.- Yes, if we don’t activate all the methods it’ll give the error. It will tell that some of the methods are not
implemented.

New BADI/ KERNAL BADI


GET BADI
Put the dynamic Break-Point on GET BADI and list out all the BADIs.

CALL BADI
How Implementation of NEW BADI is called in the program
Ans. – CALL BADI
What is the Criteria of using a BADI for multiple implementation
5-7 Years experience:
What is Filter BADI ->
What is Fall Back Class ->

All the implementation will be called for that BADI


1. ZCL_IMPL1
Sequence can’t be decided that in which sequence
this BADI implementation will be called
2. ZCL_IMPL2

3. ZCL_IMPL3

BADI
Multiple Use

Fall Back Class : ZCL_DEFAULT_CLASS


In case none of the implementation is active then the by default class can be
mentioned under the fall back class so that it will be called.
Module Pool Programming: Screen Programming/ Dynpro Programming( Front End Technology )
Last 7 to 10 Years: FIORI / UI5 Frame work ( Web Technology )

GUI FIORI

APPLICATION SERVER NW7.53

DATABASE SERVER DATABASE SERVER


HANA
Module Pool

Q. What are the events in Module Pool programming. (VVI)

Ans.
1. PAI-> Process After Input
2. PBO-> Process Before Output
3. POH-> Process on Help Request(F1) ( Technical Settings or Documents )
4. POV -> Process on Value Request(F4) ( search Help )

PBO ( At selection PAI( At selection Screen)


screen output)
Report: - Note

By default 1000 Screen Number is dedicated as Selection Screen under report


=> when you use some parameters or select options in report automatically the 1000 number screen is generated as selection screen.
Module Pool Validation

Q1. Suppose you have a mandatory field defined on the screen and you want to go back, or cancel or exit. Will you be
able to go back normally? ( VVI )
Ans. No. Not possible. It will ask to fill the mandatory field

Q2. How to Handle this Scenario? (VVI )


Ans.
1. Go to the GUI STATUS(SE41) and select the function type as “EXIT COMMAND” of the function code
2. You will have to define a module for “AT EXIT COMMAND” and in that module, you have to write the code to handle
the BACK, CANCEL or EXIT button.
SUBSCREEN1

500

SUBSCREEN1 SUBSCREEN2
VALIDATION

1. Automatic Validation-> Selecting the mandatory field from screen properties

2. FLOW Logic Validation-> Under the flow of the program itself we are going give the allowed values

3. Module pool Validation-> In the program you can write the logic to implement the validation

3. Flow Logic Validation: - Field: <field name> values ‘1’ ‘2’ ‘3’

Action on Me:
Check the Flow logic Validation
Check the BETWEEN COMMAND
Q. What is the difference between Chain and Field command? (VVI )
OR.
Q. If you have one field to validate in Module pool then what technique you will use?
Ans. - FIELD Command

Q. If you have multiple fields to be validated, then what technique will be used?
CHAIN.
FILED ‘FIELD1’.
FIELD ‘FIELD2’.
FIELD ‘FIELD3’.
ENDCHAIN.

Q. If you don’t use CHAIN and ENDCHAIN What problem will occur.
Another field will be grayed out apart from the one which we are validating currently.
What are the different Function Modules used for displaying the help document?
Assignment –
https://answers.sap.com/questions/4467757/f1-help-for-field.html
Use the below FM to display the Help Request for a Field.

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'


EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.

CALL FUNCTION 'DSYS_SHOW_FOR_F1HELP'


EXPORTING
* APPLICATION = 'SO70'
dokclass = 'TX'
DOKLANGU = SY-LANGU
dokname = 'Z_DHANU_DEMO'
Debugging

1. Development Q. How to access a current row in Table Control ( VVI )


2. Support project
3. Migration project
4. Upgrade Project Ans.

Debugging is used every where. But mostly it used in Support


Project

Intermediate level : https://youtu.be/CnesPBeAzLI


What are the different Function Modules used for displaying the search help

Search Help – Use the below FM to Demonstrate The Search Help

1. 'F4IF_FIELD_VALUE_REQUEST‘ => Use this FM to Display the Search Help Value as assignment
2. ‘F4IF_INT_TABLE_VALUE_REQUEST’ => Already we have seen( You can explore more)
SCREEN Navigation

1. LEAVE TO SCREEN 2. SET SCREEN 3. CALL SCREEN 3. LEAVE TO SCREEN 0

PAI(100) PAI(100) PAI(100) It will go to the


CASE SY-UCOMM CASE SY-UCOMM
WHEN ‘CALL_500’ CASE SY-UCOMM WHEN ‘BACK’ previous screen
LEAVE TO SCREEN 500 WHEN ‘BACK’ CALL SCREEN 500
LINE1. SET SCREEN 500 ENDCASE.
LINE2. ENDCASE. MODIFY
ENDCASE. MODIFY IF
MODIFY IF BUSINESS LOGIC
IF BUSINESS LOGIC
BUSINESS LOGIC ENDOFPAI
ENDOFPAI
ENDOFPAI AS SOON AS THIS STATEMENT IS
ENCOUNTERED, IT WILL LEAVE THE
AS SOON AS THIS STATEMENT IS CURRENT FLOW AND GO TO THE
AS SOON AS THIS STATEMENT IS ENCOUNTERED, IT WILL NOT LEAVE SCREEN 500. You will not loose the
ENCOUNTERED, IT WILL LEAVE THE THE CURRENT FLOW INSTEAD IT WILL connection with previous screen.
CURRENT FLOW AND GO TO THE EXECUTE ALL THE REMAINING LOGIC AGAIN IF YOU WANT TO COME BACK
SCREEN 500 AND THEN AFTER IT WILL GO AND RESUME THE PROCESSING THEN
YOU CAN COME BACK USING ‘LEAVE
TO SCREEN 0’
Break-Point What are the different types of Break-Point?

Types of Break Point

oint during the Debugger Session Break Points External Break Points
( Debugger Break-Point ) During the ABAP Session. Only for 2 Hours
he Debugger session it will
e. AS soon as you will come External
m the debugger, It will be System
.NET /
JAVA/NON SAP SAP
Z_UPDATE_FM System
ABC
1. SET THE EXTERNAL break-POINT ON UPDATE SAP System
FM ‘DEF’
2. Enable The Update debugging in Debugger
Dynamic Break Point

ASSIGNMENT Message id = ZMSG


MSG NO = 10
1. Practice Dynamic Break-Point - VVI Message : TEXT-001 type ‘E’
2. Practice (Shift + F8, SHIFT + F12 )
3. Practice Model Dialogue Box
4. Practice Screen Navigation - VVI

How to find the custom Code in the standard Program –


1. Any kind of Enhancement ( User Exit/ Customer Exit/ Implicit Enhancement / Explicit
Enhancement/BADI/BTE(FI/CO)

Ans.- Program Name: - SNIF


1. Trace ( ST05,SAT,SE30,ST12 )
2. Layer Aware Debugging – Very Handy
What to do if my Debugger is not getting triggered though I am setting the Break-point??

Try with the below steps and check –


1. Put the external break point instead of Session break-point
2. Enable the Update Debugging mode in Debugger.
How to Change the Table entries in SAP

1. 1st Way- SE11


include Name: LSETBF01
Subroutine - SET_STATUS_VAL

2. SE16 – Same as SE11

3. SE16N: GD-EDIT = ‘X’


AND GD-SAPEDIT = ‘X’ (OPTIONAL).

4. SE16_INTERFACE
How to DEBUG the RFC from another system

External User Id
Forms

Forms:- This is to represent the legal document


1. SAP Script( Old ) -> Old Technology + Client Dependent + Language Dependent
2. Smart forms -> Powerful and flexible + Client Independent + Language Independent
3. Adobe Form -> Powerful and flexible + Client Independent + Language Independent

Sap script Smart forms

Client depedent Client independent

this doesn’t generate any fm after When you activate smartform it generates the FM
activation.

Saved into table Stxh and stxl The generated FM is saved in some cluster table
SMARTFORMS

Q. What is the T-Code ?


Ans. – SMARTFORMS

Q. Is smart form is Client Independent ?


Ans. Yes. It is Client Independent.

Q. Why SMARTFORM is Client Independent ?


Ans. Because it generates a FM, and FM is client independent , Hence it’s client independent

Q. Why SAP SCRIPT is Client Dependent ?


Ans. SAP SCRIPT gets stored in two tables – STXH and STXL and both the tables are client dependent table
hence it is client dependent.
This is also language dependent because it gets stored in form of Text.
What is the Difference between Smart forms and Adobe forms

What is the benefit of Adobe form

Sap smart forms Adobe forms


Similarity Similarity
1. When you activate the Smart form, It will generate the 1. When you activate the Adobe form, It will generate
Function module. the Function module.
2 .It supports the all the Color format 2. It supports the all the Color format
Differences: Differences:
1. SAP Smart forms is not accepted standard world wide 1. Adobe is the Accepted Standard world wide
2. This doesn’t support the Unicode format 2. It supports the Unicode format
3. ABAP Code can be written in SMARTFORMS itself 3. Design and ABAP logic both are different artifact
4. It doesn’t support the Java Script/any kind scripting 4. It supports the Java Script code/formcalc
language 5. It can be used for interactive adobe form
5. Collaboration/Interaction is not possible in SAP Smart 6. SFP
forms 7. FP_FUNCTION_MODULE_NAME
6. T-Code: SMARTFORMS
7. SSF_FUNCTION_MODULE_NAME 8. We don’t have such templated
8. Table Templates are available
How to handle the Smart form call in different System

QUALITY PRODUCTION SYSTEM


DEV
Sf=> ZMB23APR_DEMO Sf=>ZMB23APR_DEMO
Sf=>ZMB23APR_DEMO
Progr=>ZMB23DEMO1 Progr=>ZMB23DEMO1
Progr=>ZMB23DEMO1

Ans. We have to use the function module: SSF_FUNCTION_MODULE_NAME


SE38-> DRIVER PROGRAM in order to get the correct function module for the given smart form in the
respective system.
Some Some Questions

Why we should use the Update Function Module?

1. LUW( Either all or None )


2. Performance ( It is called Asynchronously )
What is the difference b/w New BADI and Classic BADI ?

Kernal BADI/ New badi Classical BADI / Old BADI

1. It is very-very fast 1. It is not comparatively that much fast as new


BADI because it is implemented at application
2. Get badi, call badi server layer
3. GET BADI 2. Call method
3. CL_EXIT_HANDLER
Debugging Technique
Use dynamic breakpoint on WRITE_FORM, SSF_FUNCTION_MODULENAME and FP_FUNCTION_MODULE_NAME To stop
the control
SESSION METHOD
REPORT zmb28aprautomatbdc.

PARAMETERS: p_sess TYPE apqi-groupid.


DATA: itab_apqi TYPE TABLE OF apqi.

*Step 1 : Get BDC Queue ID


CALL FUNCTION 'BDC_OBJECT_SELECT'
EXPORTING
name = p_sess
* session_creator = sy-uname
datatype = 'BDC'
* client = sy-mandt
* qstate = ' '
* date_from = sy-datum
* date_to = sy-datum
TABLES
apqitab = itab_apqi
EXCEPTIONS
What is ABAP Memory and SAP Memory?
Field1 type defield1
Gv_value = 20
Set parameter ‘MAT’ FIELD gv_value
Shared Memory
Call transaction MM01

Sap memory Abap memory

Program1 Program2

Different Program 1 Program 2


Your session
session
Submit program2. Internal table
Set parameter ‘abc’
Single Session Variable
field <value>
Get
parameter Import to it_this_tab Export it_table to
‘abc’ from ‘abc’. memory ‘abc’.
QUL
DEV

SMARTFORM: ZTESTSF
SMARTFORM: ZTESTSF
FM: /FM0021
FM: /FM001

Driver Program
Driver Program CALL ‘SSF_FUNCTION_MODULE_NAME’
CALL ‘SSF_FUNCTION_MODULE_NAME’ EXPORTING
EXPORTING FORM = ZTESTSF
FORM = ZTESTSF IMPORTING
IMPORTING FMNAME = LV_FMNAE
FMNAME = LV_FMNAE

Call fm LV_FMNAE
Call fm LV_FMNAE

You might also like