Professional Documents
Culture Documents
Answer :
ALV stands for ABAP List Viewer. ALV gives us a standard List format and user interface to
all our ABAP reports. ALV is created by a set of standard function modules provided by
SAP.
Question 2. What Are The Uses Of Alv Reports?
Answer :
o Sorting of records
o Filtering of records
o Totals and Sub-totals
o Download the report output to Excel/HTML
o Changing the order of the columns in the report
o Hide the unwanted columns from the report
Question 3. What Is Field Catalog In Sap Alv?
Answer :
o We have the following three ways to build a field catalog.
o Automatically through a Data Dictionary structure.
o Manually in ABAP program.
o Semi-automatically by combining the above two procedures.
o Declare an internal table of type SLIS_T_FIELDCAT_ALV.
o Call function module REUSE_ALV_FIELDCATALOG_MERGE.
Question 4. What Is Slis In Alv And Standard Type Tables Of It?
Answer :
SLIS is the type library for ALV grid.
If you'll use the ALV you have to add TYPE-POOLS : SLIS. command at the beginning of
your code.
o SLIS_LAYOUT_ALV,
o SLIS_T_FIELDCAT_ALV
o SLIS_T_LISTHEADER,
o SLIS_T_EVENT,
o SLIS_SELFIELD.
Question 17. What Is The Difference Between Client Dependent And Independent
Tables?
Answer :
If you have MANDT as the first field that is Client Dependant table otherwise it is not.
Usually most of the tables are client dependent. Only few like RFC Connections table
(RFCDES), Batch Jobs (TBTCO and TBTCP) are not client dependant.
Question 18. What Is The Difference Between At Selection Screen And At Selection
Screen Output?
Answer :
AT SELECTION-SCREEN OUTPUT is like Process Before Output Event. This would get
triggered before screen is displayed. This can be used to make fields invisible/visible based on
selection.
AT SELECTION-SCREEN: This would be triggered if you hit anything (Enter, Drop-
Down, Help, Execute) after the selection screen is displayed.
Question 25. What Is The Difference Between Select Single And Select Up To One
Row?
Answer :
SELECT SINGLE can be used if you know the full key to select a record. If you do not have
the full Key to select and you are interested in one single row, you could use SELECT UPTO
1 ROWS. If you use a SELECT SINGLE without a full key, you would get a warning
message in Extended Program checks.
If you have the full Key use SELECT SINGLE
If you do not have the full Key to select and you are interested in one single row, you could
use SELECT UPTO 1 ROWS..
Question 26. What Is The Secondary Index?
Answer :
There is an Index created by default for the Primary Key of the table and that is called
Primary Index. If you create, any other index that is called Secondary Index for that table.
Secondary Indexes are created to improve the performance of SELECT statements.
Question 29. What Is An Abap Memory And Sap Memory And How To Use Them?
Answer :
ABAP memory is a memory area that all ABAP programs within the same internal session
can access using the EXPORT and IMPORT statements.
SAP memory is a memory area to which all main sessions within a SAPgui have access. You
can use SAP memory either to pass data from one program to another within a session, or to
pass data from one session to another. Application programs that use SAP memory must do
so using SPA/GPA parameters (also known as SET/GET parameters).
The SET PARAMETER statement is generally used in the PAI event for a screen. The user will have entered
some value for a field on the screen and once you determine the correctness of that value, you can use the SET
PARAMETER ID statement in the PAI.
The GET PARAMETER ID statement is generally used in the PBO event. During the PBO, you are preparing
the screen for display to the user. Some of the fields on the screen may need to be filled with some default
values. This default value is the last correct value that has been entered for that field during the current logon
to the SAP system.
Hope that helps. Also there are other posts in this forum which address this question. Please search for them to
get more information.
Question 30. When The Top-of-page Event Does Get Triggered?
Answer :
TOP-OF-PAGE event will be triggered when the first ULINE, WRITE or SKIP statement
occurs in a program.
Question 35. What Is The Command To Be Used To Transfer The Data From One
Internal Table To Another Internal?
Answer :
Move itab1 to itab2
We can use APPEND for copying data from one ITAB to another ITAB by keeping in a loop.
But it is not efficient. Instead we can use as follows:
ITAB1[]=ITAB2[].
Question 36. How Can Validate Input Values In Selection Screen And Which Event
Was Fired?
Answer :
At selection-screen is an event, which is used to validate the selection screen input fields, if
you want to validate the particular input field we use at selection-screen on event.
AT SELECTION-SCREEN ON event is used to validate input.
Question 37. What Is The Difference Between Data Element And Domain?
Answer :
Data element is the collection of domain with short description, whereas domain is collection
of datatype and length.
Domain contains only technical attributes (data type , size) where as Data Element contains
Technical attribute as well as Semantic attributes(Field description).
Question 38. What Is The Difference Between Internal Table With Header Line And
Without Header Line?
Answer :
Internal table with header line is nothing but work area name as well as internal table name is
same, whereas internal table without header line is nothing but work area name as well as
internal table name is different.
FOR INTERNAL TABLE WITH HEADER we need not create work area. But not advisable
because the user may get confused what is work area and what is internal table since they
both will be having same names.
Ans: Yes, by using interface concept in SAP ABAp, we can achieve multiple inheritance
Ans: Abstract class is a class which contains at least one abstract method( Method
without implementation), Abstract class contains methods with implementation and
without implementation and we cannot create instance for the abstract class .
Abstract class is mainly for inheritance .
Interface contains methods without implementation .
Ans: Alias is an alias name for the interface method implemented in the class .
Ans: No, you can not raise events in interface, Because there is no Implementation for
the methods. We can create events in interfaces .
Ans: Public attributes can be accessed by class, subclasses and other classes where
as Private attributes can be accessed by class itself only.
Method Overriding
Method Overloading
Operator Overloading
Ans: In OOPs terminology, inheritance is a way to form new classes using classes that
have already been defined. Inheritance is intended to help reuse existing code with little
or no modification. The new classes, known as derived classes, inherit attributes and
behavior of the pre-existing classes, which are referred to as base classes.
Q15. What is Method Overriding ?
Ans:
Ans: Method overloading is in a class have many methods having same name but
different parameter called overloading or static polymorphism
Ans:
Inheritance: Inheritance is the ability of an object to inherit the properties and methods of
another object. This characteristic leads to the creation of families of objects (just like families
exist for humans) with parent objects and child objects.
Polymorphism: Polymorphism is about an objects ability to provide context when
methods or operators are called on the object.
Q21. Definition: Encapsulation
Ans:
Encapsulation: Encapsulation is the ability that an object has to contain and restrict the
access to its members. Encapsulation is a key concept of object programming that ensures the
autonomy and integrity of the objects.
Abstraction: Another OOPS concept related to encapsulation that is less widely used but
gaining ground is abstraction.
Ans: Through the process of abstraction, a programmer hides all but the relevant data
about an object in order to reduce complexity and increase efficiency. In the same way
that abstraction sometimes works in art, the object that remains is a representation of
the original, with unwanted detail omitted. The resulting object itself can be referred to
as an abstraction, meaning a named entity made up of selected attributes and behavior
specific to a particular usage of the originating entity.
Ans: In general there are two types of Objects: Instance Object and Static Object and
as such there are two types of Classes: Instance class and Static Class. Specifically
when it comes to visibility, Private class, Protected class and Public classes are the
types of classes one can have.
Ans:We can create four types of classes under final and only modeled
category(optional) with the private, protected, public and abstract instantiation.
Ans:
We can create four types of classes under final and only modeled category(optional)
with the private, protected, public and abstract instantiation.
Usual Abap Class.
Exception Class(With/Without messages).
Persistent Class.
Test Class(ABAP Unit).
Ans: Objects can only be created and addressed using reference variables. Reference
variables allow you to create and address objects. Reference variables can be defined
in classes, allowing you to access objects from within a class.
Ans: Objects can only be created and addressed using reference variables. Reference
variables allow you to create and address objects. Reference variables can be defined
in classes, allowing you to access objects from within a class.
Q29. What is the difference between Abstract method and a Final method ?
Ans:
Abstract method
Abstract instance methods are used to specify particular interfaces for subclasses,
without having to immediately provide implementation for them. Abstract methods need to be
redefined and thereby implemented in the subclass (here you also need to include the
corresponding redefinition statement in the DEFINITION part of the subclass). Classes with at
least one abstract method are themselves abstract. Static methods and constructors cannot be
abstract (they cannot be redefined).
Abstract (instance) methods are defined in the class, but not implemented
They must be redefined in subclasses.
Ans: The widening cast is, as with inheritance, the opposite of the narrowing cast: Here
it is used to retrieve a class reference from an interface reference.
Ans: In inheritance, static components are "shared": A class shares its non-private
static attributes with all its subclasses. => and -> are the component selectors used to
refer.
Ans: A component instance is a running component that can be run in parallel with
other instances of the same component.
Ans: BADI - Business Add Ins are enhancements to the standard version of the code of
SAP.
Filter Badi- Business Add-Ins may be implemented on the basis of a filter value. If an
enhancement for country-specific versions is provided for in the standard version, it is
likely that different partners will want to implement this enhancement. The individual
countries can create and activate their own implementation.
Ans:
Global
Local Exceptions Class.
Ans: Protected components Only visible within the class and its sub classes.
Ans:
Methods have a parameter interface (called signature ) that enables them to receive
values when they are called and pass values back to the calling program.
In ABAP Objects, methods can have IMPORTING, EXPORTING, CHANGING, and
RETURNING parameters as well as exception parameters.
CLASS DEFINITION. ... METHODS: [ IMPORTING TYPE EXPORTING TYPE
CHANGING TYPE RETURNING VALUE() TYPE EXCEPTIONS RAISING ]. ENDCLASS.
(signature of a method). CLASS IMPLEMENTATION. METHOD . ... ENDMETHOD.
ENDCLASS.
Ans: Yes, class can be created without any constructor. Default constructor will be
created when we define a class without constructor.
Q45. What Is The Difference In An Instance Method And A Static Method?
once .
Ans: Class is user defined data type which contains methods, events, attributes,
interfaces etc.
Q47. What Is The Difference Between Singleton And Static Class In Sap
Abap ?
Static Components: Static components (static attributes, static events and static
methods) exists globally, no need to create object/instance of the class to access them, we can
access them by using static component selector => .
Static Class: A class that only contains static components and no instance components
is referred to as a static class.
Singleton Class: It is a class which does not allow you to create multiple instances.
Ans: No we can not make interface methods as abstract or final in Object Oriented
ABAP
Ans: Global classes and interfaces are defined in the Class Builder (Transaction SE24)
in the ABAP Workbench.All of the ABAP programs in an R/3 System can access the
global classes
Q52. What Is A Local Class In Sap ?
Ans: Local classes are defined in an ABAP program (Transaction SE38) and can only
be used in the program in which they are defined.
Ans: Event is a mechanism by which method of one class can raise method of another
class, without the hazard of instantiating that class.
Ans: We need to follow below steps when working with events in Object Oriented
ABAP:
Define an event
Define a method
Link event and method and convert the method into event-handler method
Create a triggering method which will raise the event
Use set handler and register event handler method to a particular instance in the
program
Ans:
Ans:
Ans:
we cannot create an object to the abstract class instead create an object to the child
class and call the methods .
Abstract class are mainly used for creating inheritance.
Ans: It is the keyword which indicates the class definition is delayed or postponed or
Defined at some place in program.
We have no of events available in the classes when compared to ALV with function
modules which gives flexibility for the programmer to develop ALV'S for various scenarios.
We can display more than one ALV grid data on a single screen.
The ALV grid data is displayed in the form of custom container with which we can control
the size of ALV grid Whereas we cannot control the size of the ALV with function Modules.
We can also place different UI elements like checkbox, Radiobutton on the same screen
in addition ALV grid data.
Ans: Yes, class can be created without any constructor. Default constructor will be
created when we define a class without constructor.
Ans: Friend class is a class it can access private components of it’s friends class.
Ans: It just like a selfreference, by this we can call methods that are with in same
class with out creating object.
Ans:
Ans:
Local classes are defined locally with in a program and the other programs can’t access
the same classes directly.
But global classes are not like that they are globally accessible from ABAP environment.
Global classes are centrally defined in a repository. Transaction code for global classes
is SE24(class builder).
Ans: We can create many instances of the same class with in a program, but we cannot
create many instances of function group.
Ans:
Public class
Private class
Final class
Singleton class
Abstract class
Persistent class
Friend class
Ans:
Ans: In general we can not create object for a private class, but we can access
static method of a private class so call that method using its class name and import
that object.
For example take one static method with an exporting parameter inside private class
and write object creation code in that static method and export that object.
1. We have n number of events availabel in the classes when compared to ALV with function
modules.
2. We can display more than one ALV grid data on a single screen in OO-ALV. But in normal
ALV it is not possible.
3. We can control the size of ALV grid through custome container. we can not control the size of
the ALV with function modules.
4. we can place different UI elements(check box, radio button, drop down...) with OO-ALV but
we can't through ALV with function modules.
5. In OO-ALV using object oriented methods and classes(data secure), but normal ALV using
function modules
EVENT:-
Flow of event;
Load-of-Program
Initialization
At Selection-Screen
At Selection-Screen on <field(mention the field name)>
At Selection-Screen on block
At Selection-Screen output
start-of-selection
top-of-page
end-of-selection.
end-of-page.
At Pf<nn>
At Line-Selection
At User-Command
Top-of-Page during line-selection
Ans: Smart Forms are printing forms used to print Invoice and purchase order forms
etc. We are calling smartforms from ABAP programs then spools are generated, now
smartform ready to be printed.
SMARTSTYLES are used to define paragraph and character formats (fonts, barcodes,
etc.)
Ans: The Smartform that is created in the Development may not have the same name
in the Production server. So it is always advised to use the Function Module
SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the
Smartform name.
formname = 'ZSMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
ENDIF.
Q3. How can you make the Smartforms to choose a printer name by default?
Ans: In the CALL FUNCTION of the Smartform Function Module, set the output options
parameter to set the printer name.
The output options is of the type SSFCOMPOP which contains the field TDDEST. Set
the TDDEST field to your default printer name.
Ans: The input parameters for the smartform can be defined in Global Settings->Form
Interface.
The Associated Type must be defined in the ABAP Dictionary.
Q5. Where do you Configure the Adobe Forms / Smart forms / SAP Script to
the output type in NACE?
Choose the required application from the list and click on output types.
Chose one of the Output types from the right pane and click on processing routines.
If an SAP Script to be attached, fill-in the driver program name, Form routine and SAP
Script name in the field “Form” (shown below)”
If an Smart Form / Adobe Form are to be attached, enter the form name in the field
“PDF/SmartForm Form” and select one of the types “PDF” or “SmartForm”. (See the
screenshot below)
Change Editor
Q7. Where can I define my own global types for the smartform?
The types defined here will be global through the entire smartform.
Ans: Whenever using the global variables in the Program Lines, enter the variable
name in Input Parameters if you are going to use(read) the variable. If you are going to
both read/write the variable value enter the same in Output Parameters.
Q9. I have created a table node for display. Where can I check the condition
which must satisfy to display the table?
Ans: The conditions can be defined in the Conditions tab. In smartforms all the nodes
have a condition tab where you can specify the condition to be satisfied to access the
node.
Ans: To define Page Protect for a node go to the Output options and check the Page
Protection checkbox.
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.
Q13. How can you see the Smartform Print Preview output as list output?
Ans:
Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say
Zbarcode.
Step 2: For Smartform, create a character format C1 and use the recently created
Barcode Zbarcode.
Ans: 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.
Ans: 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.
Ans: In the Table Painter, you can specify the color and shading for the table lines.
Q18. How can you make the Smartforms to display a print preview by default
without displaying the popup for print parameters?
control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.
EXPORTING
output_options = output_options
control_parameters = control
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Q19. What is the difference in a Table and a Template in Smartform?
Ans: A Template has fixed number of Rows and Columns whereas a Table can have
variable rows and columns .
Ans: While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts,
for Smartforms the Page-Protection checkbox can be used to ensure page protection:
Q21. Can you move a Smartform from one SAP system to another without
using transports ?
Ans: 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.
Ans: Yes, you can create a Smartform without a Main Window. But there is no need to
do anything of such sort.
Q23. How do you find the name of the Function Module for a Smartform?
Ans: 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
Ans: We use the copies window to define an output area for the print output, whose
content you want to appear either only on the copy or only on the original. This allows
you to flag copies as copies when the form is printed.
You can determine where to print the inferior nodes of a copies window:
Ans: Final Window is called after all the other windows are called in a Smartform.
Q30. How can you display the total number of pages in Smartforms?
&SFSY-DATE& Date
&SFSY-TIME& Time
&SFSY-USERNAME& Username.