Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Z-Report Preparation

Former Member
0 Kudos

Hi, I want to know basics in preparing the Z-Reports. I mean when you do confirmation where the data will be saved? the table name that appears in CO11N screen (by clicking F1-> Tech info) will remain same when we save? or will it change? any specific steps req? pls help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I am little unclear about what your requirement is exactly. But here is the check list to be looked into while preparing a Z-Report.

1. First of all, check if there is any Standard Report exist with

your Functional Consultant.

2. If a Z-Report is required, make sure to get all the

Requirements regarding the Selection-Screen, Layout, Mode

of Execution (Online or Batch), Tables to be accessed.

3. Keep in mind the Performance Issues (avoiding SELECT *)

avoiding nested LOOPs, avoiding SELECT inside the LOOP.

4. Whether to go for Classical / ALV Reporting.

5. Usage of Data, i.e., the Number of Tables and the Number

of Records stored in the Internal Tables.

6. Any Database update is required.

Hope it was helpful.

Thanks and Regards,

Venkat Phani Prasad Konduri

4 REPLIES 4

Former Member
0 Kudos

Hello,

I am little unclear about what your requirement is exactly. But here is the check list to be looked into while preparing a Z-Report.

1. First of all, check if there is any Standard Report exist with

your Functional Consultant.

2. If a Z-Report is required, make sure to get all the

Requirements regarding the Selection-Screen, Layout, Mode

of Execution (Online or Batch), Tables to be accessed.

3. Keep in mind the Performance Issues (avoiding SELECT *)

avoiding nested LOOPs, avoiding SELECT inside the LOOP.

4. Whether to go for Classical / ALV Reporting.

5. Usage of Data, i.e., the Number of Tables and the Number

of Records stored in the Internal Tables.

6. Any Database update is required.

Hope it was helpful.

Thanks and Regards,

Venkat Phani Prasad Konduri

0 Kudos

Hi, thank you for your response. I want to know functional consultant point of view, just to prepare a FS. letus say a efficiency report which is "actual hrs/target hr". i know that actual hrs i will find in confirmation tables like AFRU, AFRC and AFRV. Which one i should select. Also i know that target hours we will find in routing related screen. which routing related tables should be selected. because we have many tables for particular activity. pls advise the basics for functional consultant to prepare a FS.

Former Member
0 Kudos

HI,

the most basic thing you would require is

A) THE BASIC ABAP COMMAND TO

1) DECLARE DATA,WORKAREA,Internal table

B) SELECT QUERY TO FETCH AND POPUALTE TABLE

C) KNOW THE USE OF ALL THE BASIC EVENTS IN REPORT WRITING in correct order like :

When u start the Report:

LOAD-OF-PROGRAM

INITIALIZATION

Before displayins Selection Screen:

AT SELECTION-SCREEN OUTPUT.

Before leaving Selection Screen:

AT SELECTION-SCREEN.

After processing Selection Screen when the List starts:

START-OF-SELECTION.

Before displaying the List .. After completing START-OF-SELECTION.

END-OF-SELECTION.

For Every page:

TOP-OF-PAGE .

END-OF-PAGE.

The different events in a report Program are:

Load-of-program

Triggers the associated event in an internal session after loading a program of type 1, M, F, or S. Also runs the associated processing block once and once only for each program and internal session. The processing block LOAD-OF-PROGRAM has roughly the same function for an ABAP program of type 1, M, F or S as a constructor has for classes in ABAP Objects

Initialization.

This event is executed before the selection screen is displayed .

Initialization of all the values.

You can assign different values other than the values defaulted on the selection screen .

You can fill your selection screen with some values at runtime.

At Selection-Screen.

The event is processed when the selection screen has been processed (at the end of PAI ).

Validation & Checks of inputted values happen here

Extras :

…ON VALUE-REQUEST FOR psel_low_high .

The pushbutton for F4 (Possible entries) appears beside the appropriate field.

... ON HELP-REQUEST FOR psel_low_high

. ... OUTPUT

This event is executed at PBO of the selection screen every time the user presses ENTER

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.

Events in an ABAP/4 Report Program

Start-Of-Selection

Processing block is executed after processing the selection screen

All the data is selected in this block.

All the main processing on the data except for interactive reporting is handled in this block.

End-Of-Selection

Data which is selected and has been processed is printed to the screen in this block.

List Processing happens in this block

Top-of-Page.

New-Page.

End-of-Page.

Events during List Processing

Top-of-Page.

Triggered by the first write statement in the program

It is used to have a standard header in the program for all the pages.

TOP-OF-PAGE is only executed before outputting the first line on a new page

New-Page.

Can be used when one wants to display different data on different pages

Terminates the current page and continues output on a new page.

Will not trigger the Top-of-Page or End-of-Page.

End-of-Page.

It is used to have a standard footer for all the pages.

Triggered by the program if the number of records exceed the line-count of the program.

Regards,

Manish

Former Member
0 Kudos

Why Report Program?

Report Programs are used to display large amounts of data.

Used when data from a number of tables have to be selected and processed before presenting.

Used when reports have to have a special format.

Transaction:

SE38.

Report programming:

Report programs are always executable programs.

Report Programming is an Event-driven programming.

The first line of a report program is always Report <report-name>.

In order to suppress the list heading or the name of the program the addition No Standard Page Heading is used.

The line size for a particular report can be set by using the addition line-size <size>.

To display any information or error message we add a message class to the program using the addition: Message-id <message class name>.

Message classes are maintained in SE91.

selection-screen:

Definition:

It is the screen where one specifies the input values for which the program should run.

The selection screen is normally generated from the

1. Parameters

2. Select u2013Options.

Syntax:

selection-screen begin of screen <screen #>

selection-screen begin of block <#> with frame title <text>

u2026u2026u2026u2026u2026..

....................

selection-screen end of block <#>

selection-screen end of screen <screen #>

Parameters

Parameters helps one to do dynamic selection.

Parameters can accommodate only one value for one cycle of execution of the program.

Syntax

Defining parameters as a data type

Parameters p_id(30) type c.

Defining parameters like a table field.

Parameter p_id like <table name>-<field name>.

Parameters can be listbox.

Parameter p_id like <table name>-<field name> as listbox.

Parameters can be Checkboxes as well as Radiobuttons.

Parameters p_id as checkbox.

Parameters p_id1 radiobutton group <group name>.

Parameters p_id2 radiobutton group <group name>.

Select-Option

A Select-Option is used to input a range of values or a set of values to a program.

Syntax

Defining Select-Option like a field of a table.

Select-Options s_vbeln for vbak-vbeln.

A select-option can be made to look like a parameter. Following is the syntax

select-options s_vbeln for vbak-vbeln no intervals no-extension.

One might want to make it necessary to input some values for the execution of the program. In such a case, the addition u2018obligatoryu2019 is used.

Eg: Parameters p_id like vbak-vbeln obligatory.

Select-options s_vbeln for vbak-vbeln obligatory.

You can specify a default value to both a Parameter and a Select-Option with the u2018defaultu2019 addition.

Eg: Parameters : p_date TYPE sy-datum DEFAULT sy-datum. Select-options s_date for sy-datum default sy-datum.

You can hide a parameter , select-option with u2018no-displayu2019 addition

Eg: PARAMETERS d TYPE spfli-carrid no-display.

Select-options s_vbeln for vbak-vbeln no-display .

Text Elements: Three components (Path: Goto Text Elements)

List Headings

- Used to make Dynamic List Headings

Selection Texts

- Used to give a name to the select-options and parameters which will be displayed in

the selection screen.

Text Symbols

- Used for printing texts either on the selection screen or in the report output.

Importance

Text Elements enjoy multi-lingual support.

Hard Coding can be avoided using text symbols.

Events in report program

ABAP/4 report programs are event driven programs

The different events in a report Program are:

Load-of-program .

Initialization.

At Selection-Screen.

Start-of-Selection.

End-of-selection.

Interactive Events.

Therefore an ideal report program should start with:

Report <report name> no standard page heading

line-size <size>

line-count <n(n1)>

message-id <message class>.

type of reports:

Classical Reports

Interactive Reports

Logical Database Reports

ABAP query

ALV Reports (ALV stands for ABAP List Viewer)

Report Writer/Report Painter

Views (There are different types of views also)

flow of events:

INITIALIZATION->AT SELECTION-SCREEN->START-OF-SELECTION->END-OF-SELECTION->INTERACTIVE EVENTS

EVENT OF REPORT:

Load-of-program

Triggers the associated event in an internal session after loading a program of type I, M, F, or S. Also runs the associated processing block once and once only for each program and internal session.

Initialization.

This event is executed before the selection screen is displayed .

Initialization of all the values.

You can assign different values other than the values defaulted on the selection screen .

You can fill your selection screen with some values at runtime.

At Selection-Screen.

The event is processed when the selection screen has been processed (at the end of PAI ).

Validation & Checks of inputted values happen here

Start-of-Selection.

Processing block is executed after processing the selection screen

All the data is selected in this block.

All the main processing on the data except for interactive reporting is handled in this block.

End-of-selection.

Data which is selected and has been processed is printed to the screen in this block.

List Processing happens in this block

-Top-of-Page.

-New-Page.

-End-of-Page.

Interactive Events

Used for interactive reporting. It is used to create a detailed list from a basic list.

Events during List Processing

Top-of-Page.

Triggered by the first write statement in the program

It is used to have a standard header in the program for all the pages.

TOP-OF-PAGE is only executed before outputting the first line on a new page

New-Page.

Can be used when one wants to display different data on different pages

Terminates the current page and continues output on a new page.

Will not trigger the Top-of-Page or End-of-Page.

End-of-Page.

It is used to have a standard footer for all the pages.

Triggered by the program if the number of records exceed the line-count of the program.

INTERACTIVE REPORTING

Purpose

User can actively control the data retrieval and display of data

To create a detailed list from a very basic list

To make a report interactive with another transaction.

Snippets

The detailed data is written on a secondary list.

The secondary list may either completely overlay the first screen or one can display it in a new screen

The secondary lists can be themselves interactive.

The first list may also call a transaction.

There are different events associated with interactive programming. (Again!)

EVENTS IN INTERACTIVE REPORTING

The following are the different events associated with Interactive Reporting

At Line-Selection

- Event is triggered by either the user double clicking a particular line or using F2 to select it transaction.

At User-Command

- Event triggered by user pressing a function key

At PFn

- Event triggered on press of a function key .The position of the cursor in the list is I irrelevant. Where n is between 0 to 99

Top-of-Page during Line Selection

Event called during list processing when a detailed list is called

Some commands used for Interactive Reporting.

Hotspot

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>.

Get Cursor Command

Like Hide this is also used for getting the values after selection of a row.

Syntax:

1. GET CURSOR FIELD f. 2. GET CURSOR LINE lin.

HOPE THIS WILL HELP U

WITH REGARDS

s.jANAGAR