Professional Documents
Culture Documents
ABAP Lab
ABAP Lab
ABAP Lab
ABAP Lab-Guide
SASIDHAR 9963855143
-2-
ABAP Lab-Guide
Example Tables: following tables are used in most of the database-table related examples.
Table: KNA1
Desc: Customer master
Field Name Field Description
1 KUNNR Customer number
2 NAME1 Customer name
3 LAND1 Country
4 ORT01 City
Table: VBAK
Desc: Sales order header
Field Name Field Description
1 VBELN Sales order number
2 ERDAT Order date
3 NETWR Net value
4 KUNNR Customer number
Table: VBAP
Desc: Sales order details
Field Name Field Description
1 POSNR Item number
2 ARKTX Item description
3 WERKS Plant code
4 VBELN Order number
Transaction codes:
following transaction codes(T.Code) are used to carry out various tasks:
SASIDHAR 9963855143
-3-
ABAP Lab-Guide
SASIDHAR 9963855143
-4-
ABAP Lab-Guide
Steps Action
1 SE37 (transaction code for Function-Builder)
2 On menu-bar , GoTo FunctionGroup CreateGroup
3 Function Group: ZmyGRP (give any name)
Short Description: my function group (enter any text)
4 click on continue(tick-mark)
5 LocalObject
6 Function Module: ZmyFUNC (give any name)
7 Create
8 Function Module: ZmyFUNC [see step-6]
Function Group: ZmyGRP [see step-3]
Short Description: my sample function (enter any text)
9 Save
** Import (TAB):
10 IMPORT(TAB)
Parameter names type associated type
X type i
Y type i
** Export (TAB):
11 EXPORT(TAB)
Parameter names type associated type
Z type i
** Source code (TAB):
12 SOURCE CODE(TAB)
…Enter the logic…
z = x + y.
13 Save , Check , Activate , Continue , Execute
14 Enter test data values for x , y
15 Execute
Steps Action
1 SE37 (transaction code for Function-Builder)
2 On menu-bar , GoTo FunctionGroup CreateGroup
3 Function Group: ZmyGRP (give any name)
Short Description: my function group (give any description)
4 click on continue (tick-mark)
5 LocalObject
6 Function Module: ZmyFUNC (give any name)
7 Create
8 Function Module: ZmyFUNC, [see step-6]
Function Group: ZmyGRP [see step-3]
Short Description: my sample function (enter any text)
9 Save
SASIDHAR 9963855143
-5-
ABAP Lab-Guide
** Import (TAB):
10 IMPORT(TAB)
Parameter names type associated type
X type i
Y type i
** Export (TAB):
11 EXPORT(TAB)
Parameter names type associated type
Z type i
** Exception (TAB):
12 EXCEPTION(TAB)
Exception short description
MyException1 divide by zero
** Source code (TAB):
13 SOURCE CODE(TAB)
if y = 0.
Raise MyException1.
Else.
Z = x / y.
Endif.
14 Save , Check , Activate , Continue , Execute
15 Enter test data for x , y
16 Execute
Steps Action
1 SE38 (transaction code for ABAP editor)
2 Program name: ZmyCallFunc (give any name)
3 Type: Executable Program
4 Save , LocalObject
5 Data: a type i, b type i, c type i.
(or)
Parameters: a type i, b type i.
Data: c type i.
a = 10. b = 5.
6 Place cursor where call-function code to be inserted.
Click on ‘Pattern’ to generate codes.
(select function name: ZmyFunc) [see ‘Function with exception’ step-6]
7 Continue
8 Exporting
X = a
Y = b
Importing
Z = c.
Write: / c.
9 Save , check, activate, Execute
SASIDHAR 9963855143
-6-
ABAP Lab-Guide
Steps Action
1 SE37 (transaction code for Function-Builder)
2 On menu-bar , GoTo FunctionGroup CreateGroup
3 Function Group: ZmyGrp (enter any name)
Short Description: my function group (enter any text)
4 click on (tick-mark)
5 LocalObject
6 Function module: ZmyFunc (give any name)
7 Create
8 Function Module: ZmyFunc [see step-6]
Function Group: ZmyGrp [see step-3]
Short Description: my sample function (enter any text)
9 Save
** Import (TAB):
10 IMPORT(TAB)
Parameter names type associated type
custno type KNA1-kunnr
** Tables (TAB):
11 TABLES(TAB)
Parameter names type associated type
ITAB like KNA1
** Source code (TAB):
12 SOURCE CODE(TAB)
…Enter the logic…
select * from KNA1 into table ITAB
where kunnr = custno.
13 Save , check, activate, continue, Execute
14 Enter test data values for custno [see step-10]
15 Execute
Steps Action
1 SE38 (transaction code for ABAP editor)
2 Program name: ZmyCallFunc
3 Type: Executable Program
4 Save, enter the following source codes
5 Tables: KNA1.
Data: cno type KNA1-kunnr.
Data: intab type KNA1 occurs 1 with header line.
cno = ‘1000’.
6 Click on ‘Pattern’ to generate function code at cursor position (select Function Name:
ZmyFunc) [see ‘Function with tables’ step-6]
7 Click on Continue (tick mark)
8 Exporting
custno = cno.
Tables
SASIDHAR 9963855143
-7-
ABAP Lab-Guide
ITAB = intab.
Loop at intab.
Write: / intab-kunnr.
Endloop.
9 Save , check, activate, Execute
DOCUMENT (SCRIPT/FORM)
a) sales order
b) invoice
c) bill
d) purchase order
e) debit memo
f) credit memo
etc.
PRINT
PROGRAM
Database
SASIDHAR 9963855143
-8-
ABAP Lab-Guide
(Note: in general enterprise business more than 200+ business documents are used.)
SAP has identified most commonly used business documents and provided standard layouts and print
programs for them in the system.
ABAPer’s tasks:
to develop new layout and print program.
to modify existing layout.
Create Windows:
LOGO
HEADER
ADDRESS
MAIN (default )
FOOTER
Steps Action
1 SE71 (transaction code for Form-Painter)
2 Form: ZmySapScriptFORM (enter any name)
3 Create, Continue (tick mark) in pop up box
4 Description: my form (enter any text)
Translate: (Select radio-button) ‘Do not Translate’
5 Save, LocalObject
6 Click ‘Pages’ button (F6)
7 Page: Mypage (give any name)
8 Save
9 Next page: Mypage [see step-7]
Description: my page (enter any text)
** Pages: Create Windows:
10 Click on ‘Windows’ button (F7)
11 MAIN is default window
12 on menu-bar, EDIT CreateElement (or) (Shift+F6)
13 (Pop-up box to create LOGO window)
Window: LOGO
Description: logo window (enter any text)
Click on Continue(tick mark)
SASIDHAR 9963855143
-9-
ABAP Lab-Guide
SASIDHAR 9963855143
-10-
ABAP Lab-Guide
NOTE: in the ‘Name’ box, click icon at the right corner. Click on ‘Execute’(F8) to list out the
bitmap image names. Select any image. e.g. ‘ENJOY’. Click on ‘Copy’ (tick mark)
Continue(tick-mark)
53 Back(F3)
54 Dbl.click on ‘HEADER’ in the windows list box (or) select & rt-click choose (or) F2
55 Click on ‘Text Elements’ icon on top tool-bar (or F9)
56 (NOTE: write any text to appear in the header line e.g.)
SASIDHAR 9963855143
-11-
ABAP Lab-Guide
Create Windows:
LOGO
MAIN (created by default)
HEADER
FOOTER
Steps Action
1 SMARTFORMS (transaction code)
** Create Style:
2 Select radio-button, Style: ZmySmartSTYLE (enter any name)
3 Create
[ Screen divided into Left and Right panels ]
** Define Paragraph-Format:
4 On left-panel, Rt.-Click ParagraphFormat CreateNode
5 In the pop-up box, ParagraphFormat: P1 (enter any name e.g P1)
6 Enter (tick mark)
7 Description: my paragraph format (enter any text)
8 Font (TAB) : define font characteristics for ‘Paragraph format’
Font family:
Font size: 11
Font style: Bold
Color:
Underline:
** Define Character-Format:
9 On left-panel, Rt.-Click CharacterFormat CreateNode
10 In the pop-up box, CharacterFormat: C1 (enter any name e.g C1)
11 Enter (tick mark)
12 Description: my character format (enter any text)
13 Font(TAB) : define font characteristics for ‘Character format’
Font family:
Font size: 12
Font style: Italic
Color:
Underline:
14 Save , LocalObject
15 Back (F3)
** Create Form:
16 Select radio-button, Form: ZmySmartFORM (enter any name)
17 Create
** Define Global Data:
SASIDHAR 9963855143
-12-
ABAP Lab-Guide
18 On left-panel, dbl.-click ‘Global Definitions’ (or) select & press ‘ENTER’ key
19 GlobalData (TAB)
Variable name type assignment associated type (‘reference type’ in 4.6)
Intab like standard table of KNA1
Outtab type KNA1
** Create Windows & define Contents:
** Create window: LOGO:
20 On left-panel, Rt.-Click ‘%PAGE1 New page’
21 Create Window
22 Window: LOGO
Description: logo window (enter any text or leave it blank)
(press ‘ENTER’ key)
23 On left-panel, Rt.-Click ‘LOGO’
24 Create Graphic
25 Name: ENJOY (click inside the textBox and select a Graphic image, e.g. ENJOY)
Object:
Id:
NOTE: in the ‘Name’ box, click icon at the right corner. Select ‘color’ or ‘black & white’ bitmap
image from the pop-up panel. Click on ‘Execute’(F8) to list out the bitmap image names. Select
any image. e.g. ‘ENJOY’. Click on ‘Copy’ (tick mark)
Resolution: 100 (give any resolution, preferably 100DPI, dots per inch)
** Create window: HEADER:
26 On left-panel, Rt.-Click ‘%PAGE1 New page’
27 Create Window
28 Window: HEADER
Desccription: header window (enter any text or leave it blank)
(Press ‘ENTER’ key)
29 On left-panel, Rt.-Click ‘HEADER’
30 Create Text
(enter any text at the blinking cursor position, e.g. MY software technologies inc. USA)
** Create window: FOOTER:
31 On left-panel, Rt.-Click ‘%PAGE1 New page’
32 Create Window
33 Window: FOOTER
Description: footer window (enter any text or leave it blank)
(Press ‘ENTER’ key)
34 On left-panel, Rt.-Click ‘FOOTER’
35 Create Text
(enter any text at the blinking cursor position, e.g. YOUR future begins here)
** Define Window size, location:
36 Click ‘FORM-PAINTER’ (F9) to show/hide the window design screen.
37 On lt-panel , Dbl-click on the window names (e.g. LOGO, HEADER etc.)
Drag them onto the ‘Designer Canvas’ on rt-panel.
Resize and relocate the windows as you like
Note: it requires some practice
** Define Program Lines:
38 On left-panel, Rt.-Click ‘MAIN window’
(Note: this window is created by default)
39 Create FlowLogic ProgramLines (Create ProgramLines in 4.6)
(Note: if the ‘Designer Canvas’ is still visible, hide it by clicking on ‘Form Painter’)
40 GeneralAttributes (TAB)
Input parameter Output parameters
Intab Outtab
SASIDHAR 9963855143
-13-
ABAP Lab-Guide
41 (write the following statement in right-bottom panel TextArea.) [NOT available in 4.6]
Select * from KNA1 into corresponding fields of table Intab.
42 Save , ‘LocalObject’
** Define LOOP:
43 On left-panel, Rt.-Click ‘%CODE1 New Program Lines1’
44 Create FlowLogic LOOP (Create LOOP in 4.6)
45 Data (TAB)
‘Operand’[‘internal table’ in 4.6]: checkbox (Tick-mark)
‘Intab’ INTO ‘Outtab’ (enter internal-table names on either side of the word ‘INTO’)
46 On left-panel, Rt.-Click ‘%LOOP1 New Loop 1’
47 Create Text
48 (Note: click ‘Insert Field’ icon with ‘+’ sign on the right-panel.
enter the following lines in the pop-up window and click ‘Continue’ (tick-mark).
To delete any selected field: highlight the field and click on ‘Delete Field’ icon with ‘-’ sign)
&outtab-kunnr&
&outtab-land1&
&outtab-name1&
&outtab-ort01&
49 Save, Check, Activate, Test (F8)
50 Function module: is generated (e.g. /1BCDWB/SF00000024)
51 SingleTest (F8) , Execute (F8)
52 Output Device: LP01
53 Click on ‘Print Preview’ (F8) [to view the generated Form]
FORM: - copy & modify (STANDARD LAYOUT) [layout and print Program defined by SAP]
Steps Action
** view exising STANDARD Form-name:
1 NACE (transaction code to view Standard Layouts/applications)
2 Select any Application from the list e.g V1 (sales)
3 Click on ‘Output Types’ (F5)
4 On right panel, select BA00 (order confirmation)
5 On left panel, dbl. click on ‘Processing Routines’
6 Just remember the Form to modify (e.g. RVORDER01) from the right-side list
7 Go back to initial screen by pressing ‘Back’(F3) several times (normally 3 times)
** Copy the Form:
8 SE71 (transaction code for Form-Painter)
9 On menu-bar, UTILITIES COPY FROM CLIENT
10 Form Name: RVORDER01 [see step-6]
Target Form: ZRVORDER01 (give any name)
Source Client: 800 (client code during login)
11 Execute(F8) , LocalObject , Back(F3) , Back(F3)
** Modify the layout:
12 Form: ZRVORDER01 [see step-10] target form name
13 Change
14 Click on ‘Page Windows’ (F8)
15 Dbl.click on ‘HEADER’ (or select any window to modify) [in the top ‘Page Window’ panel]
16 Click on ‘Text Elements’ icon on tool-bar (or F9)
17 Change the text (as per requirement)
18 Back (F3) to move to the ‘Page Window’ List
SASIDHAR 9963855143
-14-
ABAP Lab-Guide
Steps Action
1 SE38 (transaction code for ABAP editor)
2 Program name: ZmyPRG1 (give any name)
3 Create
4 Title: MY Form program (give any text)
Type: Executable Program
5 Save, ‘Local object’
** add following Sourse Codes:
6 REPORT ZMYPRG1.
Tables: KNA1.
Select-options: cno for KNA1-kunnr.
*-------------------------------
** insert function: OPEN_FORM:
7 Click ‘Pattern’ (or) Ctrl+F6 , Call function: OPEN_FORM , continue (tick mark)
8 (Un-comment the following 3 lines)
EXPORTING
Form = ‘ZmySapScriptFORM‘ [see ‘SAP script’ step-2]
Language = SY-LANGU
** SQL query:
9 (insert the following codes and place cursor after the last comment line)
SASIDHAR 9963855143
-15-
ABAP Lab-Guide
*----------------------------------
Select * from KNA1 where kunnr in cno. [see step-4] (Note: not available in 4.6)
*---------------------------------
** insert function: START_FORM:
10 Ctrl+F6, Call function: START_FORM , continue (tick mark)
11 (Un-comment the following 5 lines)
EXPORTING
Form = ‘ZmySapScriptFORM’ [see ‘SAP script’ step-2]
Language = SY-LANGU
Start page = ‘Mypage’ [see ‘SAP script’ step-7]
Program = ‘ZmyPRG1’ [see step-2]
12 (place cursor at the last line of program codes and add the following demarcation line)
*----------------------------------------
** insert function: WRITE_FORM:
13 Ctrl+F6, Call function: WRITE_FORM , continue (tick mark)
14 (Un-comment the following 2 lines)
EXPORTING
Window = ‘ADDRESS’ [see ‘SAP script’ step-17]
15 (place cursor at the last line of program codes and add the following demarcation line)
*----------------------------------------
** insert function: WRITE_FORM:
16 Ctrl+F6 , Call function: WRITE_FORM , continue (tick mark)
17 (Un-comment the following 2 lines)
EXPORTING
Window = ‘MAIN’ [see ‘SAP script’ step-9]
18 (place cursor at the last line of program codes and add the following demarcation line)
*----------------------------------------
** insert function: END_FORM:
19 Ctrl+F6 , Call function: END_FORM , continue (tick mark)
20 (place cursor at the last line of program codes and add the following demarcation line)
*----------------------------------------
** END SELECT:
21 (place cursor at the last line and add the following codes..)
ENDSELECT.
*---------------------------------------
** insert function: CLOSE_FORM:
22 Ctrl+F6 , Call function: CLOSE_FORM , continue (tick mark)
23 Save
** Execute & Preview the Form:
24 Check , Activate , Execute (‘Direct processing’) F8
25 Cno: 1000 to 2000 (customer number: enter any range)
26 Execute (F8)
27 Output Device: LP01
28 Click on ‘Print preview’ [to display the Form output]
SASIDHAR 9963855143
-16-
ABAP Lab-Guide
Definition: Logical Databases (LDBs) are special ABAP programs that retrieve data and make it available
to application programs.
A) the most common use of LDBs is to read data from different database tables by linking them to
executable ABAP programs.
PRG 1
PRG 3
instead of programs interacts directly with databases, they interacts with logical databases.
b) in sap, ldbs are extensively used in HR-modules. (info-type) (hr-abap).
c) ldbs contain open sql statements that read data from the databases, so we there fore use sql statements in
or programs.
d) the ldb reads the program, stores in the program if necessary, and then passes them line by line to the
application program.
e) the data structure in a logical database is hierarchial.
f) many tables in the r/3 system are linked to each other using foreign key relation ships.
g) some of these dependencies form tree-like hierarchical structures.
h) logical databases read from database tables that are part of them structures.
1* structure:
the structure defines the data view of the logical database.
2* selections:
the selections dfine a selection screen, which forms the user interface of the executable programs that
use the logical databases. it’s layout usually determined by a structure.
3* database program:
the data base program contains the abap statements used to read the data and pass it to the user of the
logical database.
we need to define only structure, the rest of two (selections & database program) are auto-generated by the
system.
SASIDHAR 9963855143
-17-
ABAP Lab-Guide
Nodes:
KNA1
|--------- VBAK
|---------- VBAP
Steps Action
1 SE36 (transaction for LDB creation)
2 Logical database: ZmyLDB (give any name)
3 Create
4 (in the pop-up box)
Short text: (give any text)
5 Click on ‘Create’ icon, ‘Local object’
** define parent node KNA1:
6 (in the pop-up box)
Name of Root Node: KNA1
Text: customer master table (give any text)
Select radio-button, ‘Database Table’ : KNA1
Click on ‘Create’ icon
** create child node VBAK:
7 Structure(TAB)
Under ‘Node Name’,
Right-click KNA1 InsertNodes
8 (in the pop-up box)
Node name: VBAK (2nd level node name)
Text: sales order table (enter any text)
Hierarchically under: KNA1 (parent node, by default)
Select radio-button, ‘Database table:’ VBAK
9 Click on ‘Insert new node’ (or F5)
** create child node VBAP:
10 Structure(TAB)
Under ‘Node Name’,
Right-click on VBAK InsertNodes
11 (in the pop-up box)
Node name: VBAP (3rd level node name)
Text: item order information
Hierarchically under: VBAK (parent node, by default)
Select radio-button, ‘Database table:’ VBAP
12 Click on ‘Insert new node’ (or F5)
13 Save
** generate ‘Selection Screen’ Source codes:
14 Click on ‘Selections’
15 Click on ‘Yes’ in the pop-up box
16 Click on ‘No’ in the pop-up box
17 We can see 2 types of selections in top and bottom panels
1. free selections (in Top panel)
2. field selections (in Bottom panel)
18 Select fields from ‘Free selections’ panel. (e.g. KNA1, VBAK, VBAP) check-box
19 Click on ‘Transfer’ (tick-mark)
** un-comment generated Source codes:
SASIDHAR 9963855143
-18-
ABAP Lab-Guide
27 (NOTE: uncomment the following 3 lines only and put ‘.’ After cno)
Select * from kna1
Where kunnr in cno.
Endselect.
28 Save , Check , Activate , Continue (tick mark) , Back(F3)
** VBAK (SELECT statement):
29 Again double-click on ‘Include xxxxxxx VBAK’
30 (NOTE: uncomment the following 3 lines only and put ‘.’ After ono)
Select * from vbak
Where vbeln in ono.
Endselect.
31 Save , Check , Activate , Continue (tick mark) , Back(F3)
** VBAP (SELECT statement):
32 Again double-click on ‘Include xxxxxxx VBAP’
33 (NOTE: uncomment the following 3 lines only and put ‘.’ After vbak-vbeln)
Select * from vbap
Where vbeln = vbak-vbeln.
Endselect.
34 Save , Check , Activate , Continue (tick mark) , Back (F3)
** save, check , activate the Nodes:
35 Save , Activate , Continue (tick mark) , Back (F3)
36 Save , Activate , Continue (tick mark) , Back(F3) , Back(F3)
Note: don’t click ‘Save’ again in the Node-Tree(KNA1, VBAK, VBAP) screen
** test newly created LDB and view data:
37 Select ‘Logical Database:’ ZmyLDB [see step-2] (displayed by default)
38 Click on ‘Test’ icon (F8) on tool-bar
39 cno: 1000 to 1001 (customer number, Enter values)
ono: ---- to ---- (order number, leave it blank)
40 Click on Execute (F8) on tool-bar
Note: it may take few minutes to display the LDB content
REPORTS:
Popular methods to generate report are:
a) using reporting TOOL
b) using LDB
c) using SELECT statement
Steps Action
SASIDHAR 9963855143
-19-
ABAP Lab-Guide
1 SE38
2 Program name: ZmyLDBPrg (give any name)
3 Create
4 Title: my LDB program (enter any text)
Type: Executable Program
Logical Database: ZmyLDB (which is already created) [see ‘create LDB’ step-2]
5 Save , ‘Local object’ , [write the following source codes..]
6
REPORT ZMYLDBPRG.
Get KNA1.
Get VBAK.
Get VBAP.
SASIDHAR 9963855143
-20-
ABAP Lab-Guide
SAP queries
ZGSRUSRGRP1 1
5
QUERY 3 USER 1
4 USER 2
USER 3
USER 4
USER 5
USER 6
INFOSET USER 7
USER 8
USER 9
LOGICAL
DATABASE
DATABASE
REPORT: - SAP-QUERIES [report generation Tool] generates report without any ABAP coding.
using LDB
Steps Action
1 SQ03 (transaction code) – create a usergroup
2 SQ02 (transaction code) – create a infoset
3 SQ03 (transaction code) – assign user and infoset to usergroup
4 SQ02 (transaction code) – assign usergroup to infoset
5 SQ01 (transaction code) – design the query layout , test/execute query
Steps Action
** create USERGROUP:
1 SQ03 (transaction code to create a usergroup)
2 User group: ZmyGrp (give any name)
SASIDHAR 9963855143
-21-
ABAP Lab-Guide
3 Click ‘Create’
4 Short description: my group (enter any text)
5 Save , ‘Local object’ , Back
** create INFOSET:
6 SQ02 (transaction code to create a infoset)
7 Infoset: ZmyInfoset (give any name)
8 Create
9 Name: santanu’s infoset (give any text)
Authorization group: ZmyGrp [see step-2]
Select radio-button, ‘Logical Database’ : ZmyLDB
[see user defined table in LDB step-2]
10 Click on continue (tick mark)
11 New screen appears with TWO panels – Left and Right
** add Fields to FieldGroup: **
12 Select NODE ‘Customer Master Table’ from Right panel
13 In the Left panel , click on right-arrow icon beside ‘Customer Master Table KNA1’
14 right-click on field-name ‘Add field to field group’
(e.g. customerNumber KNA1-kunnr). And Follow the same procedure for other fields (KNA1-
name1, KNA1-land1, KNA1-ort01)
SASIDHAR 9963855143
-22-
ABAP Lab-Guide
SASIDHAR 9963855143
-23-
ABAP Lab-Guide
REPORT: ALV [ABAP List Viewer] Report generation through ABAP program (using SELECT).
using a single table KNA1 with 4 columns .
Steps Action
1 SE38
2 Program name: ZmyALV (enter any name)
3 Create
4 Title: my report (enter any text)
Type: Executable Program
5 Save , ‘Local object’ , [enter the following source code]
6 REPORT ZMYALV.
SASIDHAR 9963855143
-24-
ABAP Lab-Guide
APPEND W_FCAT TO T_FCAT. “append data from work area to internal table
*------
W_FCAT-COL_POS = 4. “4th column
W_FCAT-FIELDNAME = 'LAND1'. “field name
W_FCAT-SELTEXT_M = 'COUNTRY'. “column/field heading
APPEND W_FCAT TO T_FCAT. “append data from work area to internal table
REPORT: Hierarchial Sequential Report (using SELECT) [using 2 tables VBAK, VBAP]
Steps Action
1 SE38
2 Program name: ZmyHierALV (enter any name)
3 Create
4 Title: my report (enter any text)
SASIDHAR 9963855143
-25-
ABAP Lab-Guide
TYPE-POOLS: SLIS.
**--- constants
CONSTANTS: C_VBAK TYPE SLIS_TABNAME VALUE 'W_VBAK',
C_VBAP TYPE SLIS_TABNAME VALUE 'W_VBAP'.
SASIDHAR 9963855143
-26-
ABAP Lab-Guide
**---- VBAP
W_FCAT-COL_POS = 1. “1st column
W_FCAT-FIELDNAME = 'POSNR'. “field name
W_FCAT-SELTEXT_M = 'ITEM NO'. “column/field heading
W_FCAT-TABNAME = C_VBAP. “assign constant value
APPEND W_FCAT TO T_FCAT. “append work area value to internal table
*---------
W_FCAT-COL_POS = 2. “2nd column
W_FCAT-FIELDNAME = 'ARKTX'. “field name
W_FCAT-SELTEXT_M = 'ITEM DESC'. “column/field heading
W_FCAT-TABNAME = C_VBAP. “assign constant value
APPEND W_FCAT TO T_FCAT. “append work area value to internal table
*---------
W_FCAT-COL_POS = 3. “3rd column
W_FCAT-FIELDNAME = 'WERKS'. “field name
W_FCAT-SELTEXT_M = 'PLANT CODE'. “column/field heading
W_FCAT-TABNAME = C_VBAP. “assign constant value
APPEND W_FCAT TO T_FCAT. “append work area value to internal table
*---------
W_KEYINFO-HEADER01 = 'VBELN'.
W_KEYINFO-ITEM01 = 'VBELN'.
SASIDHAR 9963855143
-27-
ABAP Lab-Guide
IS_KEYINFO = W_KEYINFO
TABLES
T_OUTTAB_HEADER = T_VBAK
T_OUTTAB_ITEM = T_VBAP
10 Save , Check , Activate , Continue (tick mark)
11 Execute
12 Report is successfully generated.
(we can customize the report by selecting various icons on the tool-bar)
Steps Action
1 SE38
2 Program name: ZmyInterReport (give any name)
3 Create
4 Short Desc: (write any text)
Type: Executable Program
5 Save , LocalObject , [enter the following source codes]
6 REPORT ZMYINTERREPORT.
*-- EVENT
At line-selection.
Case SY-LSIND.
When ‘1’
Write: / ‘this is the second screen’ , SY-LSIND.
When ‘2’
Write: / ‘this is the third screen’ , SY-LSIND.
When others.
Write: / SY-LSIND.
Endcase.
7 Save , check , activate , continue
8 Execute
9 Double-click on the screen headings to move to the next level of screens
(upto 21 screens)
REPORT: Complex Interactive Report (using SELECT) [with hot-spot] with 3 tables KNA1, VBAK,
VBAP. [using selection screen for parameter input]
Steps Action
1 SE38
2 Program name: ZmyInterReportComplex1 (give any name)
3 Create
4 Title: my report (write any text)
Type: Executable Program
5 Save , LocalObject , [enter the following source codes]
SASIDHAR 9963855143
-28-
ABAP Lab-Guide
6 REPORT ZMYINTERREPORTCOMPLEX1.
ULINE.
*--- column headings of table KNA1
Write: /5 ‘custno’,
20 ‘custname’,
40 ‘country’.
Hide KNA1-kunnr.
Endselect.
Case SY-LSIND.
When ‘1’. “1st level screen
Write: /30 ‘Sales order information list’.
ULINE.
*--- column headings of table VBAK
Write: /5 ‘order no’,
20 ‘order date’,
60 ‘order value’.
ULINE.
Hide VBAK-vbeln.
Endselect.
Endcase.
Case SY-LSIND.
When ‘2’. “2nd level screen
SASIDHAR 9963855143
-29-
ABAP Lab-Guide
REPORT: Complex Report with Reporting-Events (using SELECT) [2 tables KNA1, VBAK using
inner join]
Steps Action
1 SE38
2 Program name: ZmyComplexReport (give any name)
3 Create
4 Title: my report (write any text)
Type: Executable Program
5 Save , ‘Local object’ , [enter the following source codes]
6 REPORT ZMYCOMPLEXREPORT.
SASIDHAR 9963855143
-30-
ABAP Lab-Guide
ULINE. "underline
*--- event
start-of-selection.
at end of kunnr.
SASIDHAR 9963855143
-31-
ABAP Lab-Guide
sum.
write:/ 'sub total of order value' , 100 wtab-netwr.
endat.
endloop.
**---Event
end-of-page.
ULINE.
7 Save , check , activate , continue
8 Execute
9 Enter: Cno: 1000 to 1002
Cnt: DE (country code for Germany)
click ‘Execute’ F8
10 Report is generated with control breaks and sub-totals
Steps Action
1 SE11
2 Select radio-button, ‘Type Group:’ Zmy1 (give any name)
3 Create
4 Short text:
5 Save
6 types: zmy1_name(10) type c,
zmy1_numc type i.
w_itab-a = 10.
w_itab-b = 20.
c = w_itab-a + w_itab-b.
write: / c.
14 Save , check , activate , continue(tick mark)
SASIDHAR 9963855143
-32-
ABAP Lab-Guide
15 Execute
ABAP DICTIONARY: create User Defined TABLE [ ZmyEMPt , ZmyDEPT ] see step-13,24
Steps Action
1 SE11
2 Select radio-button, ‘Data type:’ YmyTP , ‘Create’ (create data element to link 2 tables)
3 Select radio-button, ‘Data element’ , click on ‘Continue’ (tick-mark) in pop-up box
** DataType(TAB):
4 Short description: (enter any text)
DataType(TAB)
Select radio-button, ‘Built-in-type’
Data type: NUMC
Length: 10
** Field label(TAB):
6 Field label(TAB)
SASIDHAR 9963855143
-33-
ABAP Lab-Guide
SCREEN: Simple Screen Program: (Executable Program) with inputBox, checkboxes, commandButton
SASIDHAR 9963855143
-34-
ABAP Lab-Guide
Steps Action
1 SE38
2 Program: ZMYSCREEN (enter any name)
3 Create
4 Title: my screen program (enter any text)
5 Type: Executable Program
6 Save , LocalObject , continue
7 Enter the line call screen 100. after REPORT ZMYSCREEN
8 REPORT ZMYSCREEN.
SASIDHAR 9963855143
-35-
ABAP Lab-Guide
CASE SY-UCOMM.
WHEN 'EX'.
LEAVE PROGRAM.
WHEN 'EX1'.
IF CB1 = 'X'.
IO1 = 'SAP'.
ELSE.
IO1 = ' ' .
ENDIF.
WHEN 'EX2'.
IF CB2 = 'X'.
IO1 = 'ABAP'.
ELSE.
IO1 = ' ' .
ENDIF.
ENDCASE.
SCREEN: Simple Screen Program: (Module Pool) with inputBox, checkboxes, commandButton
Steps Action
1 SE38
2 Program: ZMYSCREEN1 (enter any name)
3 Create
4 Title: (enter any text)
5 Type: Module Pool
6 Save, LocalObject, continue
7 Enter the line call screen 100. after PROGRAM ZMYSCREEN1.
8 PROGRAM ZMYSCREEN1.
SASIDHAR 9963855143
-36-
ABAP Lab-Guide
CASE SY-UCOMM.
WHEN 'EX'.
LEAVE PROGRAM.
WHEN 'EX1'.
IF CB1 = 'X'.
IO1 = 'SAP'.
ELSE.
IO1 = ' ' .
SASIDHAR 9963855143
-37-
ABAP Lab-Guide
ENDIF.
WHEN 'EX2'.
IF CB2 = 'X'.
IO1 = 'ABAP'.
ELSE.
IO1 = ' ' .
ENDIF.
ENDCASE.
Steps Action
1 SE93
Transaction code: ZmyTrans1 (first letter must be Z or Y)
Create
Short text: (enter any text)
Select radio-button ‘Program and Screen (dialog transaction)’
Click ‘continue’ (enter)
Program: ZMYSCREEN1 (the module pool program name)
Screen number: 100 (same as module pool screen number)
Save, package: $TMP , localObject
Transaction code ZmyTrans1 is created
Enter ZmyTrans1 to execute the module pool program ‘ZMYSCREEN1’
Steps Action
1 REPORT ZSANSCREENPRG3 .
*REPORT demo_dynpro_tabcont_loop.
SASIDHAR 9963855143
-38-
ABAP Lab-Guide
*&---------------------------------------------------------------------*
*& Module exit INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE exit INPUT.
case sy-ucomm.
when 'EX'.
leave program.
endcase.
ENDMODULE. " exit INPUT
ENDLOOP.
module exit.
** Layout:ctrl+F7
3 Table control
Name: FLIGHTS
Table-name: DEMO_CONN
Fileds:
CARRID
CONNID
CITYFROM
CITYTO
SASIDHAR 9963855143
-39-
ABAP Lab-Guide
Steps Action
1 SE38
2 Program: zdemo_dynpro_tabstrip_local (enter any name)
3 Create
4 Title: (enter any text)
5 Type: Executable Program
6 Save
7
REPORT ZDEMO_DYNPRO_TABSTRIP_LOCAL.
mytabstrip-activetab = 'PUSH1'.
MODULE calculation.
CASE SY-UCOMM.
WHEN 'RADIO'.
IF ADD = 'X'.
ANS = NUM1 + NUM2.
SASIDHAR 9963855143
-40-
ABAP Lab-Guide
mytabstrip-activetab = 'PUSH3'.
ENDIF.
ENDCASE.
ENDMODULE.
tabstrip control:
name: MYTABSTRIP
tab title: 3
(tab1)push-button:
name: PUSH1
text: Tab_page_1
fctCode: PUSH1
(tab2)push-button:
name: PUSH2
text: Tab_page_2
fctCode: PUSH2
(tab3)push-button:
name: PUSH3
text: Tab_page_3
fctCode: PUSH3
SASIDHAR 9963855143
-41-
ABAP Lab-Guide
subscreen area(1):
name: SUB1
subscreen area(2):
name: SUB2
subscreen area(3):
name: SUB3
push-button:
name: BUTTON
text: Cont.
icon: ICON_OKAY
fctCode: OK
Text-field:
Name: TEXT1
Text: Subscreen 1
Text-field:
Name: LABEL1
Text: Number1:
Text-field:
Name: LABEL2
Text: Number2:
i/o-field:
Name: NUM1
i/o-field:
Name: NUM2
SASIDHAR 9963855143
-42-
ABAP Lab-Guide
Text-field:
Name: TEXT2
Text: Subscreen 2
Radio-button:
name: ADD
text: Addition
fctCode: RADIO
Radio-button:
name: SUB
text: Subtraction
fctCode: RADIO
Radio-button:
name: MUL
text: Multiplication
fctCode: RADIO
Radio-button:
name: DIV
text: Division
fctCode: RADIO
module calculation.
25 Save, activate
Text-field:
Name: TEXT3
SASIDHAR 9963855143
-43-
ABAP Lab-Guide
Text: Subscreen 3
Text-field:
Name: RESULT
Text: Result
i/o-field:
Name: ANS
remove Tick-mark from ‘input field’ to make it read only
SCREEN: Screen Program – data insert, update, delete in user defined table (using Table Control)
Steps Action
1 create an user-defined table ‘ZAJDEPT’
TABLES: ZAJDEPT.
SASIDHAR 9963855143
-44-
ABAP Lab-Guide
*---[MODULE] STATUS_010
MODULE STATUS_0100 OUTPUT.
SELECT * FROM ZAJDEPT INTO CORRESPONDING FIELDS OF TABLE itab.
CASE SY-UCOMM.
*--- EXIT
WHEN 'EXIT'.
LEAVE PROGRAM.
*--- INSERT
WHEN 'INSERT'.
ZAJDEPT-DNO = IO_DNO.
ZAJDEPT-DNAME = IO_DNAME.
INSERT ZAJDEPT.
IF SY-SUBRC <> 0.
IO_STATUS = 'SORRY! ENTRY ALREADY EXISTS'.
ELSE.
IO_STATUS = 'INSERTED DATA SUCCESSFULLY'.
ENDIF.
*--- UPDATE
WHEN 'UPDATE'.
ZAJDEPT-DN0 = IO_DNO.
ZAJDEPT-DNAME = IO_DNAME.
UPDATE ZAJDEPT.
IF SY-SUBRC <> 0.
IO_STATUS = 'SORRY! RECORD DOES NOT EXIST'.
SASIDHAR 9963855143
-45-
ABAP Lab-Guide
ELSE.
IO_STATUS = 'UPDATED DATA SUCCESSFULLY'.
ENDIF.
*--- DELETE
WHEN 'DELETE'.
ZAJDEPT-DN0 = IO_DNO.
DELETE ZAJDEPT.
IF SY-SUBRC <> 0.
IO_STATUS = 'SORRY! RECORD DOES NOT EXIST'.
ELSE.
IO_STATUS = 'DELETED RECORD SUCCESSFULLY'.
ENDIF.
ENDCASE.
MODULE STATUS_0100.
*--- PAI
PROCESS AFTER INPUT.
ENDLOOP.
MODULE button_action.
** Layout:
11
text-field:
name: LABEL_HEADING
text: DATA_management_in_table_ZAJDEPT-_by_Santanu
Box:
name: BOX_DATA_ENTRY
text: data_entry
Note: place the following 4 fields inside the rectangular BOX area BOX_DATA_ENTRY
text-field:
SASIDHAR 9963855143
-46-
ABAP Lab-Guide
name: LABEL_DNO
text: Department_no:
i/o-field:
name: IO_DNO
format: NUMC
text-field:
name: LABEL_DNAME
text: Department_name:
i/o-field:
name: IO_DNAME
format: CHAR
i/o-field:
name: IO_STATUS
input field: <remove tick mark> to use it as read only field
table-control:
name: MY_TBL_CTRL
seperators: vertical, horizontal <select tick mark>
push-button:
name: INSERT
text: Insert_data
fctCode: INSERT
push-button:
name: UPDATE
text: Update_data
fctCode: UPDATE
push-button:
name: DELETE
text: Delete_data
fctCode: DELETE
push-button:
name: EXIT
text: Exit
fctCode: EXIT
SASIDHAR 9963855143
-47-
ABAP Lab-Guide
12 Save, activate
13 click on Back(F3) icon to go back to program source code screen
14 Save, check, activate, Execute
15 Now you can insert, modify , delete data in your table ZAJDEPT [see step-1]
BDC: (Batch Data Communication) is used to MIGRATE data from SAP to SAP system or from a non-
SAP legacy-system to SAP system.
In all the above methods you have to prepare a flat file containing the data in the required format to be
uploaded to the SAP system. You need to call the function ' UPLOAD' to do this. Then the contents of the
flat file have to copied to your internal table and then u need to call the transaction through which you want
to update the database. You internal table should also have the information relating to the structure
BDCDATA which is having the details like the module pool program name, screen no. The basic concept of
updating the database is same in all the 3 methods but only the method differs.
In session method after the data transfer program is coded, in order to process that particular session you
have to go to TC: SM 35 to process the session.
BDC: Call-Transaction – method (migrate data from text file ‘c:\my.txt’ to table LFA1)
Steps Action
Note: to avoid obstacle during data migration process remember the following points..
a) view the destination table(LFA1) data before data migration [using SE16. see step-37]
b) for example, if the last record data in table:LFA1, field:LIFNR(vendor code) is 1600, then the
first value of the same field in data file ‘C:\MY.TXT’ should be 1602 (1600+2).
c) during recording process a set of data is entered through the screen, which also gets
inserted into the same table (LFA1). Ensure that LIFNR(vendor code) value during screen-
recording is given as 1601 (1600+1) [see step-6] and the same value does not exist in table LFA1.
d) there should not be any duplicate data in LIFNR (it is a primary field with unique data)
SASIDHAR 9963855143
-48-
ABAP Lab-Guide
** Recording:
2 SHDB (transaction code for) Transaction Recorder: recording overview
3 Click ‘New recording’ on tool-bar
4 (in pop-up window..)
Recording: ZmyRec (give any name)
Transaction code: MK01 (prepare a technical Log for MK01)
(Note: MK01 is the transaction-code for SAP standard data entry screen create vendor –
purchasing )
5 Click on ‘Start recording’
6
Vendor: 1601 (select a non-existing vendor code)
Purchase organization: 0001 (give any code)
Account group: 0001 (give any code)
Name: santanu
Search term: SN
Country: IN
Currency: INR
SASIDHAR 9963855143
-49-
ABAP Lab-Guide
(you may delete the extra commented lines for readability. But not mandatory)
29 (Replace particular fields with Internal-table fields)
e.g.
SASIDHAR 9963855143
-50-
ABAP Lab-Guide
Include bdcrecx1.
Start_of_selection.
Perform open_group.
SE16 (transaction code) to view newly migrated data from file ‘C:\my.txt’ [see step-1]
38 Table name: LFA1 , click on ‘Table Contents’ icon (F7)
39 Cno: 1600 to 1650 (enter any vendor-code range) [this step is optional]
40 Execute
Note: ** completed program should look like this:
Report ZMYCALLTRANS no standard page heading line-size 255.
SASIDHAR 9963855143
-51-
ABAP Lab-Guide
LOOP AT ITAB.
REFRESH JTAB.
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR JTAB.
JTAB-PROGRAM = PROGRAM.
JTAB-DYNPRO = DYNPRO.
JTAB-DYNBEGIN = 'X'.
APPEND JTAB.
ENDFORM.
SASIDHAR 9963855143
-52-
ABAP Lab-Guide
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR JTAB.
JTAB-FNAM = FNAM.
JTAB-FVAL = FVAL.
APPEND JTAB.
ENDIF.
ENDFORM.
Steps Action
Note: to avoid obstacle during data migration process remember the following points..
a) view the destination table(LFA1) data before data migration [using SE16]
b) for example, if the last record data in table:LFA1, field:LIFNR(vendor code) is 1600, then the
first value of the same field in data file ‘C:\MY.TXT’ should be 1602 (1600+2).
c) during recording process a set of data is entered through the screen, which also gets
inserted into the same table (LFA1). Ensure that LIFNR(vendor code) value during screen-
recording is given as 1601 (1600+1) [see step-25]and the same value does not exist in table
LFA1.
d) there should not be any duplicate data in LIFNR (it is a primary field with unique data)
*** Same as BDC-Call transaction. (just add the following steps) ***
SASIDHAR 9963855143
-53-
ABAP Lab-Guide
2 SE38
3 Program: ZmySessionTrans (enter any name)
4 Create
5 Title: my BDC session transaction (enter any text)
Type: Executable Program
6 Save , LocalObject
7 Copy and paste entire Call-transaction program codes already done.
8 Place cursor just before the line ‘Loop at ITAB’
** call function BDC_OPEN_GROUP:
9 Ctrl+F6 or Click on ‘Pattern’ (to select the function name and generate codes)
10 Call function: BDC_OPEN_GROUP , click on continue (tick mark)
11 (Un-comment following 4 lines)
EXPORTING
Client = sy-mandt (Note: represents login ClientNumber. e.g. ‘800’)
Group = ‘mySession’ (Note: represents SessionName) [give any name]
User = sy-uname (Note: represents login UserName. e.g. ‘sapuser’)
12 Place cursor just before the line ‘ENDLOOP’
** call function BDC_INSERT:
13 Ctrl+F6 or Click on ‘Pattern’
14 Call function: BDC_INSERT , click on continue (tick mark)
15 (Un-comment following 3 lines)
EXPORTING
Tcode = ‘MK01’
DynProTab = JTAB
16 Place cursor after the line ‘ENDLOOP’
** call function BDC_CLOSE_GROUP:
17 Ctrl+F6 or Click on ‘Pattern’
18 Call function: BDC_CLOSE_GROUP , click on continue (tick mark)
19 Save , Check , Activate, continue(tick-mark) , Back(F3), Back(F3)
**Start Recording:
20 SM35 (transaction code for Session Manager)
21 Click ‘Recording’ (ctrl+F8) on tool bar
22 Click ‘New recording’ on tool-bar
23 (in pop-up window..)
Recording: ZmyRec (give any name)
Transaction code: MK01 (prepare a technical Log for MK01)
(Note: MK01 is the transaction-code for SAP standard data entry screen create vendor –
purchasing )
24 Click on ‘Start recording’
25
Vendor: 1601 (select a non-existing vendor code)
Purchase organization: 0001 (give any code)
Account group: 0001 (give any code)
Name: santanu
Search term: SN
Country: IN
SASIDHAR 9963855143
-54-
ABAP Lab-Guide
List of Radio-buttons:
1. Maintain object attributes
2. Maintain source structures
SASIDHAR 9963855143
-55-
ABAP Lab-Guide
Steps Action
Note: to avoid obstacle during data migration process remember the following points..
a) view the destination table(LFA1) data before data migration [using SE16. see step-95]
b) for example, if the last record data in table:LFA1, field:LIFNR(vendor code) is 1600, then the
first value of the same field in data file ‘C:\MY.TXT’ should be 1602 (1600+2).
c) during recording process a set of data is entered through the screen, which also gets
inserted into the same table (LFA1). Ensure that LIFNR(vendor code) value during screen-
recording is given as 1601 (1600+1) [see step-20] and the same value does not exist in table
LFA1.
d) there should not be any duplicate data in LIFNR (it is a primary field with unique data)
SASIDHAR 9963855143
-56-
ABAP Lab-Guide
(Note: MK01 is the transaction-code for SAP standard data entry screen create vendor –
purchasing )
19 Click on ‘continue’ (tick-mark)
20
Vendor: 1601 (select a non-existing vendor code)
Purchase organization: 0001 (give any code)
Account group: 0001 (give any code)
Name: santanu
Search term: SN
Country: IN
SASIDHAR 9963855143
-57-
ABAP Lab-Guide
SASIDHAR 9963855143
-58-
ABAP Lab-Guide
Note: for subsequent data migration from the same data file ‘C:\MY.TXT’(with different sets of data)
SASIDHAR 9963855143
-59-
ABAP Lab-Guide
into the same destination table(LFA1), just follow the steps from step-74 onwards
Steps Action
1 SE37 (transaction code for Function-Builder)
2 GoTo (on menu bar)
3 Function Groups
4 Create Group
5 function group: zmygrp
short description: my function group
6 click on tick-mark
7 Local object
8 Function module: ZmyFunc
9 Create
10 Function module: ZmyFunc [see step-8]
Function group: zmygrp [see step-5]
Short description: my sample RFC (give any text)
11 Save , ‘Local object’
12 Click on ATTRIBUTE(tab)
Select radio-button ‘Remote-enable module’
** IMPORT(tab):
13 Click on IMPORT(tab)
Parameter names type associated type pass value **(mandatory)
X type i tick (select)
Y type i tick (select)
** EXPORT(tab):
14 Click on EXPORT(tab)
Parameter names type associated type pass value **(mandatory)
Z type i tick (select)
** SOURCE CODE (tab):
15 Click on SOURCE CODE(tab)
…Enter the logic…
z = x + y.
16 Save , Check , Activate , Continue , Execute
17 Enter test data values for x , y
18 Click ‘Execute’ (F8) to test the function
Steps Action
1 SE38 (transaction code for ABAP editor)
2 Program name: ZmyRFC
Create
3 Executable
Short description: santanu’s RFC
SASIDHAR 9963855143
-60-
ABAP Lab-Guide
a = 10. b = 5.
6 Click on ‘Pattern’ ctrl+F6to generate function code
Select radio-button ‘Call function:’ and enter function name ZmyFunc [see RFC function
creation step-8]
7 Continue
8 Call function ‘Zmyfunc’ destination ‘NONE’
Exporting
X = a
Y = b
Importing
Z = c.
Write: / c.
NOTE: add statement destination ‘NONE’ to test the remote function call in local system. In
real life use the remote computer name. e.g destination ‘HONGKONG’
9 Save , check, activate, execute
IDOC-TYPE (class)
|
IDOC (object)
Note: each field structure should not exceed 100 bytes. An IDOC can have any number of SEGMENTs,
but atleast one SEGMENT should be mandatory
IDOC-TYPE
|------ SEGMENT
|------ segment definition (segment name)
|------ segment fields (defined with data elements e.g. KUNNR, …. )
SASIDHAR 9963855143
-61-
ABAP Lab-Guide
Steps Action
1 WE31
2 Segment type: ZmySEG (give any name)
3 Click on ‘Create’ icon (F5)
4 Short description: (enter any text)
5 Field name data element
CustNo kunnr
CustName name1
OrderNo vbeln-va
OrderValue netwer
6 Press ‘Enter’ key
7 Right most column gets filled with Field-lengths
8 Save , continue(tick mark) , ‘Local object’ , Back , back
9 WE30
10 Object name: ZmyOBJ (give any name)
11 Click on ‘Create’ icon (F5)
12 Select radi-button ‘Create new’ (default)
Short description:
13 Click on ‘continue’ (tick mark)
14 Select ‘ZmyOBJ’ from the list
15 Click on ‘Create’ icon (shift+F6)
16 A pop-up window appears
17 Segment type: ZmySEG
Select check-box ‘Mandatory Seg’
Minimum number: 10
Maximum number: 100
18 Continue(tick mark) , Save , ‘Local object’ , Back , Back
19 WE31
20 On menu-bar, select: EDIT Set Release
21 Click on ‘Check’ (it will display segment consistency message)
22 Back , Back
23 WE30
24 On menu-bar, select: EDIT Set Release
25 Click ‘Yes’ in the pop-up box
26 Click on ‘Check’ (it will display message: ZmyOBJ is released)
27 Back , Back
28 WE81
29 Screen appears with list of Messages
30 Click on ‘Change’ icon (ctrl+F1)
31 Click on ‘continue’ (tick mark) in the pop-up box
32 Click on ‘New Entries’ (F5) on tool-bar
SASIDHAR 9963855143
-62-
ABAP Lab-Guide
IDOC: (sending/receiving)
IDOC: in runtime
Steps Action
1 IDOC-TYPE is instantiated into IDOC
2 One unique 16 character number is attached to IDOC within the client
3 One ‘control record’ is attached
4 SEGMENTs are translated into ‘data records’
5 ‘status records’ are attached on crossing each mile-stone of IDOC processing
6 Syntax rules are checked
7 ‘control record’ is just like address-envelope
SASIDHAR 9963855143
-63-
ABAP Lab-Guide
Steps Action
1 On ‘source system’
goto an application e.g. SALE
2 Under ‘sending system’ and ‘receiving system’ define the logical system by entering the
DESTINATION system name & SOURCE system name. These names must be saved in a
‘development class’ e.g. ZmyDEV’
3 Assign clients to ‘Logical client’
4 Select the clients that are going to act as source and destination system and change their names
accordingly. (client: 800, 810)
5 ‘Logical client’ assignment – completed--
6 Set the RFC destination and configure it
7 Use the RFC destination, if it exists.
8 Create a new destination, if it doesn’t exist.
9 Modelling and implementing business process:
10 Under this, maintain distributed model & distributed views by creating MODEL –VIEW and
MESSAGE-TYPE
11 Transport the MODEL-VIEW that is developed into a MODEL-VIEW class
12 Generate ‘partner profile’ by giving the ‘Logical system name’
13 NOTE: carry out the same procedure for the other ‘client system’
Steps Action
1 WE21 (transaction code: to create a port)
2 Name:
Desc:
Function module:
Outbound file name:
RFC destination name:
Command file name: CONVERTER_SRART
3 WE41 (transaction code: for OUTBOUND process)
4 Process code: ZmyOUTPROCESS
Description: santanu’s outbound process
Or use..
SASIDHAR 9963855143
-64-
ABAP Lab-Guide
Protocol:
SAP’s application model is ‘transaction’ model, where as Java/VB follows ‘object oriented’ model
Steps Action
1 BAPI (transaction code)
2 1. Cross application components
2. Accounting - general
3. Financial accounting
4. Treasury
5. Controlling
6. Investment management
7. Enterprise controlling
8. Real estate management
9. Logistics – general
10. Sales & Distribution (SD) – basic functions, sales, billing, sales support
11. Materials management (MM)
12. Logistics execution
13. Quality management (QM)
14. Plant maintenance (PM)
15. Customer service
16. Production planning & Control
17. Project system
18. Environment, Health & Safety
19. Personnel management (HR)
20. Personal Time management (HR)
21. Pay roll (HR)
22. Training (HR)
23. Basic component service
3 NOTE: SPRO (transaction code) for entering into MM, FICO, etc.
IMG (transaction code) for implementation guide
4 SW01 (transaction code) to create an object
SASIDHAR 9963855143