Thursday, September 25, 2008

Interactive Reports

Simple/Classical type of reports programs are read-only report programs that show the data once. When users want to drill down and expand the results, we develop Interactive Reports.

Reports (lists) are displayed in a special container screen. On a normal screen, a user action triggers the PAI event. In the screen flow logic, you code a processing block that calls ABAP dialog modules in this event. In list processing, the event is intercepted by the list processor and processed.

Instead of calling dialog modules, one of the three following list events mat be called depending on the function code triggered by the user.We usually have report code that consists of :TOP OF PAGE event - where we write the Page Header details, Column names, etc.END OF PAGE event - where we write sum, total, end of report comments, etc.

START OF SELECTION event - all the select queries would go in this event

END OF SELECTION event - written after start of selection, it would consist of all the logic to process the data that was selected in start of selection and to fill up the Internal table and lastly looping at the internal table and displaying the contents using write statement

Incase of Interactive reports, we drill down if certain records are selected by user. This is done with the help of HIDE statement. Hide statement will act as a temp buffer and the selected line is available for drilling or displaying the next list.

AT LINE-SELECTION - This event has the code block required to drill down the report whenever user selects any particular record

AT USER-COMMANDIf you have written the corresponding event blocks in your program, they are executed. You can access the function code in the system field SY-UCOMM.

The output from any list statements that you write in these event blocks is written to detail lists. One can maintain one basic list and up to 19 detail list, total is 20.

The ABAP system field SY-LSIND is very important contains the index of the list currently being created. For Basic list, SY-LSIND is zero.

By default, the basic list has a standard list status and standard page header. The TOP-OF-PAGE and END-OF-PAGE events can occur while the basic list is being created. All output in these events is placed in the page header and footer of the basic list. In executable programs, the basic list is automatically sent to the list processor and displayed at the end of the END-OF-SELECTION event. Otherwise, it is displayed after the PAI processing block on the screen from which the LEAVE TO LIST-PROCESSING statement occurred.


The list produced by classical report doesn’t allow user to interact with the system.The list produced by interactive report allows the user to interact with the system.

Monday, September 1, 2008

Events / Processing Blocks in ABAP Reports

Events/Processing blocks in ABAP

Start of an event is marked by event keyword.
End of an event is indicated by start of another event.

INITIALIZATION

Before the standard selection screen is displayed


AT SELECTION-SCREEN
After user input on a selection screen has been processed, but while the selection screen is still active

START-OF-SELECTION
After the standard selection screen has been processed, before data is read from the logical database

GET node
After the logical database has read a data record from the node node

GET node LATE
After all of the nodes of the logical database have been processed that are hierarchically subordinate to the node in the structure of the logical database

END-OF-SELECTION
This event is generally used to mark the end of GET node event in reports where LDB’s are used

List processor events:

TOP-OF-PAGE
In list processing when a new page starts. Frequently used in Simple Reports to display header data.
This event is executed whenever the first WRITE statement is encountered. System first executes the TOP OF PAGE event and then processes the WRITE statement.

END-OF-PAGE
In list processing when a page ends. Generally used in Simple Reports to print footer data.

AT LINE-SELECTION
Triggers when a specific line in the output is selected. Generally used in Simple Drill down reports for navigation. sy-lisel holds the content of the line that was clicked

AT PFnn
When the user triggers the predefined function code

PFnnAT USER-COMMAND
When the user triggers a function code defined in the program

ABAP Reports

Reports
There are many different kinds of developments in SAP that are classified as Reports. Common examples include
- Simple reports
- Simple report with drill down functionality
- ALV reports (Basic, grid, hierarchical)
- ALV reports
- Complex ALV reports with drill down, ALV - tree, drag n drop functionalities, etc


Simple Reports –
Easy to develop, usually assigned to beginners, takes about 2-3 days for development based upon complexity
Involves
providing a selection screen for user input,
reading of data from SAP tables using select queries or function modules,
storing the data in internal table and
displaying the contents of internal table as output using WRITE statements

Simple Reports with drill down feature –
Involves capturing user clicks on the report output and achieving a drill down functionality using code written in AT LINE SELECTION
These reports generally make use of sy-lisel (system variable that holds contents of selected line) and HIDE statements to identify the clicked/ selected lines
Formatting of output is done via ABAP command statements such as SY-ULINE, SY-VLINE, FORMAT ON, WRITE with positions, etc.

ALV Reports
ALV stands for ABAP List Viewer
These reports are very much similar to simple ABAP reports with the only difference being the method used for displaying the report output to end user.
These reports make use of standard ALV function modules for displaying the data in tabular format. Unlike simple reports where a lot of formatting is required, ALV handles the formatting and provides a tabular display of report output. It also provides a number of additional functionalities to end user such as sum, sorting, column width adjustment, etc.

Complex ALV Reports –
These involve ALV reports with enhanced features such as
- Drilldown
- Tree display
- Drag n drop feature
These are implemented by using a number of standard methods using OO-ABAP approach.

SAP Architecture & SAP Landscape

SAP Architecture

SAP is implemented using 3 Tier Architecture. It consists of three servers:
1. Application Server
2. Database Server
3. Presentation server

All the SAP programs and applications run on application server. They act as an interface between Database and Presentation servers.
Database servers are the centralized server where all the data is stored. They can only be accessed via requests to application servers.
Presentation servers are the system, typically our desktops, which are used to connect to application servers. It’s the presentation server where we run the GUI, e.g. SAP GUI, Web GUI, etc.


SAP Landscape

SAP landscape is the setup or arrangement of SAP servers. There are 3 systems in SAP landscape:
Development System (DEV client 200- development, 210- sandbox, etc)
Quality system (QAS client 300 Integration testing, 310 user training, etc)
Production system (PROD client 100)

The name and numbering of systems is solely on basis of business requirements and implementation strategy.
Whatever you do on Development or Sandbox client doesn’t have any effect on other systems or clients.
All the developments, configurations and customizations are first done on development systems and organized under transport requests. They are thoroughly tested on quality systems and eventually loaded onto the production system (Live Systems).

Transport management system co-ordinates the movement of development objects, customizations and configurations.
SAP Technical consultants usually develop RICEF objects and organize them under Transport tasks and requests. Once they objects are thoroughly tested by Functional consultants on QAS systems, the transport requests are released and developments & customizations are transported across to Production system.
Production systems are live systems. They contain live user data, which is periodically loaded onto the QAS systems.

Sunday, August 31, 2008

The Basics - What's RICEF?

What is RICEF? Many a times asked in interviews! Unfortunately a lot of people fail to answer a simple question, even though working on it for years.

You usually come accross the word RICEF when searching for SAP ABAP Developer jobs.
RICEF isn't a standard SAP acronym. It's not defined by SAP like we have ABAP, ALV, etc. It's a comon term used to describe five areas of technical developments in SAP.

RICEF stands for Reports, Interfaces, Conversions, Enhancements, Forms.

R- Reports
R stands for Report developments. All the technical objects/developments that deal with programing of SAP Reports. It includes different types of reports; Simple reports where you output using WRITE statements, Simple ALV reports, ALV Grid, ALV Grid with advanced functionality,etc.

I - Interfaces
I stands for Interface developments. Interfaces are ALE/IDOCs development. Involves not just ABAP programming for IDOCs but also IDOC customization.

C - Conversion
C stands for conversion objects. Conversion refers to BDC programing. Data upload from legacy system in flat files format to SAP system is done via Conversion Objects. This involves uploading data through BDC, LSMW, BAPI, etc.

E - Enhancements
Enhancements are User Exits, Customer Exits, BADI's etc. ABAP code that has to be written in order to enhance SAP system functionality.

F - Forms
Forms include SAP Smartforms, SAP Scripts. Technical development that deals with fetching necessary data from SAP system and displaying in terms of forms for printout are classified as under Forms.

Common questions :-
1. As an ABAPer, why do I care what RICEF means? What does it have to do with me?
Well it's really simple. It's just that one must know the category of the technical development he is working upon.
2. What's the use of RICEF?
SAP Project managers usually refer technical development in terms of RICEF objects.
Project technical team leads usually distinguish the objects based on this categorization and assign them to team on basis of experience. Reports being a first choice for beginners and Enhancements being the favourite choice for experts.

Thats all on RICEF!! Details on each of these category coming soon!!