Basics of ERP, SAP, ABAP
Basics of ERP, SAP, ABAP
1) ERP
Enterprise Resource Planning
It's purpose is to manage any company functions.
2) SAP
SAP - System Application and Products for real time data processing.
or
SAP - System Application and Products in real time data processing.
3) History of SAP
SAP introduced by SAP AG in 1972 at Walldorf.( Germany)
SAP is a German based product.
4) Features of SAP
a)It is an integration of all functions in to one common software.
b)It is a Multi-lingual software.
C)It is a user-based license aggrement.( requires user name and password)
6) SAP Netweaver
SAP NetWeaver(NW) is an integrated technology platform which can support various
SAP applications.
Examples -> SAP ERP(Enterprise Resource Planning)
SAP CRM( Customer relationship Management)
SAP SRM( Supply Relationship Management)
SAP PI( Process Integration).
7) ABAP/4 ->
Advanced Business Application Programming language.
It is a 4th generation language.
ABAP lies on application Layer.
8) Modules of SAP->
Functional Modules
Technical Modules
Techical Modules->
SAP BASIS -> Administration and Monitoring of SAP systems.
SAP ABAP -> Programming language for SAP.
SAP BIBO( Business Intelligence , Business Objects) -> Reporting tool
10) SAP system Landscape
Development->Quality->Production
Transport Request -> It is a Mechanism to transport the objects from one system
to another system.
Instance number: Instance number of SAP system which is defined during SAP
installation.
It is of 2 characters long.It varies from 00 to 99.
System ID(SID): System id is a unique identification code for every SAP system
which is defined
during SAP Installation.
It is of 3 characters long.
Example : S4H,A4H etc.
Examples :
15) F4 Help -> It tells us what are the various possible values for any Input
field.
F1 Help -> It gives us the technical information of any field/column.
( Package for local objects : $TMP , local objects can never be transported)
Tables having MANDT field are called as client dependent tables or Client-
Specific tables..
Tables does not have MANDT field are called as Client Independent tables.
6) Size Category -> A table can store how many number of records.
Configuration Data->
(Employee Designation-> Senior Consultant( Vehicle allowance
applicable)
(Employee Designation-> other than Senior consultant( Vehicle
allowance not applicable).
8) Data Class -> Tells us in which portion of database the table data will get
store.
( Data/Record/Row/Tuple will be always in the primary key table, It may or may not
in the foreign key table)
Cardinality -> Number of records in key table, correponds to how many number of
records in to secondary/foreign key table.
1) We can select the checkbox Initial values for table fields, then the type
dependent NOT NULL value be
assigned to that field and the flag for NOT NULL is set to true on database.
2)Many databases, will simply initialize the value of a field as NOT NULL even
if we are not selecting this checkbox.
Scenario: Suppose we added a new column NEW_1 to table ZTORDH_78 and for
NEW_1 , the NOT NULL flag is true.
First Query will not return any result and the second query will return the
result.
DATA : lt_ordh_78 TYPE TABLE OF ZTORDH_78.
SELECT * FROM ZTORDH_78
INTO TABLE lt_ordh_78
WHERE NEW_1 IS NULL. "No Output
1) Transparent table - There is 1:1 relationship between the ABAP dictionary and
the database.( One table in ABAP dictionary corresponds to one table in database)
2) Pooled table - There is N:1 relationship between the ABAP dictionary and the
database.( Many tables in ABAP dictionary corresponds to one table in database)
3) Cluster table - There is N:1 relationship between the ABAP dictionary and the
database.( Many tables in ABAP dictionary corresponds to one table in database )
Structure of a Pooled table at the database layer - Tabname Varkey Dataln vardata
Structure of a cluster table at the database layer - Key Pageno Vardata
Buffering Options:
1) Buffering not allowed-> Table buffering is not performed for the table.
2) Buffering switched on-> Table buffering is performed for the table.
3) Buffering allowed, but switched off-> Table buffering is not performed for the
table when delivered,
but It can be activated in other systems
depending on how the table is used.
Types of Buffering:
A table which stores transaction data should not be opted for Full buffering.
The numbers of key field for a generic area buffering is less than the primary keys
of the table.
Topic : Structures
Difference between table & Structure -> Table has data , Structure does not have
any data.
Topic : INDEX
Types of Index -> 1) Primary Index -> Primary Key Will act as a Primary Index.
2) Secondary Index -> Based upon the requirement , We will
create secondary Indexes.
Index will store like this - Table name~Index name( Example - ZEMPTABLE~ABC , Where
ZEMPTABLE is table name , ABC is Index name).
Index for all database systems-> Index will be created on all the databases.
Index for Selected database systems-> We can choose database, where we want to
create the index.
No database Index-> Index will remove from the database, It's definition will be
there.
Topic : Views
Differece b/w table and View -> Table has data. View does not have any data.
Imp Point for Maintenance View and Help View : Not More than one record should
exist in the dependent/Secondary table.
Search help -> It is also called as F4 help. It's purpose is to display the various
Types of Search Help -> a) Elementary Search help-> Single search help.
b) Collective search help-> It is a combination of
elementary search helps.
Selection Method -> It is the name of the table or name of the view from where we
are fetching the data.
SDI's -> It's purpose is to make any field in the read only mode.
Exporting ->To Export the values from the hit list to the screen fields(Input
fields).
Hot Key -> The hot key permits the user to select an elementary search help from
the collective search help directly in the
Locking -> If multiple users want to change the same data at the same time ,
then at a time only one user can change the data. The purpose of locking
is to achieve synchronization.
Lock Modes : 1) Read Lock( Shared Lock , S) - Others user can view the data, but
can not changed the data.
2) Write Lock( Exclusive lock , E) - Others user can not view the data
and can not changed the data.
3) Enhanced Write Lock( Exclusive lock without cumulation,X) - Others
user can not view the data and can not changed the data +
It
protect the further access for the same transaction.
1) The database Utility acts as a Interface between the ABAP dictionary and the
database.
2) The database utility allows you to edit database objects.
3) Transaction Code : SE14
Precaution :
1) Do not Perform any database operation on the table while performing the database
utility.
Pretty Printer -> for Proper Indentation. Makes the code easy to read.
Q-3 : If we are passing only a low value and High value in Select-option, what is
the relational operator?
Answer : BT
1) TYPE - We assign data type directly to the data object while declaring.
It is a keyword used to refer to a data type.
DATA : LV_DATA TYPE CHAR1.
2) LIKE ->We assign the data type of another object to the declaring data
object.The data type is referenced indirectly.
Like is a keyword used to copy the existing properties of already
existing data object.
Case is always much more efficent ....because while you are using ELSEIF
condtion ...it will check all the condition ...untill it will get get a true
condtion ...
while you are using case...it will only go to the true condition
4) CONDENSE NO-GAPS -> Used to remove the leading space , trailing space and spaces
between the individual strings also.
5) FIND -> FIND statement is used for finding occurrences of a pattern within a
string.
7) TRANSLATE -> The TRANSLATE statement converts characters into upper or lower
case.
8) SHIFT -> This command is used to shift the contents of a string. It shifts a
string by a given number of places.
Syntax : shift s_field [ by n places ] <mode>( By default mode is LEFT)
Example : SHIFT lv_data BY 5 places LEFT/RIGHT/CIRCULAR.
SY-TABIX -> It is a system variable . It retruns the current line index inside a
loop.
1) Standard Internal table -> Simplest Internal table(based upon Linear Search -
Sequential Search).
2) Sorted Internal table -> Binary Search( It will search for middle element, in
the upper half the values will be less than the middle element,
In the lower half the values will be
greater than the middle element).
3) Hashed Internal table -> Hash function( Hashing- It will directly return the
address of the record)
1) Internal table with header line -> Implicit(Internal) work area. SAP will
automatically create the work area.
Work area name is same as that of internal
table.
Obsolete now
As work area name is same as that of internal table, So clear and REFRESH have
different meaning in Internal table with HEADER LINE.
As work area name is different from Intenal table name, so both CLEAR and REFRESH
is used to clear the contents of Intenal table.
SORT -> Is to sort the internal table.If we are not specifying anything, then by
default It will sort in the ascending order.
If we want to sort in descending order, then we need to specify the keyword
Descending.
LOOP -> To read the records one by one from the Internal table.
READ TABLE-> It will read the first matching record from the Internal Table.
DESCRIBE TABLE -> It will retrun the number of records in the internal table.
Syntax : DESCRIBE TABLE (name of the internal table) LINES ( varibale name ) .
COLLECT -> It will make sum of amount values, based upon unique character values.
Example :
Company name Department Amount
Capgemini HR 10000
Capgemini Admin 20000
Capgemini Training 10000
Capgemini Admin 10000
Capgemini HR 20000
AT FIRST -> It will trigger for the first iteration of the Internal table.
AT LAST -> It will trigger for the last ireration of Internal table.
AT NEW <FIELDNAME> -> Statements will execute for a group of records, having the
same value for field name, but for the first time.
AT END OF <FIELDNAME> -> Statements will execute for a group of records, having the
same value for field name, but for the last time.
1) Never Use * , Make a structure of those columns which are required in the
output.
2) Fetching sequence should be same as that of structure sequence, otherwise type
mismatch or wrong output will be there.
3) Fetching sequence should be same as that of Data Dictionary sequence.
4) Where condition sequence should be same as that of Data Dictionary sequence.
5) Never use corresponding keyword.
6) Use Binary Search in Read table.
7) For Fetching data from Foreign key tables/depenedent tables - check for SY-SUBRC
, Internal table not Initial condition.
8) Use Paraller cursor in Nested loops.
9) For Mutiple conditions, Use CASE Instead of IF.
Paraller Cursor -> It's purpose is to achieve performance in case of nested loops.
Syntax :
MESSAGE E000(ZMSG_88).
Where
Message = Pre-defined keyword.
E = Message Type
000 = Message Number
ZMSG_88 = Message Class.
Answer : & -> Operator which is used to pass values to a message number.
Answer : 4.
The program in which we are displaying the output with the help of WRITE statement
is called as classical report.
3) START-OF-SELECTION -> This events calls when user clicks execute button on the
selection screen.
The selection logic is the part of this event.
4) END-OF-SELECTION -> This Event calls when selection process ends.( Call after
End of data/Records).
6) END-OF-PAGE -> The pupose of this event is to provide footer or some information
at the end of a page.
Pre-requisite : We need to provide LINE-COUNT.
Example - LINE-COUNT 5(2) -> It means end of page event will trigger after 3
lines of data and 2 lines are reserved for the footer.( Total : 3+2 = 5).
The syntax to create own personal function( PF-STATUS) -> SET PF-STATUS 'STAT'.
( STAT is the name of PF-status)
1) AT USER-COMMAND -> When user clicks on the button created by PF-status, at that
time AT USER-COMMAND Event is triggering.
system variable for User command -> SY-UCOMM.
2) AT LINE-SELECTION-> When user double clicks on the line or select a line and
press F2, at that time AT LINE-SELECTION event will trigger.
Q-4: How to enable double click on a line While creating your own PF functions?
Answer : You need to provide the function code for F2 in Recommended Function key
settings.
Function Module -> It is a reuseable component. We will create only once and we can
use at several places. It is an example of Modularization technique.
Attributes - It provides the generic infomation about the Function Module.( Date,
User name, Function group name , Package name).
Import - Input
Export - Output
Changing - Input/ Output.
Tables -> For Internal tables
Exceptions - It's purpose is to raise the exception/Error.
Source Code - It's purpose it to write the logic.
We can not change the sequence of TABLES USING CHANGING, but If one is not required
, We can skip it.
PERFORM ( PERFORM NAME) IN PROGRAM ( PROGRAM NAME) TABLES USING CHANGING IF FOUND.
Q-1 : Difference between Include program and Function Module.
Answer : Include Program does not have any Interface( No Input/Output Provison),
But the Function module has a Interface.( Input/ output provison with
Answer : Include Program does not have any Interface( No Input/Output Provison),
But the Subroutine has a Interface.( Tables, Using, Changing)
Function Module : We can check the output of Function module using F8.( We
can independently run a Function module to check the output)
Subroutines : We can not run a subroutine independently.
Topic : Debugging
Debugging - 1) Debugging is a technique by which we can find the error, Correct the
error and detect the error.
2) SAP Debugger is a part of ABAP workbench only.
Ways of Debugging - 1) Put the breakpoint on any executeable statement and program
will automtically stop at that point.
2) We can debug the code with the help of transaction code /h.
Syntax : BREAK-POINT
Put the Breakpoint on Keywords in Debugging Mode- Example - SELECT, CALL FUNCTION ,
MESSAGE
Break-points limit = 30
Watch point limit = 10
Topic : Field-Symbols
Field symbol is a placeholder for data object, which points to the value present at
the memory address of a data object
at run time.
https://erproof.com/what-is-ricefw-in-sap/