Professional Documents
Culture Documents
Example-
2. What is an Interface?
An interface is not a class. It is an entity which can’t have implementation. An interface
can only contain empty method declaration and components. Interface components are
always public. We can later change the visibility of the components within the
implementing class using the ALIASES.
Example-
The concept of restricting the instantiation of the a class to only and only to one
object is called Singleton. As name suggests, it will restrict to create only one
instance of a class. The class will have a logic in place which will deny if the
application will ask for more than one instance.
We can use the CLASS-DATA(static data) to save the created instance within
the class and check with that instance, if application asks for a new instance.
Abstract methods are declared in abstract classes and cannot be implemented in the same class. They must
first be implemented in a subclass of the inheritance tree. Abstract classes cannot, therefore, be instantiated. A
non-abstract method is a concrete method. With the exception of the instance constructor, concrete instance
methods of a class can also call their abstract methods.
Final methods can no longer be redefined in subclasses. They cannot have any additional subclasses and
close an inheritance tree definitively.
Notes
In classes that are both abstract and final, only the static components can be used. Although instance
components can be declared, they cannot be used. Specifying ABSTRACT and FINAL together
therefore is useful only for static classes.
Q what is Singleton?
Q. how to achieve the edit and coloring of ALV fields in factory method?
CORE ABAP.
DATA DICTIONARY-
Q. how to validate the input fields when users try to insert char or alphabet in numeric field
value.
Transaction Codes
SE54: Generate Table Maintenance Dialog
SE55: Table view maintenance DDIC call
SE56: Table view display DDIC call
SE57: Deletion of Table Maintenance
SM30: Maintenance Table Views: to define events we can do using TMG->Environment-
>Modification->Events
Q. if you don’t have any access to put external breakpoint. then how you will be
debugging the RFC or service .
Using Tcode SRDEBUG we will click on activate Debugger and provide the FM, Class or
Method name where we want to put the External debugger.
Q. what is search help exit. Basically an enhanced Search help based on requirement to
display possible entries when users clicks on F4 button on selection screen.
SHLP
Call-control
SHLP_TAB-descriptions
RECORD_TAB-structure.
Once done then save it in search help exit input screen field. And activate it.
Elementary- Elementary search helps describe a search path. The elementary search help must define
where the data of the hit list should be read from (selection method), how the exchange of values
between the screen template and selection method is implemented (interface of the search help) and how
the online input help should be defined (online behavior of the search help).
Collective -Collective search helps combine several elementary search helps. Collective search help
thus can offer several alternative search paths.
The reason for enhancement category is to say what type of fields you can have in your table. For
the SAP tables when you want to make enhancements (adding your own fields- append structure)
Using Table entry->Create. Will create the entries and save it in TR.
A Maintenance View in SAP ABAP is a view that combines multiple tables into a
single view using outer join and is mainly used to maintain multiple tables
altogetherTcode is SE54.
http://www.teamabap.com/2014/05/maintenance-view.html
In the database view we simply display the scattered data of the application object in
one view where as maintenance view allow you to display modify and create the data.
A maintenance view permits you to maintain the data of an application object together.
Here all the tables in the maintenance view must be linked with a foreign key
relationship and join conditions can be formed only using the relationship
G: Customer table, SAP may insert new data records, but may not overwrite or delete existing
data records. The customer namespace must be defined in table TRESC.
E: System table with its own namespaces for customer entries. The customer namespace must
be defined in table TRESC.
S: System table, data changes have the same status as program changes.
W: System table whose data is transported with its own transport objects (e.g. R3TR PROG,
R3TR TABL, etc.).
Lock objects are used to synchronize the multiple set of users who are accessing the
same set of data.
1. Exclusive Lock.
2. Shared Lock.
3. Exclusive but not cumulative lock.
Shared Lock
Several users can read the same data at the same time, but as same as a user edits
the data,a second user can not longer access this data. Requests for further shared
locks are accepted, but exclusive locks are rejected.
https://www.sapnuts.com/courses/core-abap/open-sql/creating-lock-objects-SAP.html
Q. how to make the test data while in debugging when calling the service and
debugging the RFC.
While debugging if come across the FM or Class then we can go to tools there we will have
the options to save the parameter as Test data.
WEBDYNPRO
Q. lead selection 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/Drop Down/Radio and this
selection is called lead selection.
0..1 Any cardinality Lead selection can be empty. Multiple selection is not possible.
1..1 Any cardinality As the node selection has to contain exactly one element, the lead
selection is always set (provided the node is not empty). Multiple
selection is not possible.
0..n 0..n, 1..n only Multiple selection of elements is possible. The lead selection can be
empty.
1..n 1..n only Multiple selection of elements is possible. The lead selection is set
automatically (provided the node is not empty).
Unless you say otherwise, a node will have a selection cardinality of 0..1 meaning that you may select
zero or one element at any one time. If such a node were displayed using a table UI element, you would
be able to select only one row at a time. However, if you wish to allow the user to select multiple rows,
you will need to change the selection cardinality to 0..n, meaning that zero or more elements may be
selected.
Selection Cardinality- It specifies how many records that can be selected from a node.
Collection cardinality- It specifies how many records that can be stored in a node.
Assistance Class in WD is used for storing common reusable logic apart from component controller.
It can also be used to store Text Symbols for displaying messages or label’s for the WD application.
Per WD session there will be one instance of assistance class ( if mentioned ) will be automatically
instantiated and you can access it by wd_assist.
It can also be used to store a reusable set of constants, public attributes, types etc.
Assistance class has some standard methods like get_text to fetch text from text symbols.
To create an assistance class you have to create a normal class and then mention
CL_WD_COMPONENT_ASSISTANCE as superclass. Then you can metion you class name in WD
Component Header Details.
We can display error, warning, success, attribute error etc messages in Web Dynpro
ABAP using interface IF_WD_MESSAGE_MANAGER, when we raise messages using
IF_WD_MESSAGE_MANAGER, the messages will be displayed in Message Area UI
element, by default Message Area UI element is at the top of the screen.
Interface -- wd_cpifc_select_option
Q ALV in WEBDYNPRO ?
SMARTFORM
Smartform can have only one main window but if we want to create another window we can
achieve by custom window.
Only difference is table node also provides u a way to format the output using line types,
so u can show the output using rows and cells,
loop node is used when u dont need to format the output using a table node so in that case only loop
node is used.
Run T-Code ‘WE82’. Now we have to link these created IDoc types and Message types.
Control Record — contains control info ex: receiver port etc
Data record — Contains IDOC data
Status — holds IDOC status.
In Source system:
Segment Creation WE31
In Destination System:
Creating FM SE37
TCODE WE19 provide the basic type and then inter the inbound function module you will
find the checkbox for Call in debug mode.
https://www.sapnuts.com/tutorials/Using-WE19-to-reprocess-IDOC-or-Debugg-IDOC.html
We02 or we05
In BDC the data will be flowing in SAP R/3 through screens (Ex: MM01), BDC is a
inbound process.
Call Transaction.
Session Method.
In BDC we use structure BDCDATA for Batch Input, which has following components.
A BDCDATA structure can contain the batch input data for only a single run of a transaction
In CALL TRANSACTION method, we need to create Log for the Error Message, for this we use structure
BDCMSGCOLL.
CALL TRANSACTION 'ME51' USING t_bdcdata
MODE w_mode
UPDATE 'S'
MESSAGES INTO t_msg.
https://www.sapnuts.com/courses/core-abap/bdc/recording-a-transaction-S.html
1. BDC_OPEN_GROUP.
2. BDC_INSERT.
3. BDC_CLOSE_GROUP.
In BDC we use structure BDCDATA for Batch Input, Which has following components.
A BDCDATA structure can contain the batch input data for only a single run of a transaction
http://saptechnical.com/Tutorials/ABAP/BDC/Session.htm
Q we have header and item details and need to be transport to the SAP system how do we
do in BDC?
10. SE30 is the Runtime Analysis transaction and can be used to measure the application performance.
11. SAT transaction is the replacement of the pretty outdated SE30. Provides same functionality as SE30 plus some
additional features.
12. ST12 transaction (part of ST-A/PI software component) is a combination of ST05 and SAT. Very powerful
performance analysis tool used primarily by SAP Support.
13. One of the best tools for static performance analyzing is Code Inspector (SCI). There are many options for finding
common mistakes and possible performance bottlenecks.
14.
Q why do we use for all Entries and checks to keep in mind while using for all entries
For all entries we use in place of table joins, make sure the first table is not initial before
appending with use of for all entries in another IT.
ENHANCEMENTS
SE18 is the T-code for BADI definition, SE19 is the T-code for BADI implementation.
Types of BADI
Single implementation BADI:- A BADI which has only one implementation (single
class) is called single implementation BADI.
Filter BADI It is type of BADI which has a filter value so that only those implementations
which satisfy the filter value are executed. The remaining implementations are not
executed this type of BADI is called a filter BADI.
Properties of BADI
With classic BAdIs, a BAdI object is created by calling a factory method, and referenced via a
reference variable of the type of the BAdI interface.
With new BAdIs, a BAdI object is created via the ABAP statement GET BADIas a handle
for the calls of BAdI methods by CALL BADI, referenced via a reference variable of the type of the
BAdI.
CALLMETHODcl_exithandler=>get_instance
EXPORTING
exit_name=`BADI_NAME`
CHANGING
instance=bd.
flt-lang=`D`.
CALL METHOD bd->method
EXPORTING
x=10
KERNEL BADI
Q how you use multiple BADI, do we need to deactivate or you can activate all
implementations.
A BADI that has the multiple use checkbox ticked simply means that you can
not only create multiple instances but also have more than 1 of them active at
the same time. This is unlike a standard BADI without the multiple use option
ticked, which can only have one implementation active at any one time.
There is however one caveat to multiple use badi’s, although you can have
multiple implementations you can’t specify which order these will be fired in.
Therefore, each implementation needs to be coded as a separate entity and
must not rely on a specific execution sequence or another one being completed
first i.e. you could not have one performing some checks and another updating
a database based on these checks.
Q. what is function exit?-Customer Exit—Using tcode SMOD and CMOD, we can find the
exit using search options in Main Program but Text CALL-CUSTOMER FUNCTION,
SCREEN.
In SMOD you can find the Exist available for particular standard program of Tcode using
Package.
In CMOD we can create project and Implement the Exist using enhancement assignment
and
Implicit Enhancement- Were we can add our code to standard program beginning and end
of form and end form under include.
go to edit -> Enhancement Operations -> Show Implicit....Q. what is kernel BADI?
Enhancement section is used to replace a set of code or statements with the customer (custom code)
MODULE POOL
PAI (Process After Input): Triggered after MPP screen is displayed whenever user
raises an action. Also,Now PBO is also triggered.
POV (Process On Value Request): Triggered when User Clicks on search help or F4
Button.
POH (Process On Help Request): Triggered when User Clicks on search help F1
function key
Q. CHAIN ENDCHAIN.?
If u want to validate more than one field u can do that by using CHAIN ENDCHAIN concept.
i'm placing a example where i've used chain endchain concept.
i wrote it in PAI of my code to validate userid and paswrd
chain.
field zempdetails-empno.
field zempdetails-password.
MODULE USER_COMMAND_0100.
endchain.
all of the fields on the screen that belong to the processing chain (all of the fields listed in the field
statements) are made ready for input again