Questions and
Answers
SAP Interview Questions and Answers
This file was generated by an automated blog to book conversion
system. Its use is governed by the licensing terms of the original
content hosted at
sap-interview-questions-and-answers.blogspot.com.
Powered by
Pothi.com
http://pothi.com
Contents
SAP ABAP Interview Questions Part 3 : Smartforms 1
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.
1
Create a dummy Smartform / script in one client and check whether
they exist in the other client.
2
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
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 :).
3
*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.
4
Graphics can be maintained using T.code SE78.
5
You should use a template when the tabular output is fixed!
6
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.
7
How do you print address number in Smartforms ?
And finally, if you find this stuff useful ; please consider giving a
google plus or share this article with your friends using the 3 buttons
below.
8
SAP ABAP Interview Questions Part 1
Let’s make this list count and add some value to everyone.
All the best for your interview preparation . J Here you go!!
Important
Question 1: What is the difference between User Exit and
Function Exit?
User Exit Customer Exit
User exit is implemented in the A customer exit can be
form of a Subroutine i.e. implemented as:
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.
9
In case of a PERFORM, you have You have access only to the
access to almost all the data. So importing, exporting, changing
you have better control, but more and tables parameter of the
risk of making the system Function Module. So you have
unstable. limited access to data.
User exit is considered a A customer exit is considered an
modification and not an enhancement.
enhancement.
You need Access Key for User You do not need access key.
Exit.
Changes are lost in case of an Changes are upgrade compatible.
upgrade.
User exit is the earliest form of Customer exits came later and
change option offered by SAP. they 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.
10
Just as Google offers RFC is nothing but a remote
Image/Chart/Map APIs OR enabled function module. So if
Facebook offers APIs for there is a Function Module in SAP
Comment/Like, SAP offers APIs system 1 on server X , it can be
in the form of BAPIs. BAPI is a called from a SAP system 2
library of function modules residing on server Y.
released by SAP to the public so
that they can interface with SAP.
There is a Business Object No Business Object is associated
Associated with a BAPI. So a with a RFC.
BAPI has an Interface, Key Field,
Attributes, Methods, and Events.
Outside world (JAVA, VB, .Net or Non–SAP world cannot connect
any Non SAP system) can to SAP using RFC.
connect to SAP using a BAPI.
Error or Success messages are RFC does not have a return table.
returned in a RETURN table.
11
SAPSCRIPT can be converted to SMARTFORMS cannot be
SMARTFORMS. Use Program converted to SCRIPT.
SF_MIGRATE.
Only one Page format is possible Multiple page formats are
possible.
Such thing is not possible in You can create multiple copies of
SCRIPT. a SMARTFORM using the Copies
Window.
PROTECT … ENDPROTECT The Protect Checkbox can be
command is used for Page ticked for Page Protection.
protection.
12
Errors are automatically handled Errors should be handled in the
during the processing of the batch batch input program.
input session.
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 Background and Foreground
available in BAPI. processing options are available
for BDC.
BAPI would generally used for BDCs would be preferred for large
small data uploads. volumes of data upload since
background processing option is
available.
For processing errors, the Return Errors can be processed in SM35
Parameters for BAPI should be for session method and in the
used.This parameter returns batch input program for Call
exception messages or success Transaction method.
messages to the calling program.
Question 6: What is the difference between macro and
subroutine?
Macro Subroutine
Macro can be called only in the Subroutine can be called from
program it is defined. other programs also.
13
Macro can have maximum 9 Can have any number of
parameters. 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 Subroutine is used for
to be done in a program a number modularization.
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
Parameter ID command, you are IMPORT Statements, you are
using the SAP Memory. using the ABAP Memory.
SAP Memory is User Specific. ABAP Memory is User and
What does this mean?àThe data Transaction Specific.What does
stored in SAP memory can be this mean?à The data stored in
accesses via any session from a ABAP memory can be accessed
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
14
AT SELECTION-SCREEN OUTPUT is the PBO of the selection
screen.
15
An example would be ‘defining number ranges’ in SPRO.
16
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.
Important
Question 14: What will you use SELECT SINGLE or SELECT
UPTO 1 ROWS ?
17
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.
LOAD-OF-PROGRAM:
INITIALIZATION: If you want to initialize some values before
18
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
Question 17:
19
· 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?
20
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.
21
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.
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?
22
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.
23
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.
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.
24
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:
25
Are we done yet ? Definitely not !
Let the questions come and lets keep on updating this blog.
26
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?
If you have been appearing for ABAP interviews recently, Post your
experience to the comments below: Also provide answers if you
wish. I will update the answers soon and keep on adding ABAP
interview questions.
And finally , If you have found this post helpful , please consider
giving a :
If you think this can help others too, consider giving a:
It's now time for Sayonara !!
27
SAP Webdynpro 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.
@Component Level:
28
@View Level:
29
WDR_SELECT_OPTIONS in it.
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?
30
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.
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
31
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 method ovs_callback_object->Set_Input_Structure
32
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
33
component level and the view level.
@ Component Level:
@ View Level:
34
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 ).
35
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.
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 ).
36
Also explore other Plug Types:
37
your comments below:
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.
38
Question: Can you add custom buttons on Web Dynpro ALV
toolbar ? How?
Question: Can you add Image / Icons in Web Dynpro ALV cells ?
How?
How do you define and implement action handlers for them?
39
Question: Can you add links in Web Dynpro ALV cells ? How?
I hope this blog helps you crack your web dynpro interview J .
All the best dudes and dudettes !!
If you liked this post so far, please consider hitting the Google plus
button below:
40
BDC Interview Questions
41
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 Call transaction method is when
when the data volume is huge. the data volume is low
Session method is slow as Call Transaction method is
compared to Call transaction. relatively faster than Session
method.
SAP Database is updated when SAP Database is updated during
you process the sessions. You the execution of the batch input
need to process the sessions program.
separately via SM35.
Errors are automatically handled Errors should be handled in the
during the processing of the batch batch input program.
input session.
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?
42
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 Background and Foreground
available in BAPI. processing options are available
for BDC.
BAPI would generally used for BDCs would be preferred for large
small data uploads. volumes of data upload since
background processing option is
available.
For processing errors, the Return Errors can be processed in SM35
Parameters for BAPI should be for session method and in the
used.This parameter returns batch input program for Call
exception messages or success Transaction method.
messages to the calling program.
Question 4: How do you process errors in Call Transaction
method ?
43
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.
44
from SM35.
Sample Screenshot:
45
BDCDATA table structure
46
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.
Once the recording is done , one can Transfer it to the Batch input
program.
47
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.
48
Foreground
Display Errors Only
Background
49
presentation server
If you found the post helpful , consider hitting the Google plus
button------>
50
SAP ALE IDocs interview questions and answers Part 1
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 :)
51
ALE architecture comprises of 3 layers :
52
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.
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.
53
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.
01 IDoc generated
02 Error passing data to port
03 Data passed to port OK
54
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.
55
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.
56
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 12: Can you edit IDoc content for successful IDocs ?
No. You cannot.
57
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:
58
SAP Webdynpro ABAP Interview Questions Part 2
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
59
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.
60
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 by clicking on the link. This is not that tough ,
61
just spend some time with it and you should be okay.
62
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.
63
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.
64
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.
Wd_this
Wd_context
65
be accessed by using this attribute.
For example:
66
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.
67
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.
68
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:
69
It will be something like:
http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?s
So var1 and var2 are custom webdynpro URL parameters and you
can read them in the HANDLEDEFAULT method of your main
window:
70
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.
71
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.
If you think these were helpful and we need a part 3 too , let me
know in the comments below:
--> Thanks for your feedback , I have now posted Part 3.
72
SAP Web Dynpro ABAP Interview Questions Part1
73
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.
74
into separate parts using Custom Controller.
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:
75
Interface Node in Webdynpro ABAP
To create an interface node , set the interface property to yes as
shown in the screenshot to the right :
76
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.
77
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:
78
Now view is displayed . Suppose user does some action on the
view:
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.
79
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.
80
Web Dynpro Tutorial part 3
Web Dynpro Tutorial part 4
Web Dynpro Tutorial part 5
Web Dynpro Tutorial part 6
Web Dynpro Tutorial part 7
81