0% found this document useful (0 votes)
68 views63 pages

SAP ABAP Interview Questions

Uploaded by

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

SAP ABAP Interview Questions

Uploaded by

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

SAP ABAP Interview Questions Part 1

Looking for ABAP interview questions? You have come to THE RIGHT place. I have
planned to
continuously update this blog post. So if you have been appearing for interviews
recently , share your experiences in the comments below:

Let’s make this list count and add some value to everyone.
All the best for your interview preparation .  Here you go!!

SAP ABAP interview questions:

Important

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
control, but more risk of making the system of the Function Module. So you have
unstable. limited 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 RFC is nothing but a remote enabled
APIs OR Facebook offers APIs for function module. So if there is a Function
Comment/Like, SAP offers APIs in the form Module in SAP system 1 on server X , it can
of BAPIs. BAPI is a library of function be called from a SAP system 2 residing on
modules released by SAP to the public so server Y.
that they can interface with SAP.
There is a Business Object Associated with No Business Object is associated with a
a BAPI. So a BAPI has an Interface, Key RFC.
Field, Attributes, Methods, and Events.
Outside world (JAVA, VB, .Net or any Non Non–SAP world cannot connect to SAP
SAP system) can connect to SAP using a using RFC.
BAPI.
Error or Success messages are returned in RFC does not have a return table.
a 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 SMARTFORM generates a Function Module
Function 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
used for Page protection. Page 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.

http://www.slideshare.net/uttamagrawal1/smartforms-interview-questions-with-answers

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 Subroutine can be called from other
is defined. programs also.
Macro can have maximum 9 parameters. Can have any number of parameters.
Macro can be called only after its This is not true for Subroutine.
definition.
A macro is defined inside: Subroutine is defined inside:
DEFINE … FORM …..
…. …..
END-OF-DEFINITION. ENDFORM.
Macro is used when same thing is to be Subroutine is used for modularization.
done 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 When you are using the EXPORT IMPORT
Parameter ID command, you are using the Statements, you are using the ABAP
SAP 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 stored in ABAP memory can be accessed
session from a terminal. only in one session. If you are creating
another session, you cannot use ABAP
memory.
Important
Question 8: What is the difference between AT SELECTION-SCREEN and AT
SELECTION-SCREEN OUTPUT?
AT SELECTION-SCREEN is the PAI of the selection screen whereas
AT SELECTION-SCREEN OUTPUT is the PBO of the selection screen.

Question 9: What is the difference between SY-INDEX and SY-TABIX?


Remember it this way  TABIX = Table.
So when you are looping over an internal table, you use SY-TABIX.
When you use DO … ENDDO / WHILE for looping, there is no table involved.
So you use SY-INDEX.

For READ statement, SY-INDEX is used.

Question 10: What is the difference between VIEW and a TABLE?A table physically
stores data.
A view does not store any data on its own. It can contain data from multiple tables and it
just accesses/reads data from those tables.

Question 11: What is the difference between Customizing and Workbench


request?A workbench request is client independent whereas a Customizing request is
client dependent.
Changes to development objects such as Reports, Function Modules, Data Dictionary
objects etc. fall under Workbench requests.

Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.

In short, generally a developer would end up creating a Workbench request and a


Functional Consultant would create a Customizing request.

Question 12: What is the difference between PASS BY VALUE and PASS BY
REFERENCE?These concepts are generally used for Function modules or Subroutines
etc. and their meaning can be taken literally.

Say we are passing a variable lv_var:


CALL FUNCTION 'DEMO_FM'
EXPORTING
VAR = lv_var.

When we PASS lv_var by VALUE , the actual value of lv_var is copied into VAR.
When we PASS lv_var by REFERENCE , the reference or the memory address of lv_var is
passed to the Function module. So VAR and lv_var will refer to the same memory
address and have the same value.

Question 13: What is the difference between Master data and Transaction
data?Master data is data that doesn’t change often and is always needed in the same way by
business.
Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc.

Transaction data keeps on changing and deals with day to day activities carried out in
business.
Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction
Data. So data related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data

Some important transactions here for Master Data:


Material: MM01 MM02 MM03
Vendor: XK01 , XK02 , XK03
Customer: Xd01 , XD02 , XD03

Some Important transactions for Transaction data:


Purchase Order: ME21n , ME22n , ME23n
Sales Order: VA01 , VA02 , VA03
Goods Receipt: MIGO
Invoices: MIRO

Important
Question 14: What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
There is great confusion over this in the SAP arena.
If you Google, you will see lots of results that will say SELECT SINGLE is faster and
efficient than SELECT UPTO 1 ROWS.
But that is 100% incorrect.

SELECT UPTO 1 ROWS is faster than SELECT SINGLE.


If for a WHERE condition, only one record is present in DB, then both are more or less
same.
However, If for a WHERE condition multiple records are present in DB, SELECT UPTO 1
ROWS will perform better than SELECT SINGLE.

Difference between SUM and Collect?


Sum will add the whole internal values and store in the first line of the internal
table.

Collect will add the common key values in the internal table and store in the
corresponding key field.
Question 15: What is the difference between .Include Structure and .Append structure?
I have seen ridiculous answers for this at many places on the Web.
The true answer is this:

Let’s say you want to use the Structure X in your table Y.


With .Include X, you can include this structure in multiple tables.
With .Append X, you specify that structure X has been used in table Y and that this
cannot be used in any other table now. So you restrict structure X only to Table Y.

Important
Question 16: Can you describe the events in ABAP?

LOAD-OF-PROGRAM:
INITIALIZATION: If you want to initialize some values before selection screen is called
AT SELECTION SCREEN OUTPUT: PBO for Selection Screen
AT SELECTION SCREEN: PAI for Selection Screen
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE

AT USER-COMMAND: When user click on say buttons in application toolbar. SY-


UCOMM
AT LINE SELECTION: Double click by user on basic list. SY-LISEL
AT PF##: When User Presses any of the Function Keys
TOP-OF-PAGE DURING LINE SELECTION

Question 17:

What events do you know in Module Pool Programming?


PBO: you know this . If not you should know this . That's basic.
PAI: You know this. If not you should know this . That's basic.
POV: Process on Value request … i.e. when you press F4.
POH: Process on help request … i.e. when you press F1.
Question 18: Can you show multiple ALVs on a Single Screen?
Yes, there are multiple ways of doing this:
· If you are using OOALV, you can create multiple custom containers
(cl_gui_custom_container) & put an ALV control (cl_gui_alv_grid) in each of those.
· You can even use a Splitter container control and place multiple ALVs in each of
the split container.
· If you are using Normal ALV, You can use the following FMS:
1. REUSE_ALV_BLOCK_LIST_INIT
2. REUSE_ALV_BLOCK_LIST_APPEND
3. REUSE_ALV_BLOCK_LIST_DISPLAY
Question 19: A system has two clients 100 and 500 on the same application server. If
you make changes to a SAPSCRIPT on client 100, will the changes be available in client
500?

No. SAPSCRIPT is client dependent. You will have to transport changes from client 100
to client 500. However, for SMARTFORMS, Changes will be made both for client 100 and
client 500.

Question 20: There are 1000’s of IDOCs in your system and say you no longer need
some of them? How will you get rid of those IDOCs?

One way is to archive the IDOCs using transaction SARA.


But what the interviewer was expecting was ‘How do you change IDoc Status’?
There are different ways of doing this:

A) Use FM IDOC_STATUS_WRITE_TO_DATABASE

B) USE FMs:
EDI_DOCUMENT_OPEN_FOR_PROCESS and
EDI_DOCUMENT_CLOSE_PROCESS

Question 21: What is the difference between CHAIN … ENDCHAIN and FIELD
commands in Module Pool?

If you want to validate a single field in Module Pool, you use the FIELD Command.
On error, this single filed is kept open for input.

If you however want to validate multiple fields, you can use the CHAIN … ENDCHAIN
command. You specify multiple fields between CHAIN and ENDCHAIN.
On error, all fields between CHAIN …… ENDCHAIN are kept open for input.

Question 22: What are the types of Function Modules? What is an UPDATE
function module?There are three types of Function Modules: Normal , RFC , UPDATE.

The aim of the Update function module is either to COMMIT all changes to database at
once or to ROLLBACK all the changes. By definition, an update function module is used
to bundle all the updates in your system in one LUW (logical unit of work).

This FM is called whenever COMMIT WORK statement is encountered in the calling


program and the way you call it is CALL FUNCTION XXX IN UPDATE TASK.

Have a look at FM EDI_DOCUMENT_CLOSE_PROCESS_UPD and do a where used.


This FM is used as Update FM in case you make changes to IDoc contents/status via
your program.

Question 23: How is the table sorted when you do not specify field name and
Ascending or Descending? On what criteria will the table be sorted? Do internal table
have keys?

Yes, internal table have keys.


The default key is made up of the non-numeric fields of the table line in the order in
which they occur.

Question 24: Explain what is a foreign key relationship?Explain this with the help of
an example.
Let’s discuss about tables EKKO (PO header) and EKPO (PO line item).
Can you have an entry in table EKPO without having an entry in table EKKO?
In other words can you have PO line items without the PO header?

How does this happen? The answer is foreign key relationship.


So foreign keys come into picture when you define relationship between two
tables.

Foreign keys are defined at field level.


Check the foreign key relation for field EBELN of table EKPO.
The check table is EKKO. This just means that whenever an entry is made in EKPO, it is
checked whether the entered value for EBELN already exists in EKKO. If not, entry
cannot be made to EKPO table.

Question 25 : What is the difference between a value table and a check


table?Check table is maintained when you define foreign key relationships.
For Check table, read question above.
.
Value table is defined and maintained at a domain level.
At a domain level, you can mention allowed values in the form of:
1) Single values
2) Ranges
3) Value tableFor example, have a look at domain SHKZG. Only allowed values are S and
H for Debit/Credit indicator. Whenever and wherever you use this domain, the system
will force you to use only these two values: S and H.

Another example is domain MATNR. For this domain the value table is MARA.
So whenever and wherever, you use this domain the system will force you to use values
for MATNR in table MARA.

Question 26: How do you find BAPI?Approach1:


You can go to Transaction BAPI and then search for your desired object.
Say you want to find a BAPI for creating users in the system, in such case you can search
for the ‘User’ and find the relevant BAPIs.

Approach2:
Another way is to find a Business Object. Say you want to find a BAPI for creating
Material in SAP and you know the BO for Material is BUS1001006. You can go to
Transaction SWO1 and enter the BO BUS1001006 in the BOR. Then have a look at the
methods for this BO.

Important
Question 27: How do you find BADI?
Approach1:
Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in
method GET_INSTANCE.Now go and execute your transaction code for which you want
to find BADI.
You will find the BADI in the changing parameter exit_name:

Approach 2:
Go to Tcode SE84  Enhancements BADIs  Definitions.
Find the package for the Tcode for which you are finding the BADI.
Enter it as shown and hit execute:
Are we done yet ? Definitely not !
Let the questions come and lets keep on updating this blog.

I will update the blog with the following questions soon:


Question: Synchronous and asynchronous methods in BDC ?
Question: What is the difference between inner joins and outer joins?
Question: What is the difference between INSTANCE methods and STATIC methods?
Question: What is the difference between Implicit Enhancements and Explicit
Enhancements?
Question: What is the difference between Enhancement point and Enhancement
Section?
Question: How do you find Function Exit?
Question: How do you activate a Function Exit?

SAP ABAP Interview Questions Part 3 : Smartforms

Welcome to yet another post on ABAP interview questions. Here I have complied a list of
interview questions on Smartforms in SAP. This list is quite comprehensive. Hope you find it
useful. Cheers !!

Smartform is SAP's print form technology and is an alternative to SAP-Scripts. Whenever you
activate a Smartform , a function module is generated for that Smartform. The program that
calls this function module is called the Driver Program for Smartform. The T.code for
Smartforms is SMARTFORMS.
Unlike SAP-Scripts, Smartforms are client independent.

Here we go:
*An SAP R/3 system has 2 clients 800 & 810. You create an SAP Script Z_Script and a
Smartform Z_Smartform in client 800. Will both Z_Script and Z_Smartform be available in
client 810 as well?
Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script.

SAP-Script is client dependent whereas SMARTFORM is client independent. Many people don't
understand what this is all about. The above answer should suffice. However, if you still do not
understand this, find an SAP system where you have 2 clients. Create a dummy Smartform /
script in one client and check whether they exist in the other client.

*You have created a Smartform in DEV environment. Then you migrated the Smartform to
PROD environment. Will the name of the function module be same in DEV and PROD?
Once you transport the Smartform from DEV to PROD environment, a new function module
name for the Smartform in generated in the PROD environment. For a particular Smartform ,
generated function module names are different in different systems.One can get the name of
the function module for Smartform by passing the Smartform name to FM
SSF_FUNCTION_MODULE_NAME.

Hence in the driver program for Smartform, it is common practice to use FM


SSF_FUNCTION_MODULE_NAME and then calling the Smartform Function Module.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
formname = 'Z_SMARTFORM'
IMPORTING
fm_name = lv_fm_name

CALL FUNCTION lv_fm_name

*How do you convert a Smartform Output to PDF output?


There is a tricky solution here.But let's keep that for the last. Let us first discuss the conventional
way of getting a PDF output for Smartform. For that you need to keep in mind the following two
function modules and their importing/exporting parameters:

CONVERT_OTF
CONVERT_OTF_2_PDF

In the Driver program, import the parameter 'job_output_info' from the Smartform FM and
utilize that info in 'OTF' parameter of the two aforementioned function modules.

Here is one more and probably the easiest way to see PDF output for a Smartform.
Type PDF! in the command prompt and hit enter :).
To see the Smartform Print Preview output as list output,
Type SLIS in the command prompt and hit enter.

*How do you achieve Bar Code printing in Smartforms?


Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say ZDEMO.
Step 2: For Smartform, create a character format C1 and use the recently created Barcode ZDEMO.

It can be finally used to print Barcode as:

How do you add a Watermark Or a Background Image for Smartforms ?


If you go to the properties of a page in Smartform, you will find a tab for Background Image.
Specify the source of the image you need here and it can be used as background image / Watermark
in Smartforms.

Graphics can be maintained using T.code SE78.


How will you print on both sided of a Smartform?
At the Page level in Smartforms, you can find something called as Print Mode.
Set the Print mode to duplex to print on both sides of the Smartform.

What is the difference in a Table and a Template in Smartform?


A Template has fixed number of Rows and Columns whereas a Table can have variable rows and
columns i.e. you can have a internal table with contents associated to a Table element but not to a
Template.

You should use a template when the tabular output is fixed!

How do you achieve Page Protection in Smartform ?


While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts, for Smartforms the
Page-Protection checkbox can be used to ensure page protection:

Note: You have Page-protection property only for Text Elements in the Main Window.
Can you move a Smartform from one SAP system to another without using transports ?
Yes, this can be achieved using the Upload/Download feature for Smartforms.
One can download the Smartform from one system and save it as an XML file.
Once that is done, the XML file can be used to upload the Smartform in another system.

Can you have a Smartform without a main window?


Yes, you can create a Smartform without a Main Window. But there is no need to do anything of
such sort.
Whenever you create a Smartform, a main window is created by default. I can't think of a situation ,
where you will have a situation in which it is mandatory for you to remove the Main Window. But
still I have seen this question in ABAP interviews. So I have put it here.

How do you find the name of the Function Module for a Smartform?
When is this function module created?
The function module for Smartform is created when the Smartform is activated.
You can find the name of the Function Module for a Smartform by going to
Environment --> Function Module Name.

What is a Copies Window?

What is a Final Window?


Final Window is called after all the other windows are called in a Smartform.

How do you pass data to Smartforms from the driver program?

How do you Debug Smartforms ?

How would you go about printing a logo in a Smartform?

How do you print address number in Smartforms ?

How do you print Symbols and Icons in Smartforms?

What are Basic Nodes and Auxiliary Nodes ?

What is the use of Folder in Smartforms ?

SAP ALE IDocs interview questions and answers Part 1


ALE IDocs in SAP

ALE IDocs in SAP is a lot about configuration and a lot about Tcodes . So if you have worked on
at least one end to end scenario in ALE IDocs in SAP , you probably already have answers to
a lot of questions.

Cheers!!

But if you haven't , make sure you do this exercise. There are plenty of step by step guides to
ALE IDocs available on the internet . Make sure you read one understand it all the way . Sending
IDoc from client 800 to say client 810 on the same server is easy . If possible ,Try an exercise in
which you send an IDoc from one system to another system.

Lets get started . Hope you get some value in these pages :)

Question 1: What is ALE ?


ALE stands for Application Link Enabling. As it's name indicates , it links two systems.
ALE is a technology that can enable exchange of data between two different Systems ( Sap -
Sap OR Sap - Non Sap). ALE technology enables distributed yet integrated installation of SAP
systems.
ALE architecture comprises of 3 layers :

Application layer refers to the application data ( SD , MM , FI or data for any SAP application ) .
In this layer the data is collected to be distributed and then sent to the distribution layer.

Distribution layer determines to whom should the data generated by the application layer has to
be distributed i.e. it is in the distribution layer that the recipient is determined , the data is
formatted or filtered and then an actual is created.

Communication layer takes the responsibility of delivering the Idoc to the receiving system and
communicates to the receiving system via tRFC , File ports , FTP or TCP/IP etc.

ALE uses IDoc as a vehicle to transfer data between two systems.

Question 2: What is EDI ?


EDI stands for Electronic Data Interchange. It refers to the electronic exchange of business data
in a structured format between two systems. The EDI subsystem generally converts the Idoc
data into one of the many EDI formats and generates an EDI file in an X12 format. The
middleware then translates the X12 file to an IDOC format and the IDOC is sent to the SAP
system.

Question 3: What is an Idoc? What is IDoc Type? What is an IDoc Extension ?


An IDoc (Intermediate document) is a vehicle that is used to transfer data from one system to
another.
IDoc is not a technology of some sort , but it is just a container that holds data .
It holds data in a structured format i.e. in the Fields of the Segments.

IDoc Type vs. IDoc:


An IDoc Type is nothing but a collection of one or more structures defined in a system with specific
fields. It does not hold Data.
However, an IDoc is something that holds the values in the fields of the structure defined by IDOC
type.

The transaction code to view an IDoc type (Basic and extension) is WE30.
Examples: ORDERS04, DEBMAS04, MATMAS04, CREMAS04.
These are all SAP standard Basic IDoc Types.

You can even have an IDoc extension in which you can use the existing Basic IDoc type and add extra
segments and fields to it. Usually we extend an IDoc when the standard SAP IDoc type is not able to
cater to the business process.

Question 4: What are the types of records in SAP ALE Idocs and where is this information
stored ?
There are three types of records in SAP ALE Idocs:
Control Records: Control record information for an IDoc is stored in standard table EDIDC.
Data Records: Control record information for an IDoc is stored in standard table EDIDD.
Status Records: Control record information for an IDoc is stored in standard table EDIDS.

Question 5: What is an Idoc status? What are the different types of Idoc statuses that you
know ?
When an IDoc is sent from one system to another , it goes through variuos stages.The IDoc
status indicates the stage that the Idoc in currently in.
There about 75 IDoc statuses.There is no way you can remember those all .
Don't even try to ! You will probably remember only those on which you have worked .

But here are a few that you should know:


0-49 indicates an Outbound IDoc and 50-75 as Inbound IDoc.

01 IDoc generated
02 Error passing data to port
03 Data passed to port OK

51 Application document not posted


52 Application document not fully posted
53 Application document posted

Question 6: What is a Port ? What are the types of Ports ?


A port is a communication channel through which Messages can be sent or received in SAP .
The sender and the receiver both specify the port through which they will communicate.

The common port types are the TRFC Port and the File Port.
If both sender and receiver mention TRFC ports, data is exchanged via RFC connections.
If however , a file port is mentioned , the IDOC is written in a flat file at the specified location at
the sender system.Then a FTP transfer should be done from that location to the receiver system
or a Middleware that will send the file to the receiver system.

The transaction to maintain ports is WE21.

Question 7: What is a Message type and Idoc Type ? What is the difference between Message
type and an IDoc type?
A Message type and an IDoc type are closely related . In fact, you will find that a Message type is
always associated with an IDoc type.Whereas an IDoc type is a detailed version with all the
segments and fields , a Message type is used just to specify the kind of information that a system
can send or receive to or from another system.

So If system SAP1 has a Partner Profile where it specifies MATMAS as an outbound message
type , it just means that SAP1 can send material master data to say system SAP2.

If system SAP1 has a Partner Profile where it specifies MATMAS as an inbound message type ,
it just means that SAP1 can receive material master data from say system SAP2.

What all fields can be sent and received will be specified in the IDoc type.
Some other message types: DEBMAS( Customers), CREMAS(Vendors) belong to the Master
data.

The link between a message Type and an IDoc type is maintained in Tcode WE82.

Question 8: What is a partner profile ? What are the types of partner profiles ?
To be able to communicate with a partner via an IDoc interface, each system needs to maintain a
partner profile. A partner profile is a mechanism by which the system can specify what kind of
messages (message types) it can send or receive.
Partner profiles can be maintained in WE20.

Question 9: What is a distribution model in ALE IDocs ?


The distribution model describes how ALE messages flow between different logical systems.
You can mention the sender and receiver logical systems, the message type to be distributed
and also distribute data(IDocs) based on certain conditions by using the distribution model.
The ALE layer uses the distribution model to control which systems will receive the
information(IDocs) and also filter the data based on certain conditions.
Distribution Models can be created and maintained in transaction BD64.

Question 10: What are process codes ?


I don't want to make this post too big . So, I will stop here for the time being.

Question 11: How do you Edit IDoc contents manually?

Question 12: Can you edit IDoc content for successful IDocs ?
No. You cannot.

Question 13: If you send an IDoc say 100008008 from system ECC1 to system ECC2, will the
IDoc number in ECC2 be 100008008?
No. The next number from the IDoc number range in ECC2 will be picked up.

More interview questions on ALE IDocs :

Question 14: How do you read data from an IDoc in a program ?


Question 15: How do you send Idoc from a program ?
Question 16: How do you achieve filtering in a distribution model ?
Question 17: Can I create a flat file from an IDOC ? If Yes , How ?
Question 18: You want to create and send an IDOC to another the moment a PO is created in
your system . How will you achieve this ?
Question 19: How to Reprocess Idocs in SAP?
Question 20: What is a change Pointer?
Question 21: What is serialization of Idocs?
Question 22: Important tcodes in ALE Idocs.
Question 23: Important programs in ALE Idocs:

BDC Interview Questions


What is BDC and why do we use BDC ?

BDC ( Batch Data Communication ) also known as batch input is a technique by which large
volumes of data can be transferred from Non Sap or Legacy systems to SAP systems.

Example: A Legacy system that is to be replaced by SAP has say 1000 Customers , 2000
vendors and 3000 materials. All this data needs to be transferred to SAP . In such cases , We can
use BDC.

If the old system is replaced by SAP, such a transfer is called Conversion.


If the old system runs along with SAP, in that case the transfer is called an Interface.

The two methods for BDC are:

 Session Method
 Call TRANSACTION Method
 CALL DIALOG (Outdated)
ABAP interview questions on BDC:
Important:
Question 1:What is the difference between Call Transaction Method and the Session
method ?

Session Method Call Transaction

Session method id generally used when the Call transaction method is when the data
data volume is huge. volume is low

Session method is slow as compared to Call Call Transaction method is relatively faster
transaction. than Session method.

SAP Database is updated when you process SAP Database is updated during the execution
the sessions. You need to process the sessions of the batch input program.
separately via SM35.

Errors are automatically handled during the Errors should be handled in the batch input
processing of the batch input session. program.

Important:

Question 2: How do you do BDC for a table control?


With other things as usual, there is a special trick that you have to use while doing BDC for table
control.
You need to use the BDC OKCODE '=P+'.
Its the BCD_OKCODE for Page down that can be used for scrolling down in table control.

Important:

Question3: Is there any method apart from BDC for data upload to SAP?
Apart from BDC and LSMW, you can use BAPIs to upload data into SAP.
BAPIs should be preferred over BDCs, because they process data faster than BDC.

A BAPI is faster since it updates Database "directly". Whereas BDC calls transaction and goes
through the whole screen sequence as any user would do.

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 in Background and Foreground processing
BAPI. options are available for BDC.

BAPI would generally used for small data BDCs would be preferred for large volumes of
uploads. data upload since background processing
option is available.

For processing errors, the Return Parameters Errors can be processed in SM35 for session
for BAPI should be used.This parameter method and in the batch input program for
returns exception messages or success Call Transaction method.
messages to the calling program.

Question 4: How do you process errors in Call Transaction method ?

Let's have a look at the syntax for CALL TRANSACTION method.


Sample code:

DATA: BEGIN OF G_T_MESSTAB OCCURS 0.

INCLUDE STRUCTURE BDCMSGCOLL.

DATA: END OF G_T_MESSTAB.

CALL TRANSACTION 'MB11'

USING G_T_BDCDATA

MODE 'E'

UPDATE 'S'

MESSAGES INTO G_T_MESSTAB.

All the error messages will be trapped inside G_T_MESSTAB.

Question 5: What is the use of program RSBDCSUB?


There are two ways to process the BDC sessions:
1) Go to SM35 ---> Choose session ---> hit process.
Now See Question no. 10.
2) Use program RSBDCSUB.
RSBDCSUB schedules the session to be processed in background.

Let's take an example to understand this.

The sessions are created at one point of time and processed at other point of time and this may
create a problem: For example: a BDC program creates a session for updating 1500 customers
in SAP. However , before this session is processed via SM35 , a user inserts 100 customers in the
system manually. In this case , the session will have at least 100 errors when the session is
processed from SM35.

One way to avoid this is to use the program "RSBDCSUB" in the batch input program itself so
that the session is processed as soon as it is created.
RSBDCSUB schedules the session to be processed in background.

Question 6: What is the structure of the BDC table?

The BDCDATA consists of the following fields:

 PROGRAM [CHAR 40] - Online program name.

 DYNPRO [NUMC 4] - Screen number.

 DYNBEGIN [CHAR 1] - Flag to indicate the start of a new screen.

 FNAM [CHAR 132] - Field name of a screen field to be filled with data.

 FVAL [CHAR 132] - The actual value to be filled into the specified screen field.

Sample Screenshot:

BDCDATA table structure

Question 7: What is the difference between BDC_OKCODE and BDC_CURSOR?

BDC_OKCODE: is used for storing commands during the recording. like '/00' is the command
for 'ENTER' Key.
BDC_CURSOR: contains the cursor position. it contians the field in which cursor will be.
Example code:

perform bdc_field using 'BDC_CURSOR'

'PROJ-PSPID'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

Question 8: What are the 3 methods that we use in sequence in a Batch input session
method ?

1) BDC_OPEN_GROUP for opening the Batch Input Session

2) BDC_INSERT for inserting the transactional data into SAP

3) BDC_CLOSE_GROUP for closing the Batch Input Session

If there are n records , the BDC_INSERT method should be called n times.


BDC_OPEN_GROUP and BDC_CLOSE_GROUP are called only once.

General Information about a session is stored in table APQI.


Transaction data for a session is stored in table APQD.

Question 9: What is your approach for writing a BDC program?

Identify the Tcode and do the recording in SHDB to populate the BDCDATA.

Once the recording is done , one can Transfer it to the Batch input program.
In the batch Input program , The transactional data is read from the file to an internal table.

Then one can loop over the transactional data in the internal table and start uploading the data
in SAP either by CALL TRANSACTION method or by creating sessions through the batch input
program.

Question 10: How do you process errors in Session method ?

You can go to Transaction SM35 , Choose the session name and click on Process.

Question 11: What are the different modes of processing batch input sessions?

The three modes are:

Foreground
Display Errors Only

Background

Question 12: What is the difference between Synchronous and Asynchronous Update ?

In Synchronous update , the database is updated before the next transaction is taken for
processing in a batch input.

In Asynchronous update , the system doesn't wait for updating the database before the next
transaction is taken for processing in a batch input.

Question 13: What is the transaction for Recording BDC ?

The Tcode is SHDB.

Question 14: How do you read files from the Application server ?

You can use the commands:


OPEN DATASET ---> opens the file(dataset) either in read /write mode.
READ DATASET ---> Read the file
CLOSE DATASET ---> Close the dataset once the date has been read .

Question 15: How do you read files from the presentation server ?

You can use the Function Modules :


GUI_UPLOAD --> To read data from file into an internal table
GUI_DOWNLOAD --> To write data from internal table to a file on presentation server

SAP Web Dynpro ABAP Interview Questions Part1


Preparing for SAP web dynpro ABAP interview ? You have come to the right place :). This blog
will be your friend in your preparation . I believe in doing things one step a time . That is why I am
planning to divide this blog into 3-4 parts for your maximum benefit . Do these one at a time and
you will be all set for your SAP webdynpro ABAP interview in 3-4 days. All the best!

Let's get started:

Imp*:What is Model-View-Controller MVC architecture in Web Dynpro ABAP?


This is one of the most common Web Dynpro ABAP interview questions. I am sure you will be
asked about this. This is your chance to show how much you know about Web Dynpro . Prepare
this answer on your own .I will give you a link to show your webdynpro flair : Web Dynpro Tutorial
part 2

Controllers in Web Dynpro:


Question 1: What are the types of Controllers in Web Dynpro ABAP?
The types of controllers are listed in the screenshot below:

Types of Controllers in webdynpro ABAP

Question 2: What is Component Controller?


Component Controller is the King of all Controllers. It is the backbone of your Web Dypro
Component . It is like a Global or Top Include for you program . It controls the entire activity of
your Web Dynpro Component.

Question 3: What is an Interface Controller?


Whenever we want views , nodes or methods of a particular web dynpro component to be
available to other the outside world ( i.e. other webdynpro components) , we make use of
Interface controller . Interface Controller is created by default when a webdynpro component is
created.
Interface Controller would generally come into picture when you are doing component usage of
some sort in web dynpro i.e. re-using views/methods/nodes of one WD component in another.

Question 4: What is a Custom Controller?


When your Component Controller grows big in size ( say more than 10-15 views and
corresponding context nodes , methods , events , event handlers etc) , it might become tough to
handle everything in the Component Controller . In such a scenario , you can create one or more
custom controllers and modularize or segregate the logic into separate parts using Custom
Controller.

Question 5: Would you prefer creating multiple Custom Controllers OR would you go for
separate Web Dynpro components and then do Component usage.
This would actually depend on the requirement , but ideally separate Web dynpro components
should be created and reused.One can also use the assistance class for segregating business
logic.

Question 6: How many component controllers can a Web Dynpro Component have ?
Component Controller is only one . You can create multiple controllers , but those are called
Custom Controllers.

Note: If you are asked about the Web Dynpro architecture , you should talk about both the MVC
framework and the controllers.

Question 7: Suppose your Web Dynpro has 10 nodes in the Component Context . Will all 10 the
nodes be available in the Interface controller?
Nodes from the Component context are available to the interface controller only when the nodes
are declared as interface nodes.To create an interface node , set the interface property to yes as
shown in the screenshot below:

Interface Node in Webdynpro ABAP

To create an interface node , set the interface property to yes as shown in the screenshot to the
right :

Once created , the interface node is indicated by a special symbol as shown in the figure below
and the property Interface Node is set to yes:
Interface Node in Webdynpro ABAP

Question 8: When do views become available in the interface Controller ?


Whenever we embed any view in a window , at the moment that view becomes automatically
available to the Interface Controller and shows up as an interface view in the Interface Controller.
You do not have to declare a view as an interface view as is the case with interface nodes.

Question 9: Is it true that each controller has its own Context node ?
Yes , Each controller has it's own context , methods , and Events.

Question 10: At design time how do you decide whether to declare a node in the Component
Controller or in the View Controller?
This again depends on the requirement: If the node is going to be accessed in multiple views , it
should be declared at the Component Controller level . However , If the node is absolutely
specific to only one view , it can be defined in the View Controller. As the size of
Webdynpro development grows , it starts becoming complex and the need to define
attributes,nodes,methods etc. at the Component Controller increases.

Hook Methods in Web Dynpro:


Question 11:What are Hook Methods in Web Dynpro ABAP ?
Hook methods in webdynpro are standard web dynpro methods that are called at different time in
the web dynpro lifecycle.These methods are listed in the screenshot below: These methods start
with WD*.

Hook Methods in Webdynpro ABAP

Question 12:Are all the hook methods available to all the Controllers?
No . They are specific to controllers. See the details in the image above:

Question 13:Sequence in which web dynpro hook methods are called:


If you want to understand the sequence , put breakpoints in all these methods.Execute the web
dynpro application , then do some action on the view , then close the application window:
Have a look at how the control passes from component to window and then to view:

1.WDDOINIT ( Component Controller )


2.WDDOINIT ( Window Controller ) --> Handle default method of the
window is called.
3.WDDOBEFORENAVIGATION ( Component Controller )
4.WDDOINIT ( View Controller )
5.WDDOMODIFYVIEW ( View Controller )
6.WDDOPOSTPROCESSING ( Component Controller )

Now view is displayed . Suppose user does some action on the view:

7. WDDOAFTERACTION ( View Controller )


8. WDDOBEFOREACTION ( View Controller )
9. WDDOBEFORENAVIGATION ( Component Controller )
WDDOINIT ( View Controller ) is not called this time.
10.WDDOMODIFYVIEW ( View Controller )
11.WDPOSTPROCESSING ( Component Controller )

View is displayed again.Now close button is clicked on the browser.

12.WDDOEXIT ( View Controller )


13.WDDOEXIT ( Component Controller )

Application is closed.

So now if you are being asked "What is called first : WDDOINIT or WDDOMODIFY?" OR
"What is called first WDDOINIT for Window controller or WDDOINIT for View Controller" ?
You should be able to answer the such questions.

Question 14: If one view is called 10 times in the lifespan of a webdynpro component , how
many times will the method WDDOINIT be called and how may times will WDDOMODIFYVIEW
be called ?
WDDOINIT will be called only once.
WDDOMODIFYVIEW will be called 10 times.

WDDOMODIFYVIEW has a parameter FIRST_TIME . If this is 'X' , then the view is getting called
first_time.
Question 15: What are PRE POST and OVERWRITE exit methods in web dynpro?
Whenever a web dynpro component is enhanced , these 3 methods become available for all
methods in Webdynpro. Lets take an example of these methods for WDDOINIT.

PRE exit: This method is called before WDDOINIT is called.


POST exit: This method is called after WDDOINIT is called.
OVERWRITE exit: In this case , WDDOINIT is not called . Instead , OVERWRITE exit method is
called.

SAP Webdynpro ABAP Interview Questions Part 2


I hope the Web dynpro ABAP Interview Questions part 1 was of some help to you.

Welcome to part 2! Here we go ahead with some more questions . I wish these questions offer
some value to you.

If you have already worked on web dynpro , these questions should be easy for you . Even if you
haven't had a chance to work on Webdynpro ABAP , these questions will guide you for your
interviews . In that case, I would suggest you do some hands on exercises on a sandbox server at
least.

Imp*
Question 16:What is an Assistance class in webdynpro ABAP? Where do you define an assistance
class? How many assistance classes can a webdynpro component have?
Assistance class helps you achieve two things:
1) Segregation of business specific logic (one of the purpose of MVC).
2) Performance benefit.

We can write the business logic in the methods of the View, Window or even the Component
controller. But it is not a good practice to load all the business logic in the views or windows. So SAP
has provided an option of assistance class where you can write all your business logic. By this way,
you are still in the framework of your webdynpro and also avoid loading too much logic in the
components of webdynpro itself. Assistance class methods are much better from a performance point
of view than calls of Web Dynpro controller methods.

A web dynpro component will have only one assistance class and it is defined at the component level
as per the screenshot below. The assistance class is automatically instantiated when a component is
called. You can access the instance of this class with the attribute wd_assist, which is created when
you create the assistance class in web dynpro.

Assistance class in we b dynpro ABAP

Imp*
Question 17: What is Singleton Property of a Context Node?

Understanding Singleton property of a context node and how it works in conjunction with the lead
selection event can be a bit complicated. If you do not already know what a Singleton set is , I
recommend you going through an example of Cars(Parent node with cardinality 0..n ) and Customers
( Nested child node with cardinality 0...n ) on Singleton Node by clicking on the link. This is not that
tough , just spend some time with it and you should be okay.

The best way to answer this question is by taking an example.


Say there are two ALV's on a View:
ALV1 ---> NODE_SO_HEADER----> Displays all the Sales Orders.
ALV2 ---> NODE_SO_ITEMS ------> Displays all the line items for the Sales Order selected in
ALV1.

NODE_SO_ITEMS is the child node for NODE_SO_HEADER and is declared as Singleton node.
Since this node is declared as singleton , at runtime , it holds the line item data only for the Lead
Selected Sales Order from NODE_SO_HEADER and not for all the Sales Orders from the parent
node.
Whenever the lead selection changes for the parent node, line item data for that lead selected order is
fetched from database and populated in the child node.

As a result great performance optimization is achieved.

I hope you get this one :).

Question 18: What is a supply function? When is it called?

You can assign a supply function to a context node when you create a node. In simple terms, supply
function is used to populate data records in the context node. A supply function is called when one or
more elements of the node are accessed for the first time.
Supply function in web dynpro

To give you an analogy, we all know that a constructor method of a class is called whenever an object
of that class is instantiated. In the same way, a supply function for a context node is called when the
node is accessed for the first time.

The supply function is generally used in combination with singleton nodes.So whenever the lead
selection of the parent node changes , the supply function of the singleton node recalculates and
repopulates the child node.

Question 19: What is lead selection? Is it an event?

Yes , the lead selection is an event in web dynpro.


At run time a context node may contain many records , but only one of those is selected .
The user can select any record from the Table/ALV and this selection is called lead selection.

Lead Selection in Web Dynpro

Question 20: What is Cardinality of a context node?

Cardinality simply indicates the minimum and the maximum no. of entries the node can have.
The 4 cardinalities are 0:1, 0:n, 1:1, and 1:n .

Question 21: Is there any relation between Cardinality and Lead selection?

Yes , If the cardinality is set to 0:1 or 1:1 , the user cannot select multiple records on the view.
So if you want the user to be able to select multiple records on the screen , the cardinality of that
particular node must be set to 0:n or 1:n.

Question 22: Some important Web Dynpro attributes that you should know:

Some attribute in webdynpro that are used very frequently and some of those that you must know are :

Wd_this
Wd_context

Each controller has the above two mentioned attributes.

To elaborate, if you are using the above two attributes say in a method of a View Controller, then
WD_CONTEXT is the reference to the Context node of the View and WD_THIS is the reference to
the View Controller itself.

Wd_comp_controller is the reference to the Component Controller. View and Window controller
have this attribute defined by default and methods/attributes of the Component Controller can be
accessed by using this attribute.

For example:

Wd_assist: This attribute is created when the assistance class is saved and activated for a web dynpro
component. All the methods of the assistance class can be accesses by using this attribute.

Question 23: What are layouts in Web Dynpro ABAP?

Flow layout, Row Layout, Grid Layout, Matrix layout and the form layout.
The layout can be set at a Container level.

Question 24: Can you use multiple layouts in one view?


Layouts can be assigned at the container level. For example, you define the layout for your view at the
ROOTUIELEMENT container level.
So if at all you want to use multiple layouts in one view, you can create multiple transparent
containers and assign different layouts to them.

Question 25: How do you introduce line break for a UI element in any layout?

Say if you are using matrix layout, you will say Matrix Head data for the UI element for which you
need a line break.

Question 26:Can you call/launch one web dynpro application from another webdynpro application?

Yes, you can launch one webdynpro application from another webdynpro application.
First, you should get the URL of the web dynpro component that you want to launch and second, call
that URL in an external window.
To get the URL of any web Dynpro component, you use the FM
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = 'ZDEMO’
IMPORTING
out_absolute_url = str.

Once you get the URL in str, you can call this web dynpro using 'str' and
fm: create_external_window.

Question 27: Can you create a Tcode for Webdynpro Application?

Creating Transacti on code for We b dynpro ABAP

Yes, you can create a Tcode for webdynpro application. Go to SE93 , create Tcode, choose the last
option and maintain default values as shown in the screenshot:
Question 28: Can you pass parameters in a webdynpro URL?

Yes, you can pass parameters in webdynpro URL and read them too in your web dynpro component.

Example: http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?sap-
language=EN&var1=4500000001&var2=00010

Question 29: How do you read parameters passed in the Web Dynpro URL?

First lets understand how a typical webdynpro application looks like:


When you create a web dynpro application , you can see the link URL generated by web dynpro.
It will be something
like:http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?sap-
language=EN&sap-client=100.

Whatever comes after the ‘?’ and is followed by ‘&’ is an URL parameter. You can see sap-language
and sap-client as default parameters whenever you launch your web dynpro in browser. The cool
thing is you can add some custom variables
too. http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?sap-
language=EN&sap-client=100&var1=4500000001&var2=00010.

So var1 and var2 are custom webdynpro URL parameters and you can read them in
the HANDLEDEFAULT method of your main window:
Question 30: Can you run a Webdynpro Application in background?

This is a tricky question. It doesn’t make sense to run a webdynpro application in background because
in that case you are beating the purpose of the MVC controller architecture for webdynpro. However,
you can build logic to create background jobs from a Web Dynpro Application.

So we have by now put a bunch of questions here . Let me know how do you find these questions.
We haven't yet covered Web Dynpro component usage , ALV, Select Options , OVS , the coding part
in web dynpro, Web dynpro enhancements etc.

SAP Webdynpro ABAP Interview Questions Part 3


Web Dynpro ABAP interview questions Part 3:

Now we come to the tougher side of web Dynpro. I have tried to put together some concepts
from the point of view of an interview . That's why you wont find the details here but an
overview.

Question 1: What is Web Dynpro Component Usage?


Real world business scenarios are quite complex and may involve multiple Web Dynpro
Components.
While dealing with multiple WD components, you may come across a situation where you need
to reuse already developed parts of an existing Web dynpro component.

The Web Dynpro framework provides you with a technique called ‘Component Usage’, with the
help of which you can reuse the events, methods, and context of one WD component into
another WD component.
Standard examples of Component Usage: Select Options , ALV , OVS.
You declare component usage both at the Component and at the view levels:

@Component Level:

@View Level:
Question 2: Briefly explain how will you use implement Select Options in Web Dynpro?
1) Declare Component Usage for Standard WD component WDR_SELECT_OPTIONS both at
component and view level.

2) Place a VIEWCONTAINER on your main view and embed the view


‘WND_SELECTION_SCREEN’ of component WDR_SELECT_OPTIONS in it.

3) Use the methods CREATE_RANGE_TABLE and ADD_SELECTION_FIELD for your fields on


Selection screen.

4) Use method GET_RANGE_TABLE_OF_SEL_FIELD to read user input before you do a SELECT.


Question 3: What is the Web Dynpro Phase model?
Whenever a roundtrip occurs from the client (browser) to the server, a sequence of processing
steps is executed. This sequence of processing steps in web Dynpro is called the ‘Phase Model’.
Executing all the tasks in the phase model is the responsibility of the Web Dynpro framework.
Each step is executed only once and errors if any are captured.

If you want to get into the details , have a look at the webinar from Chris
Whealy: Understanding the Web Dynpro Phase model.

Important

Question 4: What is OVS? Can you explain the different phases used in OVS?
First we should understand the difference between Value help and OVS i.e. object Value
Selector.
We use generic Value Help only for the field to which it is bound.
OVS is used when we want to populate multiple fields based on one field on the screen.

So as per the screenshot , If I select Userid from OVS help, First name and Last name will be
populated automatically. The standard component WDR_OVS is used for implementing OVS.

OVS works on the PHASE MODEL and different tasks are performed during different phases.
The current phase is indicated by the parameter PHASE_INDICATOR.

Phase 1:
In this phase you have the possibility to define the texts, if you do not want to use the defaults:
So You can play around with the highlighted texts in the screenshot below in this phase.
Here we call the method ovs_callback_object->Set_Configuration
Phase 2:

If you do not want the filter fields, you can do that in this phase and the table will be displayed
directly. Refer screenshot below. The table is displayed directly. I have blurred some
results.Here you can call the methodovs_callback_object->Set_Input_Structure

Phase 3:
In this Phase, You write the select queries that should run as per user input when the user hits
‘Start Search’ button and finally set the output table.You can call the
method ovs_callback_object->Set_Output_Table for that purpose.

Phase 4:
In this phase , you pass the selected record to the Web dynpro Fields.
i.e. set the attributes using ovs_callback_object->context_element->Set_Attribute
Question 5: Briefly explain how will you implement ALV in Web Dynpro?
To implement ALV in Web Dynpro, you need to use the Standard WD
component SALV_WD_TABLE.
We need to use:
a) the view ‘TABLE’ of component SALV_WD_TABLE
b) the node ‘DATA’ of component SALV_WD_TABLE.
Here is the brief process:

1) Declare component Usage for SALV_WD_TABLE at the WD component level and the view
level.
@ Component Level:

@ View Level:

2) Put a VIEWCONTAINER UI element on the MAIN view and ember the view ‘TABLE’ of
SALV_WD_TABLE into it.
3) Let’s say the ALV data is to be populated in NODE_FLIGHT.
Write the logic to select the ALV Data and bind it to NODE_FLIGHT:
node_flight_alv->BIND_TABLE( lt_node_flight_alv ).

4) Do a Context mapping between NODE_ALV and the node ‘DATA’ of SALV_WD_TABLE.

Question 6: How to make columns in a table editable?


While doing the Binding for the Table, just choose 'Input field' instead of 'Textview'.
Refer the Screenshot below:
Question 7: How will you delete selected rows in a Table / ALV?
Get the Table / ALV data in an internal table.
Delete the row selected by the user from the internal table.
Re-bind the internal table to the node bound to the Table/ALV.

Question 8: How do you generate POP UP in WD?


This can be easily done using the Wizard:
The CREATE_WINDOW method is used in this case.

Question 9: How do you close a window in Web Dynpro?

There is a special outbound plug called ‘Exit Plug’ that can be used for this purpose.
wd_this->fire_to_exit_plg( url = url close_window = close_window ).

Also explore other Plug Types:


I am going to add some more questions to part 3 :
Let me know if you need answers to the below questions by putting your comments below:

Question: What is the difference between Drop down by key and drop down by index ?

Question: How do you display error / success / warning messages in Web Dynpro ?

Question: How do you access methods of component controller in a view ?

Question: Have you worked on roadmap UI element ? Elaborate .

Question: What is dynamic ALV in web dynpro ?

Question: Can you have Totals and Subtotals in Web dynpro ALV ? How ?
Hint: First get the reference of the ALV. Then get the columns.
By looping at lt_columns , get to the required column.
Once you achieve this, check methods create_aggr_rule and create_sort_rule of the class
cl_salv_wd_field.

Question: Can you have TOP OF PAGE and END OF PAGE ? How ?
Hint: Check TOP_OF_LIST and END_OF_LIST events.

Question: Have you worked on events in ALV in web dynpro?


Which events do you know?
Question: Can you add custom buttons on Web Dynpro ALV toolbar ? How?

Question: Can you add custom buttons in Web Dynpro ALV cells ? How?

Question: Can you add Image / Icons in Web Dynpro ALV cells ? How?
How do you define and implement action handlers for them?

Question: Can you add links in Web Dynpro ALV cells ? How?

Sap Abap Interview Questions and Answers


What is an ABAP?
ABAP (Advanced Business Application Programming) is a high level programming
language created by the German software company SAP. It is currently positioned as
the language for programming SAP's Web Application Server, part of its NetWeaver
platform for building business applications. Its syntax is somewhat similar to COBOL.

What is an ABAP data dictionary?


ABAP 4 data dictionary describes the logical structures of the objects used in
application development and shows how they are mapped to the underlying relational
database in tables/views.

What are domains and data element?


Domains:Domain is the central object for describing the technical characteristics of an
attribute of an business objects. It describes the value range of the field. Data Element:
It is used to describe the semantic definition of the table fields like description the field.
Data element describes how a field can be displayed to end-user.

What is foreign key relationship?


A relationship which can be defined between tables and must be explicitly defined at
field level. Foreign keys are used to ensure the consistency of data. Data entered
should be checked against existing data to ensure that there are now contradiction.
While defining foreign key relationship cardinality has to be specified. Cardinality
mentions how many dependent records or how referenced records are possible.

Describe data classes.


Master data: It is the data which is seldom changed. Transaction data: It is the data
which is often changed. Organization data: It is a customizing data which is entered in
the system when the system is configured and is then rarely changed. System data:It is
the data which R/3 system needs for itself.

What are indexes?


Indexes are described as a copy of a database table reduced to specific fields. This data
exists in sorted form. This sorting form ease fast access to the field of the tables. In
order that other fields are also read, a pointer to the associated record of the actual
table are included in the index. The indexes are activated along with the table and are
created automatically with it in the database.

Difference between transparent tables and pooled tables.

Transparent tables: Transparent tables in the dictionary has a one-to-one relation with
the table in database. Its structure corresponds to single database field. Table in the
database has the same name as in the dictionary. Transparent table holds application
data. Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the
table in database. Table in the database has the different name as in the dictionary.
Pooled table are stored in table pool at the database level.

What is an ABAP/4 Query?


ABAP/4 Query is a powerful tool to generate simple reports without any coding.
ABAP/4 Query can generate the following 3 simple reports: Basic List: It is the simple
reports. Statistics: Reports with statistical functions like Average, Percentages. Ranked
Lists: For analytical reports. - For creating a ABAP/4 Query, programmer has to create
user group and a functional group. Functional group can be created using with or
without logical database table. Finally, assign user group to functional group. Finally,
create a query on the functional group generated.

What is BDC programming?


Transferring of large/external/legacy data into SAP system using Batch Input
programming. Batch input is a automatic procedure referred to as BDC(Batch Data
Communications). The central component of the transfer is a queue file which receives
the data vie a batch input programs and groups associated data into “sessions”.

What are the functional modules used in sequence in BDC?


These are the 3 functional modules which are used in a sequence to perform a data
transfer successfully using BDC programming: BDC_OPEN_GROUP - Parameters like
Name of the client, sessions and user name are specified in this functional modules.
BDC_INSERT - It is used to insert the data for one transaction into a session.
BDC_CLOSE_GROUP - This is used to close the batch input session.

What are internal tables?


Internal tables are a standard data type object which exists only during the runtime of
the program. They are used to perform table calculations on subsets of database tables
and for re-organizing the contents of database tables according to users need.

SAP Certified Development Associate -


ABAP with SAP NetWeaver 7.0
Exam Questions

These questions are similiar to the ones asked in the actual Test.

How should I know? I know, because although I got my ABAP Certification five years back, I
have re-certified with the
latest version of the Associate Certification test.

Before you start here are some Key features of the ABAP Associate Certification Exam

- The exam is Computer based and you have three Hours to answer 80 Questions.

- The Questions are (mostly) multiple choice type and there is NO penalty for an incorrect
answer.
- Some of the Questions have more than one correct answers. You must get ALL the options
correct for you to be
awarded points.

- The Official Pass percentage is 65% (But this can vary). You will be told the exact passing
percentage before your
begin your test.

Sample Questions
Q1.There are various possibilities of creating/changing an ABAP programme. Some
of these are:

A. Opening programs in the Object Navigator


B. Using the ABAP Editor
C. Using EEWB
D. Using Forward Navigation

Answer:
A, B, D

To start the ABAP Editor to create or change ABAP programs, the R/3 system offers
three possibilities:

• Opening Programs in the Object Navigator


The Object Navigator of the ABAP Workbench (Transaction SE80) offers a
hierarchical overview of all R/3
Repository objects, ordered by package, user name of the programmer, object types,
and so on.

By selecting a program, the Object Navigator supplies direct access to all


components of a program, such as
main program, includes, classes, or global data. By selecting a program object in the
Object Navigator and
calling a maintenance transaction, you directly open the appropriate tool for this
object, in this case the ABAP
Editor.

This way is appropriate for all ABAP programs, as the Object Navigator gives you a
constant overview of all
components of a program. In particular, screens and user interfaces are displayed.
• Using the ABAP Editor
To open ABAP programs directly from the tool ABAP Editor, select the menu path
Tools --> ABAP Workbench
--> Overview --> Development --> ABAP Editor from the SAP menu of SAP Easy
Access (or start Transaction
SE38).

If you want to change a program using this method, you must already know its name
and environment.
This procedure is only suited for maintaining or creating relatively simple or short
programs, which have few or
no additional components.

• Using Forward Navigation


In any of the tools in the ABAP Workbench, you can open a different Repository
object by positioning the cursor
on it and double-clicking. The system automatically opens the object using the
correct tool. This also applies to
editing ABAP programs.

Forward navigation by double-click can be used at any point where the names of
ABAP programs appear in
the ABAP Workbench.

Q2. Which of the following are acceptable names of an ABAP program?

A. ZQSDABAP
B. YMYFIRSTABAPPROGRAM
C. Z”MyFirst ABAP PROGRAM
D. Z==FIRSTABAPPROGRAM
E. THISISMYFIRSTABAPPROGRAMME

Answer:
A, B, E

The name of an ABAP program can be between 1 and 30 characters long.

The following symbols and signs must not be used in program names:
Period (.), comma (,), space ( ), parentheses (), apostrophe (‘), inverted commas ("),
equals sign (=), asterisk
(*), accented characters or German umlauts (à, é, ø, ä, ß, and so on), percentage
signs (%), or underscores (_).
Q3. Data types in ABAP are not just attributes of fields, but can be defined in their
own right. Where in ABAP
can you define data types?

A. ABAP Dictionary
B. In programs
C. In IMG

Answer:
A, B

The following graphic shows where you can define data types in ABAP:

This differentiates between


• Predefined ABAP types that are built into the kernel.
• Local data types that you can define in ABAP programs.
• Data types in the ABAP Dictionary that are available to all programs in the
entire system. In the ABAP
Dictionary, you can define types either as Dictionary objects or in type groups.

Q4. Which of the following are ways to process large volumes of data in ABAP?

A. Internal Tables
B. Extracts
C. Database Storage

Answer:
A, B
There are two ways of processing large quantities of data in ABAP - either using
internal tables or extract
datasets.

Internal tables
Internal tables provide a means of taking data from a fixed structure and storing it in
working memory in ABAP.
The data is stored line by line in memory, and each line has the same structure. In
ABAP, internal tables fulfill
the function of arrays. Since they are dynamic data objects, they save the
programmer the task of dynamic
memory management in his or her programs.

You should use internal tables whenever you want to process a dataset with a fixed
structure within a program.
A particularly important use for internal tables is for storing and formatting data from
a database table within a
program. They are also a good way of including very complicated data structures in
an ABAP program.

Like all elements in the ABAP type concept, internal tables can exist both as data
types and as data objects A
data type is the abstract description of an internal table, either in a program or
centrally in the ABAP Dictionary,
that you use to create a concrete data object. The data type is also an attribute of an
existing data object.

Extracts
Since internal tables have fixed line structures, they are not suited to handle data
sets with varying structures.
Instead, you can use extract datasets for this purpose.

An extract is a sequential dataset in the memory area of the program. You can only
address the entries in the
dataset within a special loop. The index or key access permitted with internal tables
is not allowed. You may
only create one extract in any ABAP program. The size of an extract dataset is, in
principle, unlimited. Extracts
larger than 500KB are stored in operating system files. The practical size of an
extract is up to 2GB, as long as
there is enough space in the filesystem.

An extract dataset consists of a sequence of records of a pre-defined structure.


However, the structure need
not be identical for all records. In one extract dataset, you can store records of
different length and structure one
after the other. You need not create an individual dataset for each different structure
you want to store. This fact
reduces the maintenance effort considerably.

In contrast to internal tables, the system partly compresses extract datasets when
storing them. This reduces
the storage space required. In addition, you need not specify the structure of an
extract dataset at the
beginning of the program, but you can determine it dynamically during the flow of the
program.

You can use control level processing with extracts just as you can with internal
tables. The internal
administration for extract datasets is optimized so that it is quicker to use an extract
for control level processing
than an internal table.

Q5. SAP ERP System contains a lock mechanism, fully independent of database
locks, that allows you to set a
lock that spans several dialog steps. These locks are known as SAP locks. Which of
the following are
functionalities of SAP Locks?

A. The SAP lock concept is based on lock objects


B. Before you can set an SAP lock in an ABAP program, you must first create a lock
object in the ABAP
Dictionary.
C. There are three types of locks in the system, shared, logical and exclusive
D. When you create a lock object, the system automatically creates two function
modules.

Answer:
A, B, D

The SAP lock concept is based on lock objects. Lock objects allow you to set an
SAP lock for an entire
application object. An application object consists of one or more entries in a
database table, or entries from
more than one database table that are linked using foreign key relationships.

Before you can set an SAP lock in an ABAP program, you must first create a lock
object in the ABAP
Dictionary. A lock object definition contains the database tables and their key fields
on the basis of which you
want to set a lock. When you create a lock object, the system automatically
generates two function modules
with the names ENQUEUE_<lock object name> and DEQUEUE_<lock object name>
.

You can then set and release SAP locks in your ABAP program by calling these
function modules in a CALL
FUNCTION statement.

Lock Types
There are two types of lock in the R/3 System:

• Shared lock
Shared locks (or read locks) allow you to prevent data from being changed while you
are reading it. They
prevent other programs from setting an exclusive lock (write lock) to change the
object. It does not, however,
prevent other programs from setting further read locks.

• Exclusive lock
Exclusive locks (or write locks) allow you to prevent data from being changed while
you are changing it yourself.
An exclusive lock, as its name suggests, locks an application object for exclusive use
by the program that sets
it. No other program can then set either a shared lock or an exclusive lock for the
same application object.

Q6. When you create a function module, you can set the Process Type attribute to
one of the following values:
A. Update with immediate start
B. Update without immediate start
C. Updated with Manual start
D. Update with Delayed start

Answer:
A, D

To be able to call a function module in an update work process, you must flag it in
the Function Builder. When
you create the function module, set the Process Type attribute to one of the following
values:

• Update with immediate start


Set this option for high priority ("V1") functions that run in a shared (SAP LUW).
These functions can be
restarted by the update task in case of errors.

• Update w. imm. start, no restart


Set this option for high priority ("V1") functions that run in a shared (SAP LUW).
These functions may not be
restarted by the update task.

• Update with delayed start


Set this option for low priority ("V2") functions that run in their own update
transactions. These functions can be
restarted by the update task in case of errors.

Q7. From Release 6.10, ABAP supports multi-byte coding for characters in Unicode.

A. True
B. False

Answer:
A

From Release 6.10, ABAP supports multi-byte coding for characters in Unicode.
Prior to Release 6.10, ABAP
used only character sets that were based on single-byte codes – such as ASCII and
EBCDIC – or double-byte
codes, such as SJIS and BIG5.

This switch to Unicode affects all statements where an explicit or implicit assumption
is made about the internal
length of a character. If you use these statements in a program that is designed to
exploit the Unicode
capabilities of the runtime environment, they must be checked and changed if
necessary.

Once a Unicode-enabled program has been changed accordingly, it behaves in the


same way in both Unicode
and non-Unicode systems. You can develop programs in a non-Unicode system
(NUS) and then import them
into a Unicode system (US). The following sections describe the conversions that are
necessary:

Q8. Each ABAP program consists of self-contained processing blocks, which may
occur in any order in the
source code. Processing blocks are sections of programs, made up of structure
blocks. Which of the
statements about processing blocks are True?

A. They can be processed sequentially or in parallel.


B. They can be called from within a program, or from outside an ABAP program
C. To start an ABAP program, at least one of its processing blocks must be started
from outside the program
itself.

Answer:
B, C

Processing Blocks are processed sequentially.

Each ABAP program consists of self-contained processing blocks, which may occur
in any order in the source
code. Processing blocks are sections of programs, made up of structure blocks.
They are processed
sequentially. A processing block can be called either from outside the ABAP
program, or from a processing
block within the same ABAP program (see also Structure of ABAP Programs). When
a processing block is
called from outside the program, it can be called either by the ABAP runtime
environment or another ABAP
program.
To start an ABAP program, at least one of its processing blocks must be started from
outside the program
itself. Each ABAP program has a program type, which determines whether and how
a program can be run.

Q9. Some ABAP programs can be run by a user by entering the program name or a
transaction code. These
programs are of type?

A. Type 1
B. Type M
C. Type F
D. Type K

Answer:
A, B

The following gives an overview of the ABAP program types:

Type 1
You can start a type 1 program by entering its program name. For this reason, they
are also known as
executable programs. When you start a type 1 program, processors are started in
the runtime environment that
call a series of processing blocks (event blocks) in a predefined sequence. The
sequence is oriented towards
reporting tasks. This is why executable programs are also known as reports.
A special type of type 1 program is a logical database. You can start logical
databases together with reports. A
logical database contains subroutines that are called by an invisible system program
in a prescribed sequence
for type 1 programs. The subroutines make certain reporting functions reusable. For
further information, refer to
Logical Databases.

Type M
Type M programs can only be started using a transaction code. A transaction code
starts a screen, which
consists of the screen itself and its flow logic. Screen flow logic can call special
processing blocks (dialog
modules) in the corresponding ABAP program. Since type M programs contain
mostly dialog modules, they
are known as module pools.

Programs that Cannot Be Run Directly

These programs cannot be started directly by a user. Instead, they contain


processing blocks or other source
code that can only be used by an application program that is already running. They
are described in more
detail in a later section.

Type F
Type F programs are not executable. They serve as a container for function
modules. When you call a function
module from an ABAP program, the entire main program is loaded into the internal
session of the current
program. Since type M programs contain mainly function modules, they are known
as function groups. Function
modules are a type of procedure. They are described in more detail in the
Procedures section.

Type K
Type K programs are not executable. They are container programs for global
classes, and are known as class
definitions. Classes belong to ABAP Objects and are described in more detail in that
section.

Type J
Type J programs are not executable. They are container programs for global
interfaces, and are known as
interface definitions.

Type S
Type S programs are not executable. They are container programs for subroutines
that should only be called
externally. When you call a subroutine from an ABAP program, the entire main
program is loaded into the
internal session of the current program. Since type S programs contain mainly
subroutines, they are known as
subroutine pools. Subroutines are a type of procedure.

Type I
Type I programs cannot be run directly, and contain no callable processing blocks.
They are used exclusively
for modularizing ABAP source code, and are included in other programs.

Q10. Class-based exceptions are handled in a control structure that has the
following elements:

A. Try block
B. Catch block
C. Delete block
D. Erase block

Answer:
A, B

Class-based exceptions are handled in the following control structure:


TRY.
... " TRY block (application coding)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
...
CLEANUP.
... " CLEANUP block (cleanup context)
ENDTRY.

TRY Block
The TRY block contains the application coding whose exceptions are to be handled.
This statement block is
processed sequentially. It can contain further control structures and calls of
procedures or other ABAP
programs.

If an exception occurs in the TRY block or in a procedure called up here, the system
starts by searching for a
CATCH statement of the same TRY-ENDTRY structure.
It then searches from the inside out for a CATCH statement in any enclosing TRY-
ENDTRY structures that
handle the event. The system may call this handler. If the system does not find a
handler, but the TRY-ENDTRY
structure is contained in a procedure, it tries to propagate the exception to the caller.

Exceptions cannot be propagated in any processing blocks without a local data area
(event blocks, dialog
modules). A runtime error occurs immediately if the handler is missing.

If no exceptions occur in the TRY block, program execution is continued directly after
ENDTRY after the block
has been completed.

CATCH Block
A catch block contains the exception handler that is executed when a particular
exception has occurred in the
TRY block of the same TRY-ENDTRY structure.

A TRY-ENDTRY structure can contain several exception handlers. The syntax for
introducing an exception
handler is:
CATCH cx_... cx_... INTO ref.

Any number of exception classes can be specified after CATCH. This defines an
exception handler for all the
specified exception classes and their subordinate classes.

After an exception occurs, the system searches through the listed exception
handlers in the specified order.

The first exception handler whose CATCH statement contains the corresponding
exception class or one of its
superclasses is executed. The system then continues program execution directly
after ENDTRY.

No subsequent exception handlers are considered. For this reason, the order of the
different exception
handlers within a TRY-ENDTRY structure must be based on the inheritance
hierarchy of the specified exception
classes.

CLEANUP Block
If the system does not find a handler for an exception in a TRY-ENDTRY structure, it
searches for a handler in
the enclosing TRY-ENDTRY structures from the inside out (as mentioned above).
If the system does not find a handler here, it tries to propagate the exception to a
procedure caller.

Precisely one CLEANUP block can be defined in each TRY-ENDTRY structure. If


the system has not found a
handler for an exception, but the exception is handled in an enclosing TRY-ENDTRY
structure or is propagated
to a caller, the block is executed before the TRY-ENDTRY structure is exited.

In the CLEANUP block, cleanup work can be executed for the context of the TRY
block.

For example, objects often have to be brought into a consistent state or external
resources, to which an
external handler no longer has access, have to be released.

The nesting of TRY-ENDTRY blocks and the possible propagation of exceptions


may mean that several
CLEANUP blocks are executed before an exception is actually handled.

Q11. In a loop, a statement block is executed several times in succession. Some of


the different kinds of loops
in ABAP are:

A. Unconditional loops using the DO statement


B. Conditional loops using the WHILE statement
C. Loops through internal tables using the LOOP statement
D. Unconditional loops using the WHILE statement

Answer:
A, B, C

The different types of loop statements are:

• Unconditional loops using the DO statement.


• Conditional loops using the WHILE statement.
• Loops through internal tables and extract datasets using the LOOP statement.
• Loops through datasets from database tables using the SELECT statement.

Unconditional Loops
To process a statement block several times unconditionally, use the following control
structure:
DO [<n> TIMES] [VARYING <f> FROM <f1> NEXT <f 2>].
<Statement block>
ENDDO.

If you do not specify any additions, the statement block is repeated until it reaches a
termination statement
such as EXIT or STOP (see below). The system field SY-INDEX contains the
number of loop passes, including
the current loop pass.

Use the TIMES addition to restrict the number of loop passes to <n>. <n> can be
literal or a variable. If <n> is 0
or negative, the system does not process the loop. If you do not use the TIMES
option, you must ensure that the
loop contains at least one EXIT or STOP statement to avoid endless loops.

You can assign new values to a variable <f> in each loop pass by using the
VARYING option. You can use the
VARYING addition more than once in a DO statement. <f 1 > and <f 2 > are the first
two fields of a sequence of
fields the same distance apart in memory and with the same type and length.

In the first loop pass, <f> takes the value <f 1 >, in the second loop pass, <f 2 >, and
so on. If you change the
value of the field <f> within the DO loop, the value of the current field <f i > is also
changed. You must ensure
that there are not more loop passes than fields in the sequence, otherwise a runtime
error occurs.

Conditional Loops
To repeat a statement block for as long as a certain condition is true, use the
following control structure:

WHILE <condition> [VARY <f> FROM <f1> NEXT <f 2>].


<statement block>
ENDWHILE.

<condition> can be any logical expression. The statement block between WHILE and
ENDWHILE is repeated
as long as the condition is true or until a termination statement such as EXIT or
STOP occurs.

The system field SY-INDEX contains the number of loop passes, including the
current loop pass. The VARY
option of the WHILE statement works in the same way as the VARYING option of the
DO statement (see
above).
Terminating Loops
ABAP contains termination statements that allow you to terminate a loop
prematurely.

There are two categories of termination statement - those that only apply to the loop,
and those that apply to the
entire processing block in which the loop occurs. The STOP and REJECT
statements belong to the latter
group.

The termination statements that apply only to the loop in which they occur are
CONTINUE, CHECK, and EXIT.

You can only use the CONTINUE statement in a loop. CHECK and EXIT, on the
other hand, are context-
sensitive.

Within a loop, they only apply to the execution of the loop itself. Outside of a loop,
they terminate the entire
processing block in which they occur (subroutine, dialog module, event block, and so
on).

CONTINUE, CHECK, and EXIT can be used in all four loop types in ABAP (DO,
WHILE, LOOP, and SELECT).

You might also like