Real Time Classes SP RAO
Real Time Classes SP RAO
Real Time Classes SP RAO
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 conditions in the where condition of the next level select query
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-ebeln.
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.
EX: -
Select vbeln posnr matnr kwmeng meins netwr from vbap into table it_vbap where vbeln in s_vbeln.
It_vbap1 = it_vbap.
Sort it_vbap1 by matnr.
Delete adjacent duplicates from it_vbap1 comparing matnr.
If it_vbap1 is not initial.
Select matnr maktx from makt into table it_makt where matnr = it_vbap1-matnr and spras = sy-langu.
Endif.
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 = _______ .
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.
10. We never write a select query with out where condition.
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.
Output:-
1000 TCS 241
1000 TCS 291
2000 IBM 116
Move-corresponding wa to wa1.
Wa1-bukrs = wa-bukrs.
Wa1-ort01 = wa-ort01.
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 through ‘SNOTE’ transaction. (We manually also apply the note & create the request
number & transported the request number from development server to quality & live server).
SAP NOTE contains which programs are changed & which lines are comment and which new lines or
code added in the program.
At the time of implementing the note manually then we need to open the program in change mode then it will
ask access key take this screen shot and send a mail to BASIS people then the BASIS people provide the
access key.
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).
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
K Vendor
D Customer
S G/L
T Open
A Cleared
******************************************************
* 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 *
******************************************************
READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBRP-AUBEL POSNR
= WA_VBRP-AUPOS.
IF SY-SUBRC = 0.
WA_FINAL-POSNR = WA_VBAP-POSNR.
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.
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.
WA_FCAT-SELTEXT_M = 'Sold to party'.
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.
WA_FCAT-FIELDNAME = 'POSNR'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Item Number'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
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 = 'FKIMG'.
WA_FCAT-COL_POS = w_cops.
WA_FCAT-SELTEXT_M = 'Billed Quantity'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
w_cops = w_cops + 1.
WA_FCAT-FIELDNAME = 'VRKME'.
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'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
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.
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.
***************************************
********** FORM DISPLAY *************
FORM DISPLAY.
DATA WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
WA_LAYOUT-ZEBRA = 'X'.
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.
6. ME2M (PURCHASE ORDER BY MATERIAL): - This report is used to display the purchase order details
based on the material in 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.
Standard FI Reports
1. FK10N (VENDOR BALANCE DISPLAY): - This report is used to display the vendor wise, period wise
debits & credits in a particular year.
2. FD10N (CUSTOMER BALANCE DISPLAY): - This report is used to display the customer 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
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.
Project 2
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
NAME1
NAME2
KNB1
KUNNR
BUKRS
AKONT
SKAT
SAKNR
TXT50
REPORT ZPORGRAM2.
**********************************************************
* PROGRAM : ZVR001-SPT_ACCOUNT RECEIVABLE AGING REPORT*
* AUTHOR : SATISH *
* PURPOSE : ACCOUNT RECEIVABLE AGING REPORT *
* START DATE : 19.03.2015 *
* FINISH DATE: 22.03.2015 *
* SUPPLIER : SPRAO TECHNOLOGIES *
* PACKAGE : *
* REQUEST NUM: SRYK900117 *
**********************************************************
* SELECTION-SCREEN
TABLES BSID.
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME.
PARAMETER PR_BUDAT TYPE BSID-BUDAT.
SELECT-OPTIONS: SO_BUKRS FOR BSID-BUKRS,
SO_KUNNR FOR BSID-KUNNR,
SO_HKONT FOR BSID-HKONT.
SELECTION-SCREEN END OF BLOCK A.
* LOGIC
SELECT BUKRS KUNNR UMSKZ BELNR BUDAT SHKZG DMBTR HKONT FROM BSID INTO
TABLE IT_BSID WHERE BUKRS IN SO_BUKRS AND KUNNR IN SO_KUNNR
AND HKONT IN SO_HKONT AND BUDAT <= PR_BUDAT.
*FILLING IT_FINAL1
LOOP AT IT_FINAL INTO WA_FINAL.
MOVE-CORRESPONDING WA_FINAL TO WA_FINAL1.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_FINAL-KUNNR.
IF SY-SUBRC = 0.
WA_FINAL1-NAME1 = WA_KNA1-NAME1.
WA_FINAL1-NAME2 = WA_KNA1-NAME2.
ENDIF.
READ TABLE IT_KNB1 INTO WA_KNB1 WITH KEY KUNNR = WA_FINAL-KUNNR BUKRS
= WA_FINAL-BUKRS.
IF SY-SUBRC = 0.
WA_FINAL1-AKONT = WA_KNB1-AKONT.
READ TABLE IT_SKAT1 INTO WA_SKAT1 WITH KEY WA_KNB1-AKONT.
IF SY-SUBRC = 0.
WA_FINAL1-RDES = WA_SKAT1-TXT50.
ENDIF.
ENDIF.
READ TABLE IT_SKAT INTO WA_SKAT WITH KEY SAKNR = WA_FINAL-HKONT.
IF SY-SUBRC = 0.
WA_FINAL1-TXT50 = WA_SKAT-TXT50.
ENDIF.
READ TABLE IT_BSID INTO WA_BSID WITH KEY KUNNR = WA_FINAL-KUNNR BUKRS
= WA_FINAL-BUKRS HKONT = WA_FINAL-HKONT.
IF SY-SUBRC = 0.
WA_FINAL1-UMSKZ = WA_BSID-UMSKZ.
ENDIF.
WA_FINAL1-TOTAL = WA_FINAL-NYD + WA_FINAL-AGE30 + WA_FINAL-AGE60 +
WA_FINAL-AGE90 + WA_FINAL-AGE120 + WA_FINAL-AGE180 + WA_FINAL-AGE365
+ WA_FINAL-AGE2Y + WA_FINAL-AGE3Y + WA_FINAL-AGE3YA.
APPEND WA_FINAL1 TO IT_FINAL1.
CLEAR WA_FINAL1.
ENDLOOP.
**************************************
*PERFORM STATEMENTS.
PERFORM FCAT.
PERFORM DISPLAY.
**********************
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'NAME1'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'NAME2'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'NAME2'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'BUKRS'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'COMPANY'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AKONT'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'RECON'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'RDES'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'RECON DESCRIPTION'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'HKONT'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'G/L ACCOUNT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'TXT50'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'G/L LONG DES'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'NYD'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'NOT YET DUE'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE30'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '0-30 DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE60'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '30-60 DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE90'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '60-90 DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE120'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '90-120 DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE180'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '120-180 DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE2Y'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '1-2 YEARS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE3Y'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '2-3 YEARS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'AGE3YA'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = '3 YEARS ABOVE'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CPOS = W_CPOS + 1.
WA_FCAT-FIELDNAME = 'TOTAL'.
WA_FCAT-COL_POS = W_CPOS.
WA_FCAT-SELTEXT_M = 'TOTAL'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
ENDFORM.
* DISPALY THE FIELD CATALOG.
FORM DISPLAY.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FCAT
I_SAVE = 'X'
TABLES
T_OUTTAB = IT_FINAL1.
ENDFORM.
Output fields
LIFNR, NAME1, NAME2, STREET1, STREET2, STREET3, BUKRS, AKONT, RECON
DESCRIPTION, G/L ACC, G/L ACC DES, NOT YET DUE, 0-30 DAYS, 30-60 DAYS, 60-90 DAYS,
90-120 DAYS, 120-180 DAYS, 180-365 DAYS, >1Y <2Y, >2Y, TOTAL
TYPE-POOLS SLIS.
DATA W_CPOS TYPE I.
DATA V_DAYS TYPE I.
TABLES BSIK.
* SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME.
PARAMETER: PR_BUKRS TYPE BSIK-BUKRS,
PR_BUDAT TYPE BSIK-BUDAT DEFAULT SY-DATUM.
SELECT-OPTIONS: SO_LIFNR FOR BSIK-LIFNR,
SO_HKONT FOR BSIK-HKONT.
SELECTION-SCREEN END OF BLOCK A.
SIMENS IBM US
W V GT Global internal table
PR P GS Global work area
SO S LT Local internal table
IT T LS Local work area
WA IS
C C
R R
Note: - Get parameter ID is used to get the current open document value. If you want to get the current
purchase document which is opened.
Data V1 type EKKO-EBELN.
Get parameter ID ‘BES’ field V1.
Write V1.
Note: - After receiving the FS (Functional Specification), if we don’t know any field name and their table
name then ask the function people where they get data or feed the data. Then the functional people open the
screen and show the values. Then we place cursor on the field. Click on F1. Click on technical information.
Identify the table name and field name. Some times instead of table structure is there then we identify the
data element. Based on the data element we get the table field.
Steps to get the table name based on the data element: -
Execute SE11. Select the radio button data type. Provide the data element name. Click on where used list.
Select the check box table fields. Enter. Then we get the all the table names, which are used this data
element. Click on find. Provide the related short description. Enter. Identify our table.
Steps to identify the data base table based on the transaction code: -
Execute SE93. Provide the transaction code. Click on display. Click on display object list. Expand the
package. Expand the dictionary objects. Expand the data base tables. Identify the tables.
If you want to identify the vendor tables then go to SE11. select the radio button data base table. Provide the
table L* & click o F4 button. Then we get the all vendor related tables. The same way as follows.
Vendor tables L*
Customer tables K*
Material tables M*
Company tables T*
Purchase tables E*
Steps to identify the call the link tables based on any table: -
Execute SE11. select the radio button data base table. Provide the table name (LFA1). Click on where used
list in the application tool bar (Ctrl + Shift + F3). Select only data base table check box. Enter. Then it
provides the all the related tables.
Steps to identify the tables based on idocs: -
Execute SE30. Provide related idoc name (CREMAS05). Click on display. In the each segment 3-6
characters are tables. Identify the all the tables.
EX
E I L F A 1 B
3 4 5 6
Table
Project 5: -
The report will have the following selection criteria
TABLES MSEG.
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: SO_MATNR FOR MSEG-MATNR OBLIGATORY,
SO_WERKS FOR MSEG-WERKS,
SO_LGORT FOR MSEG-LGORT,
SO_CHARG FOR MSEG-CHARG.
SELECTION-SCREEN END OF BLOCK A.
PARAMETER P_BS AS CHECKBOX.
RANGES R_BWART FOR MSEG-BWART.
R_BWART-LOW = '101'.
R_BWART-SIGN = 'I'.
R_BWART-OPTION = 'EQ'.
APPEND R_BWART.
R_BWART-LOW = '201'.
APPEND R_BWART.
R_BWART-LOW = '261'.
APPEND R_BWART.
SELECT MBLNR MJAHR BWART MATNR WERKS LGORT CHARG BWTAR MEINS KOSTL AUFNR
FROM MSEG INTO TABLE IT_MSEG WHERE MATNR IN SO_MATNR AND
WERKS IN SO_WERKS AND CHARG IN SO_CHARG AND LGORT IN SO_LGORT AND BWART
IN R_BWART.
SELECT MATNR WERKS LGORT CHARG CLABS CINSM CEINM CSPEM FROM MCHB INTO
TABLE IT_MCHB FOR ALL ENTRIES IN IT_MSEG WHERE MATNR =
IT_MSEG-MATNR AND WERKS = IT_MSEG-WERKS AND CHARG = IT_MSEG-CHARG AND
LGORT = IT_MSEG-LGORT.
SELECT MATNR MATKL FROM MARA INTO TABLE IT_MARA FOR ALL ENTRIES IN
IT_MSEG WHERE MATNR = IT_MSEG-MATNR.
SELECT WERKS NAME1 FROM T001W INTO TABLE IT_T001W FOR ALL ENTRIES IN
IT_MSEG WHERE WERKS = IT_MSEG-WERKS.
ENDIF.
* LAST GR DATE
IT_MSEG1 = IT_MSEG.
DELETE IT_MSEG1 WHERE BWART <> '101'.
DELETE IT_MSEG1 WHERE MATNR <> WA_MSEG-MATNR AND WERKS <> WA_MSEG-
WERKS AND LGORT <> WA_MSEG-LGORT AND CHARG <> WA_MSEG-CHARG.
SORT IT_MSEG1 BY MBLNR DESCENDING.
READ TABLE IT_MSEG1 INTO WA_MSEG1 INDEX 1.
IF SY-SUBRC = 0.
READ TABLE IT_MKPF INTO WA_MKPF WITH KEY MBLNR = WA_MSEG1-MBLNR
MJAHR = WA_MSEG1-MJAHR.
IF SY-SUBRC = 0.
WA_FINAL-LRDT = WA_MKPF-BUDAT.
ENDIF.
ENDIF.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'MATNR'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'MATERIAL'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'MAKTX'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'MATERIAL DES'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'WERKS'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'PLANT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'PLANT NAME'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'MEINS'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'UOM'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'CHARG'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'BATCH'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'MATKL'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'MAT GROUP'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'BWTAR'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'VALUATION TYPE'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'HSDAT'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'MFG DT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'VFDAT'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'EXP DT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'QNDAT'.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'LRDT'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'LAST RECEPIT DATE'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'MBLNR'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'MATERIAL DOC'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'LCDT'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'LOST CONS DT'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'PC'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'ORDER / CC'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'NOD'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'NO OF DAYS'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'CLABS'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'UN REST STOCK'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'CINSM'.
WA_FCAT-COL_POS = W_CLP.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'CSPEM'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'BLOCKED STOCK'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'CEINM'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'RESERVED STOCK'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
W_CLP = W_CLP + 1.
WA_FCAT-FIELDNAME = 'TSTOCK'.
WA_FCAT-COL_POS = W_CLP.
WA_FCAT-SELTEXT_M = 'TOTAL STOCK'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
Hi friends. This is satish. If you find any mistakes please send me mail to
satishkumarreddy.mn@gmail.com