Application Development and Automation 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: 
Read only

Classical Reports

Former Member
0 Likes
845

What are the types of classical Reports available ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
803

hi kumar p

<u><b>A classic report</b></u> is a program that generates a single list, which must contain all of the required detail information.

1) This procedure may result in extensive lists from which the <b>user has to pick the relevant data.</b>

2) For background processing, this is the only possible method. After starting a background job, there is no way of influencing the program.

3) The desired selections must be made <b>beforehand and the list must provide detailed information.</b>

4) For dialog sessions, there are no such restrictions.

5) The <b>user is present during the execution</b> of the program and can control and manipulate the program flow directly.

6) To be able to use all advantages of the online environment, classical reporting was developed into <b>interactive reporting.</b>

<u><b>An interactive report generally works in the following fashion:</b></u>

1. Basic list is displayed.

2. User double clicks on any valid line or

User selects a line and presses as button on the tool bar.

3. The corresponding event is triggered

4. Then in the code, the line on which action was done, is read.

5. Depending on the values in that selected line, a secondary list is displayed.

6. Steps from 2-5 are repeated till the end.

hope this explains u better

reward if useful,,

Ginni

5 REPLIES 5
Read only

Former Member
0 Likes
803

hi

<b>CLASSICAL REPORTS</b>

Events in Classical report

Events associated with classical report are as follows and each one will be discussed in detail.

• <b>INITIALIZATION

• AT SELECTION-SCREEN

• AT SELECTION-SCREEN ON <field>

• START-OF-SELECTION

• TOP-OF-PAGE

• END-OF-PAGE

• END-OF-SELECTION</b>

In this case first three events are associated with selection screen. Rest of the events are associated with your list.

<b>

• INITIALIZATION</b>

We have already seen how to fill default values for the selection criteria. But in many cases you need to calculate the value and then put it in selection criteria. For example, say, you are accepting date from user and you need to fill in the default value for lower range as sy-datum – 30 days and sy-datum for higher range. In this case you are calculating lower range and then filling the criteria. This can be done in INITIALIZATION event. Piece of code to do the above task would look like the following:

Tables: Sflight.

Select-options: fldate1 for sflight-fldate.

INITIALIZATION.

Data: date1 like SY-DATUM.

Date1 = sy-datum – 30.

Fldate1-low = date1.

Fldate1-high = sy-datum.

Append fldate1.

  • Here appending is required because fldate1 is int’ table

This event is triggered when you execute your program for the first time i.e., before selection screen is displayed.

<b>• AT SELECTION-SCREEN</b>

When user enters the values in the fields of selection screen and clicks on execute button, this event gets triggered. This event is basically for checking the values entered by the user for the fields of the selection screen i.e., data validity checking. This event is for entire selection screen. For example:

You are accepting carrid, connid, fldate from user and you don’t want to proceed if user enters no value for carrid and fldate. Using AT SELECTION-SCREEN can do this.

Select-options: carrid1 for sflight-carrid,

Connid1 for sflight-connid,

F1date1 for sflight-f1date.

AT SELECTION-SCREEN.

If carrid1-low ne ‘ ’ and fldate1-low = ‘ ’.

Error message.

Endif.

In this case, if both the fields are entered blank, then the user gets error message.

Basically, this event is for many fields on selection screen. Usually, it is for the fields which are logically related.

• AT SELECTION-SCREEN ON <field>

When you want to check for specific value of a field. For example, carrid should be in the range of ‘LH’ and ‘SQ’. This can be done in this event. Basically, this event is for checking individual fields. You can have many AT selection-screen events in your program (i.e., for each field specified in the Select-Options).

Select-Options carrid1 for sflight-carrid.

AT SELECTION-SCREEN.

If carrid1-low ne ‘LH’ and carrid1-high ne ‘SQ’.

Error message.

Endif.

Here the system will not proceed on entering wrong values.

<b>• START-OF-SELECTION</b>

This is the first event for your list. Once all the events are triggered for selection screen, the data is retrieved from database. Data declaration, select statements are done in this event. Consider the following example:

<b>START-OF-SELECTION.</b>

Data: mtype i.

Tables: sflight.

Select * from sflight where carrid = ‘LH’.

Write: / sflight-carrid,sflight-connid.

Endselect.

<b>

• TOP-OF-PAGE</b>

This event is triggered with first WRITE statement or whenever new page is triggered. Advantage of using this event is that, whatever you write under this event, is applicable to all the pages. If you don’t have any write statement before TOP-OF-PAGE or in START-OF-SELECTION, this event is not triggered at all. For example, if you want the name of company and column headers for all the pages, it can be written in this event.

<b>TOP-OF-PAGE

Write: / ‘INTELLIGROUP ASIA PVT. LTD.’

Write : / 10 ‘carrid’, 20 ‘connid’, 30 ‘fldate’.

• END-OF-PAGE</b>

This event is triggered at the end of page.

End-of-page.

Write : / ‘page number’, sy-pagno.

In this case page number will be written on every page.

Conditional triggering of EOP

Consider the following case.

REPORT ZDEMO1 line-count 15(3).

Top-of-page.

Write: ‘this line is written by top-of-page event’.

Start-of-selection.

Write: ‘this line is written by start-of-selection event’.

End-of-page.

Write : ‘this line is written by end-of-page event’.

In this case EOP will never be triggered, as end of page is never reached. The total Line-count defined for page = 15 in which 3 lines are for footer area. The output of the above code will be

This line is written by top of page event.

This line is written by start of selection event.

In output screen, only two lines are written and cursor remains still on 3rd line, the end-of-page event is not triggered. To trigger end of page event, cursor should reach at the last position, in this case on 11th line.

Such cases are quite common, and could be overcome by conditional triggering of end of page.

Sy-linct is the system variable, which gives total line count of a list.

Sy-linno is the system variable, which gives the current line number where the cursor is placed on the list.

Consider the following case:

<b>Report zdemo1 line count 20(1).

Start-of-selection.

Data: m type i.

Write: / ‘this is first line’.

Do 5 times.

Write: / ‘the number is’, sy-index.

Enddo.

M = sy-linct, sy-linno – 1.

Skip x.

End-of-page.

Write: / ‘page end’.</b>

The output of above example is as follows :

This is first line.

The number is 1

The number is 2

The number is 3

The number is 4

The number is 5

After skipping 10 lines

Page end

In this case, with all write statement, you don’t reach to the end of page. After all write statement, m is calculated in this case:

M = 20 – 8 – 1, So m is 12. And 11 lines are skipped after write statement and end of page is reached. (In this case you have 6 write statement so 6 lines + 1 line for page number and 1 horizontal line which is displayed for any list. So cursor is on 8th line and is subtracted from total line count i.e, 20.)

Common errors that user commits

Stating of another event denotes the end of any event. If you forget to mention the next event then everything is included in the same event. Consider the following case:

<b>

AT SELECTION-SCREEN.

If carrid1-low ne ‘ ‘.

Err. or message.

Endif.

Write: / ‘INTELLIGROUP ASIA P. LTD.’

WRITE: / 10 ‘CARRID’, 20 ‘CONNID’, 30 ‘FLDATE’.

START-OF-SELECTION.

….</b>….

….

In this case all the write statement are included in the `at selection screen’ as top-of-page is not specified. The end of `at selection-screen’ is denoted by the starting of start-of-selection.

Though the sequence of events in program is immaterial, it is a good programming practice to write all the events in the order specified above.

<b>Using Variants with selection criteria</b>

In many cases you need report to execute report at regular interval for certain fixed values of selection criteria. That means each times you execute the report you need to enter its values again and again. ABAP/4 provides the facility by which you can define the values for selection screen and store it. Using VARIANTS can do this. It can be defined as group of values used for selection criteria while executing report. For a particular report, you create a variant which means variant created for particular report cannot be used for another report. The group of values for the selection criteria is saved and assigned a variant name. So every time you call a report, you need not specify the values for selection criteria but instead call the variant thus avoiding extra typing. User can have many variants for a single report. Each of them can be used as different type of information. For example, if a manager wants to see how an employee in personnel department or admin department has performed. He need not enter the department, one has to just execute the report with variant. In case he doesn’t know about the variant, which is available, he can display list of variants attached to the report and values assigned to each variant.

<b>Creating variant</b>

• Execute the report program. The selection screen is displayed.

• Enter the values for selection screen and click on saves.

- System displays the variant screen

• Enter the variant name and description for it.

• Save it.

Usually the variants are useful when you need to execute the report in background, which will be discussed in background processing.

also refer to the following links

http://wiki.ittoolbox.com/index.php/FAQ:How_many_types_of_reports_are_there_in_ABAP_and_what_is_the_...

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Message was edited by:

ravish goyal

Read only

Former Member
0 Likes
803

Hi ONly 2 types of Classical reports

1. Basic List

2, Interactive List

reward if useful

regards,

ANJI

Read only

Former Member
0 Likes
803

Hi,

gO TO abapdocu transaction.

open up the node ABAP User Dialogs->Lists->Simple Lists

example:

*"Table declarations...................................................

tables:

sflight. " Flight master

*"Selection screen elements............................................

select-options s_carrid for sflight-carrid.

"----


  • Internal table to hold flight data *

"----


data:

t_sflight like

standard table

of sflight,

wa_flight like line of t_sflight.

"----


  • INITIALIZATION *

"----


initialization.

select min( carrid ) into s_carrid-low from sflight.

select max( carrid ) into s_carrid-high from sflight.

append s_carrid.

"----


  • START-OF-SELECTION EVENT *

"----


start-of-selection.

perform get_flight_data.

"----


  • END-OF-SELECTION EVENT *

"----


end-of-selection.

perform print_list.

----


  • FORM GET_FLIGHT_DATA *

----


  • This subroutine retrieves necessary data from flight arrival and *

  • departure related table. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form get_flight_data.

select carrid " Airline Code

connid " Flight Connection Number

fldate " Flight date

seatsmax " Maximum capacity

seatsocc " Occupied seats

price " Airfare

from sflight

into corresponding fields of table t_sflight

where carrid in s_carrid.

if sy-subrc ne 0.

message 'No records found'(006) type 'W'.

endif. " IF SY-SUBRC...

endform. " GET_FLIGHT_DATA

----


  • FORM PRINT_LIST *

----


  • This subroutine writes necessary data from internal table to list. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form print_list.

write:

'CARRID'(001),

10 'CONNID'(002),

30 'FLDATE'(003),

45 'SEATSMAX'(004),

55 'SEATSOCC'(005).

loop at t_sflight into wa_flight.

write: /

wa_flight-carrid under text-001,

wa_flight-connid under text-002,

wa_flight-fldate under text-003,

wa_flight-seatsmax under text-004,

wa_flight-seatsocc under text-005.

endloop. " LOOP AT T_SFLIGHT...

endform. " PRINT_LIST

regards,

kiran kumar k

Message was edited by:

kiran kumar

Read only

Former Member
0 Likes
804

hi kumar p

<u><b>A classic report</b></u> is a program that generates a single list, which must contain all of the required detail information.

1) This procedure may result in extensive lists from which the <b>user has to pick the relevant data.</b>

2) For background processing, this is the only possible method. After starting a background job, there is no way of influencing the program.

3) The desired selections must be made <b>beforehand and the list must provide detailed information.</b>

4) For dialog sessions, there are no such restrictions.

5) The <b>user is present during the execution</b> of the program and can control and manipulate the program flow directly.

6) To be able to use all advantages of the online environment, classical reporting was developed into <b>interactive reporting.</b>

<u><b>An interactive report generally works in the following fashion:</b></u>

1. Basic list is displayed.

2. User double clicks on any valid line or

User selects a line and presses as button on the tool bar.

3. The corresponding event is triggered

4. Then in the code, the line on which action was done, is read.

5. Depending on the values in that selected line, a secondary list is displayed.

6. Steps from 2-5 are repeated till the end.

hope this explains u better

reward if useful,,

Ginni

Read only

Former Member
0 Likes
803

HI,

Classical report is the report in which user can sipmly watch the output list and cannot do other than seeing the list.

Types of classical reports are:

1. Basic/Simple List

2. Interactive List.

****Reward points if useful.

All the best