SAP ABAP Interview Questions
SAP ABAP Interview Questions
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!!
Important
Question 1: What is the difference between User Exit and Function Exit?
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 ?
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.
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?
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.
Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.
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.
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
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.
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:
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
Question 17:
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?
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).
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?
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?
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.
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.
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.
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.
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.
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.
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 :)
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.
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 .
01 IDoc generated
02 Error passing data to port
03 Data passed to port OK
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.
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 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.
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.
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 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:
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 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.
USING G_T_BDCDATA
MODE 'E'
UPDATE 'S'
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.
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:
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:
'PROJ-PSPID'.
'=BU'.
Question 8: What are the 3 methods that we use in sequence in a Batch input session
method ?
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.
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?
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 14: How do you read files from the Application server ?
Question 15: How do you read files from the presentation server ?
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:
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 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.
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:
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.
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.
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.
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.
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.
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.
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
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.
Flow layout, Row Layout, Grid Layout, Matrix layout and the form layout.
The layout can be set at a Container level.
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.
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?
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.
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.
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.
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 ).
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 ).
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: 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: 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?
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.
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:
Answer:
A, B, D
To start the ABAP Editor to create or change ABAP programs, the R/3 system offers
three possibilities:
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.
Forward navigation by double-click can be used at any point where the names of
ABAP programs appear in
the ABAP Workbench.
A. ZQSDABAP
B. YMYFIRSTABAPPROGRAM
C. Z”MyFirst ABAP PROGRAM
D. Z==FIRSTABAPPROGRAM
E. THISISMYFIRSTABAPPROGRAMME
Answer:
A, B, E
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:
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.
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?
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:
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.
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?
Answer:
B, C
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
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.
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
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.
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.
Answer:
A, B, C
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:
<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).