Topics Covered
SAP Architecture R/3 Reports Function Modules Interfaces BDCs, LSMW Cross Applications BAPIs, RFCs, IDOCs
R/3 Architecture
R/3 Architecture
R/3 Architecture
Reports
Reports
Reports are Programs that read data from the database, processes the data and displays the data to the required format. Reports are uses in day to day business environment. For eg
Displaying the purchase orders vendor wise Displaying the balance of vendors to be paid till a particular date
Enhance the efficiency & transparency of Business Processes Sound Decision making with the control of master data and accurate reporting Relevant Documents immediately available for in case of drill down reports Multiple angles of Data representing and Forecasting Values
Reports: Classification
Classical Interactive
external control
...
India SAP CoE, Slide 12
Events
ABAP/4 report programs are event driven programs The different events in a report Program are:
Initialization.
Initialization of all the values. You can fill your selection screen with some values at runtime.
At Selection-Screen.
Validation & Checks of inputted values happen here
Start-of-Selection.
Here the program starts selecting values from tables.
End-of-selection.
After all the data has been selected this event writes the data to the screen.
Interactive Events.
Used for interactive reporting. It is used to create a detailed list from a basic list.
Data Declaration
Data statement Like and Type Keywords
Internal Tables
Standard Sorted Hashed
Table Scan
Binary Srch
Hash Function
Access Using
Predominantly Index
Predominantly Key
Key Only
Uniqueness
NON-UNIQUE
UNIQUE| NON-UNIQUE
UNIQUE
Internal Tables
Operations without header line
INSERT <wa> INTO TABLE <itab>. COLLECT <wa> INTO <itab>. READ TABLE <itab> ... INTO <wa>. MODIFY TABLE <itab> FROM <wa>. MODIFY <itab> FROM <wa>WHERE
Cont..
Common Statements
Write Loop.. Endloop If Else Endif Case When Endcase Select
Interactive Reporting
The following are the different events associated with Interactive Reporting
Event Keyword
At Line-Selection At User-Command At PFn Where n is between 0 to 99 Top-of-Page during Line Selection
Event
Event is triggered by either the user double clicking a particular line or using F2 to select it Event triggered by user pressing a function key Event triggered on press of a function key. Event called during list processing when a detailed list is called
Interactive Reporting
Hotspot
Cont..
If one drags the mouse over the data displayed in the report using the FORMAT statement then the cursor changes to a Hand with an Outstretched Index finger Syntax: Format Hotspot On (Off).
Hide
This command helps you to store the field names based on which one will be doing further processing to get a detailed list. It is written directly after the WRITE statement for a field. When a row is selected the values get automatically filled in the variables for further use. Syntax: Hide <field-name>.
Modularization
Subroutines
Subroutines are procedures that you can define in any ABAP program and also call from any program.
Function modules
Function modules are procedures that are defined in function groups and can be called from any ABAP program.
Include
If you want to use the same sequence of statements in several programs, you can code them once in an include program.
Subroutines
Defining Subroutines
FORM <subr> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ] [CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]. ... ENDFORM.
Subroutines
Calling Subroutines
PERFORM... [USING ... <pi>... ] [CHANGING... <pi>... ].
Cont..
Static Variable
If you want to keep the value of a local data object after exiting the subroutine, you must use the STATICS statement to declare it instead of the DATA statement. With STATICS you declare a data object that is globally defined, but only locally visible from the subroutine in which it is defined. STATICS f_text TYPE f_word VALUE 'INIT'.
Function modules
Calling Function Modules
CALL FUNCTION <module> [EXPORTING f1 = a 1.... f n = a n] [IMPORTING f1 = a 1.... f n = a n] [CHANGING f1 = a 1.... f n = a n] [TABLES f1 = a 1.... f n = a n] [EXCEPTIONS e1 = r 1....en = rn [ERROR_MESSAGE = r E] [OTHERS = ro]].
Debugger
Fields Table
Cont..
The scrollable field display contains the contents of up to eight fields. The contents of the three most important system fields are always displayed. This is the default display mode in the Debugger. See also Processing Fields Displays the contents of an internal table. This mode allows you to display and edit the entries in an internal table. See also Processing Internal Tables A scrollable display containing up to 30 breakpoints. Next to each breakpoint is a counter. You can also delete breakpoints in this display. See also Managing Dynamic Breakpoints You can set a watchpoint for a field so that the program is interrupted whenever the value of that field changes. This display mode contains a list of Watchpoints, the fields and programs to which they are assigned, the current values of the fields, and the conditions upon which the watchpoint is activated. See also Setting Watchpoints This mode displays the current sequence of events, and the sequence of calls up to the current breakpoint. The last active call is displayed at the top of the list; previous calls are listed in reverse chronological order. When an event (for example, START-OF-SELECTION) concludes, it is deleted from the display. This mode displays the structure of the program. It lists its events, subroutines, and modules, and shows which sections belong to which events. It also displays the section currently being processed. This mode displays the current Debugger settings. You can change the settings by selecting or deselecting various options. For further information, refer to Settings and Warnings
Breakpoints
Watchpoints
Calls
Overview
Settings
Hands On
An output report is required which takes sales document no (VBAPVBELN) as input, selects the fields VBELN POSNR & NTGEW and displays a report as shown :
Additional Info
Use the below link for complete details on ABAP.
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d 1829f0000e829fbfe/frameset.htm
Data Upload
BDC LSMW
Purpose
BDC stand for BATCH DATA COMMUNICATION Through this concept we transfer the data into SAP R/3 System Legacy System R/3 System
Data
BATCH INPUT
WS_UPLOAD
ABAP/4 PROGRAM
Application server
Internal table
Read Dataset
WS_UPLOAD
ABAP/4 PROGRAM
Application server
Internal table
Read Dataset
METHOD #2 METHOD #3
Function Modules
An on-line user can start the session using the batch input menu options. (To access the batch input options, choose System
SM35
You can submit the background job RSBDCSUB to start a session in background processing. If several sessions have the same name, RSBDCSUB starts them all.
Direct Input
To enhance the batch input procedure, the system offers the direct input technique, especially for transferring large amounts of data. In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not process screens. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. To maintain and start these programs, use program RBMVSHOW or Transaction BMV0. It is better to use BDC method unless data volume is very high, as validations are very critical to data upload in SAP. Examples for direct input programs are:
Start date
General data Job name Job class
Steps
Status
Target host
LSMW
How LSMW works ?
Legacy data on PC
Structure relations
Read data
Read data
Legacy data on application server
Field mapping
Convert data Batch Input processing Converte d data Direct Input processing IDoc inbound processing
Conversion rules
Data Record
Status Record
Receiving
Shipping Notice
Shipping
Intermediate Documents
(IDOCs)
What is an IDoc ? An IDoc is simply a data container that is used to exchange information between any two processes that can understand the syntax and semantics of the data.
India SAP CoE, Slide 42
Data Record
Status Record
Agenda Hands On
Create A Database table. Create a report to upload data to the table. Attach a transaction to the report. Create a recording for the above transaction. Generate program for the recording. Write BDC program. Write LSMW.
India SAP CoE, Slide 44
Thank You!