SP Rao ABAP Project Notes
SP Rao ABAP Project Notes
SP Rao ABAP Project Notes
When ever we read the single record from the internal table based on the
condition, then we must use binary search because binary search is faster than linear
search.
Note: - Before applying the binary search we must sort the internal table based on the
condition field.
Syntax: -
Read table <internal table> into <work area> with key <condition> binary search.
Ex: -
Sort it_ekko by ebeln.
Loop at it_ekpo into wa_ekpo.
----
----
Read table it_ekko into wa_ekko with key ebeln = wa_ekpo-ebeln binary search.
--- -
---
Endloop.
Avoid the dead code: -
After completion of the program we perform the extended program check to avoid
the unnecessary declarations of the program.
When ever we are working with for all entries, then we must consider following things.
1. Check the higher-level internal table having the data or not.
2. Sort the higher level internal table
3. Delete adjacent duplicates from higher level internal table, if it’s required.
4. consider all the possible concitions in the where concition of the next level select
query
1. If you aren’t higher level internal table having the data or not. If higher level internal
table having no data then it’ll fetch entire data of data base for the next level.
Select ebeln bedat lifnr from ekko into table it_ekko where ebeln in s_ebeln.
It_ekko where ebeln in s_eblen.
If not it_ekko is initial.
Select ebeln ebelp - - - from ekpo into table it_ekpo for all entries
In it_ekko where ebeln – it_ekko-eblen.
Endif.
In the for all entries when ever we fetch the master data based on the transactional data.
When ever we fetch the header data based on the item data then we must apply delete
adjacent duplicate in the higher level internal table.
Note: - Before using delete adjacent duplicates we must sort the internal table based on
comparing fields.
Select EBELN BEDAT LIFNR from EKKO into table it_ekko where Ebeln in s_ebeln.
It_ekko1 = it_ekko.
Sort it_ekko1 by lifnr.
Delete adjacent duplicates from it_ekko1 comparing lifnr.
If it_ekko1 is not initial.
Select lifnr name1 ort01 from lfa1 into table it_ekko1 where lifnr = it_ekko1-lifnr.
Consider all the possible conditions in the next level select query: -
6. We always use select single if you know entire primary key combination of data base
table.
Select single bukrs kunnr akont from knb1 into table it_knb1 where bukrs = ____ and
kunnr = _______ .
We always use select up to 1 rows. If you know part of the primary key combination of
data base table.
Select bukrs kunnr akont from knb1 into table it_knb1 up to 1 rows where bukrs = ____ .
Endselect.
Note: - Select single is faster than select up to 1 rows. Because select singe hits the data
base once & up to 1 rows hits twice.
Tables t001.
Select-options s_bukrs for t001-bukrs.
Tables t001.
Select-options s_bukrs for t001-bukrs no display.
8. We always use list display instead of grid display. Because list display is faster than
grid display.
9. We never write select *. Instead of this we use select fields (field 1, field 2, - - field n).
Select Ebeln bedat lifnr - - - from ekko into table it_ekko where Ebeln in s_eblen.
Select butxt ort01 bukrs from t001 into corresponding fields of table it_t001 where bukrs
in s_bukrs.
Select bukrs butxt ort01 from t001 into table it_t001 where bukrs in s_bukrs.
12. We never write a select query with in a select query. (we never write nested selected
query).
Select bukrs butxt from t001 into wa_t01 where bukrs in s_bukrs.
Select bukrs kunnr from knb1 into wa_knb1 where bukrs = wa_t001-bukrs.
Endselect.
Endselect.
Ouput:-
1000 TCS 241
1000 TCS 291
2000 IBM 116
Move-corresponding wa to wa1.
Wa1-bukrs = wa-bukrs.
Wa1-ort01 = wa-ort01.
17. We always use ‘WHILE’ instead of ‘DO’ because ‘WHILE’ is faster as well as clearer
than ‘DO’.
18. We always use case instead of nested if. Because case is faster than ‘IF’.
Types of project:-
1. Implementation project
2. Up gradation project
3. Maintenance / Support project
4. Roll out project
Implementation project: - When ever we want to develop the SAP from
fundamental on wards then we go for implementation project.
Up gradation project: -
When ever the version is changed if you want to implement the new technologies
into our existing systems then we go for up gradation project. These are two types of up
gradations.
1. Technical Up gradation
2. Functional Up gradation
In the technical up gradation more ABAPer s & BASIS people are involved & very few
functional people are involved. It can take 30 days to 3 months time. In the technical up
gradation first the basis people install the new SAP version later they copy the objects
from existing production system to new development system.
Note: - The ABAPer perform the above phases in the development of new server.
SPDD phase: -
During this phase, it compares the dictionary objects (tables, domains, etc) from old
version to new version. After executing SPDD transaction some of the objects are
displayed in green colour some of the objects are displayed in pink colour. Open the each
& every pink colour object & activate the either old one or new one with the help of
functional people.
SPAU phase: -
During this phase we compare the work bench objects (function module, programs) from
old version to new version. After executing SPAU transaction some of the objects are
displayed in green colour some of the objects are displayed in pink colour. Open the each
& every pink colour object activate the either old one or new one.
DBACOCKPIT: -
During this phase we identify the all the data base tables which secondary index is in
active. After executing the DBACOCKPIT transaction if displays the data base tables
which secondary index is inactive.
Open the each & every table in ‘SE11’. Click on indexes in the application tool
bar. Activate the secondary index.
UCCHECK phase: -
In the old, each & ever character is identified by 32 bit. Now a day it identifies through
64 bit. After executing the UCCHECK transaction it displays the all the programs which
unique code is inactive. Then open the each & every program in SE38 in change mode. In
the menu bar click on go to attributes. Select the check box unique code. Check
activated.
Note: - In the real time at the time of implementation project we use ASAP
methodology.
SAP notes: -
When ever the company implements the new technologies (Support packs, SAP patches)
in the existing system some times damages any where in the SAP. If you want to
overcome those damages we identify the right note & implement.
EX: -
In my company at the time of implementing the HR support packs it damages the all
other layout lines here we identify the SAP note based on the documentation which
provided by SAP. We download the SAP note from service through SAP.Com website
with the help of basis people. Later we implement the note in the development note
In the development server the ABAPer having create, change, display access of ABAP
transaction codes (SE11, SE12, SE16, SE38, SE93, SE91, SE80, SE41, SE51, SE09,
SE10, - -) & only display access of transactional t.codes (XK03, XD03, MM03, ME23N,
- -). When ever we develop any conversion programs, enhancements if we need create
access of any transactional t.codes then we put a mail to security people (Part of BASIS)
then the security people take conversion from technical team leader & provide access.
In the real time after we receive the logon details of development server we login in the
development client then navigated to change password. Then change the password. After
change the pass word we create a test program in ABAP editor then it’ll ask developer
key at the first time. Then take a screen short & sends to BASIS people. Then the BASIS
people develop the developer key. Based on this develop key we logon into the system &
implement the program. From next time onwards it won’t ask any developer key. When
ever we execute any ABAP related t.code if you get the error message i.e. you aren’t
authorized for the transaction t.code (xyz). Then we execute ‘/OSU53’ transaction. Take a
print screen & put a mail to BASIS people then they provide access based on the screen
sort.
Based on the technical spect (TS), the ABAP consultants develop the object n
de4velopment server based on the coding standards & naming standards & save in our
own package & create a new request number. In the real time packages are already
created by BASIS people based on the object category or module.
After completion of object the ABAP consultant prepares the Unit Test Plant (UTP).
If the ABAP consultant gets the expected output & actual output is same then they
informed to BASIS people to transport the request number of the object from
development server to quality / test server.
The BASIS people release the request & transfer the request from development
server to quality server & inform to ABAP consultant. (In some companies ABAPer
release the request through SE09 / SE10 & BASIS people transport the request from
development server to quality server through ‘STMS’ transaction).
After receive a mail the ABAP consultant forward the mail to functional people &
technical team leader to test the object in quality server. After receive a mail the
functional people test the object in the quality server along with process leads & prepares
the user acceptance test (UAT).
If the functional people get the expected output & actual output is same then they
informed to BASIS people to transport the same request from quality to live server.
Otherwise they informed to ABAP consultant to provide the changes in the code.
In the live server the end users use the object if any changes are needed they
informed to functional & technical people. If any changes are coming then we do the
changes in development server create a new request & transported to quality & live
server.
Note: - The object is copied from development server to quality server & copied from
quality to live server (the object is available in all servers).
Note: - We can create any umber of request numbers to the object.
After completion of the object in the development server we perform the following
activities.
SQL trace: -
This is used to identify the execution time of a particular select query. The transaction
code for SQL trace is (ST05).
Runtime analysis: -
This is used to identify the total execution time of the function module. The transaction
code for runtime analysis is SE30.
Note: - Runtime analysis also contains trip & tricks to identify which statements we use
which we dot use.
Note: - After completion of the program we click on pretty printer in the application
toolbar to align the code.
Note: - In the real time the maximum program execution time in the four ground is 600
seconds or 10 minutes. If the program exceeds 10 minutes the it goes to dump. If you
want to know the total execution time of these types of programs then we run the
program in background & identify the total execution time ‘SM37’ transaction.
Note: - ‘SYST’ is the structure which contains all the system variables.
‘TSTC’ is the data base table which contains all the transaction codes & program
names.
‘DD02L’ is standard data base table which contains the all standard data base
tables.
‘DD03L’ is the standard data base table which contains all SAP table fields.
PO number : 3000000008
GR number : 5000002445
IR document : 5105604171
Payment doc : 5100000026
Vendor : 3910
The PPC department creates the requirement plan in a particular period based on the
requirement plan. They create the plant order. Then the plant order (system) check the
requirement plant & warehouse stock & generate some of the process orders & some of
the purchase Requision. Purchase Requision later converted into purchase orders and
goods receipts.
The production department or PPC department generate the process order with the
required materials & sends to warehouse department. When ever the process order is
created then automatically one reservation number is generated & reserved the stock.
Against the process order the warehouse people issue the goods to the production with
MIGO transaction with 261 movement (and also issue the goods against cost center with
MIGO transaction & 201 movement to calculate the cost).
After receiving the materials the production people prepares the finished product
based on the recipe (procedure) & sends to warehouse department. The warehouse
department creates the goods receipt against process order with MIGO & 101 movement
type.
When ever the warehouse people create the GR against process order then
automatically one inspection lot number is generated.
K Vendor
D Customer
S G/L
T Open
A Cleared
REPORT ZPORJECT.
******************************************************
* PROGRAM : ZVR001-SPT_SALES_REGISTER *
* AUTHOR : SATISH *
* PURPOSE : TO DISPLAY SALES TAXEX & INSURENCES *
* START DATE : 28.02.2015 *
* FINISH DATE: 06.03.2015 *
* SUPPLIER : SPRAO TECHNOLOGIES *
* PACKAGE : *
* REQUEST NUM: SRYK900117 *
******************************************************
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VTWEG'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Distribution Channel'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VKGRP'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Sales Group'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BEZEI'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Description'.
APPEND WA_FCAT TO IT_FCAT.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'WERKS'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Plant'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Plant Desctiption'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BZIRK'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Sales District'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BZTXT'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'District name'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'SPC'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'SOLD TO COUNTRY'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'SHC'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'DEST.COUNTRY'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'KUNAG'.
WA_FCAT-COL_POS = w_cops.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'SPN'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'SOLD TO PARTY NAME'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'SHN'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'SHIP TO PARTY NAME'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'EMPST'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Final Customer'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BSTKD'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'PO Number'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BSTDK'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'PO Date'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'AUBEL'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Sales Order'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'AUDAT'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'SO Date'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Billing Document'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'FKDAT'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Billing date'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'MATNR'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Material Number'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'MAKTX'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Material Description'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'CHARG'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Batch'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VRKME'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Sales Unit'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'WAERK'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Invoice Currency'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BP'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'BASE PRICE IN INR'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'BED'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'BED IN INR'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'ECESS'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'ECESS IN INR'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'SHCESS'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'SHCESS'.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VAT'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'VAT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'KZWI3'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Insurance'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'KZWI4'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Freight'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'KZWI6'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Commission Amount'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'INCO1'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'INCO1'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'INCO2'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'INCO2'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
ENDFORM.
***************************************
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
WA_LAYOUT-ZEBRA = 'X'.
Standard MM reports
1.MMBE (STOCK OVER VIEW): - This report is used to display the company wise
plant wise, batch wise, storage location wise.
There are 4 types of stocks
1. Un restricted stock
2. Quality inspection stock
3. Blocked stock
4. Reserved stock
2. MC50 (DEAD STOCK): -This report is used to display the dead stock details in a
particular period.
3. ME5A (LIST OF PURCHASE REQUISION): - This report is used to display the
purchase requisition detailed information based on plant, material, user and date.
4. ME1P (PURCHASE ORDER PRICE HISTORY): - This report is used display the
vendor wise material price history & also used to evaluate the vendor ranking.
5. ME2L (PURCHASE ORDERS BY VENDOR):- This report is used to display the
purchase order details vendor wise in a particular period.
7. MB51 (MATERIAL DOC LIST): - This report is used to display te material document
details (GR/GI) based on the given date, movement type, plant, material, vendor. . .
8. MB52 (LIST OF WARE HOUSE STOCK): - This report is used to display the material
stock & their cost based on the given material plant, batch & storage location.
1. FK10N (VENDOR BALANCE DISPLAY): - This report is used to display the vendor
wise, period wise debits & credits in a particular year.
3. FS10 (GL BALANCE DISPLAY): - This report is used to display the GL account
wise, period wise debits & credits in a particular year.
4. FBL1N (VENDOR LINE ITEMS): - This report is used to display the vendor wise
open items cleared items as well as the item details in a particular period.
5. FBL3N (G/L ACCOUNT LINE ITEMS): - This report is used to display the GL
account wise open items cleared items as well as all the item details in a particular period.
AP AR GL
FK10N FD10N FS10N
FBL1N FBL5N FBL3N
This report is used to display the customer wise open items, cleared items, as well as all
the items in a particular period.
SD Standard Reports: -
1. VA15(INQUIRIES LIST): - This report is used to display the open inquiries, all the
inquiries in a particular date.
2. VA25 (QUOTATION LIST)
3. VA05 (LIST OF SALES ORDER)
4. VL04 (PROCESS DELIVERY DUE LIST)
5. VL06 (DELIVERY MONITOR)
6. VF05 (LIST OF BILLING DOCUMENTS)
Note: - Open sales means sales is completed, delivery is pending. Open delivery means
delivery is completed, billing is pending. Open billing means billing is completed
payment is pending.
PPC Reports: -
CS11 (DISPLAY BOM LEVEL BY LEVEL): - This report is used to display the BOM
components & their quantities base on the given material.
COID (LIST OF PROCESS ORDERS): - This report is used display the process orders
and plant orders based on the given material and plant - - -
Details TS
The report will have the following selection criteria: -
BSID
BUDAT
KUNNR Input fields
BUKRS
HKONT
+
KUNNR
BUKRS Link fields
HKONT
+
UMSKZ
DMBTR
BUKRS Output fields
KUNNR
HKONT
SHKZG
KNA1
KUNNR
KNB1
KUNNR
BUKRS
AKONT
SKAT
SAKNR
TXT50