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

program structure for a report

Former Member
0 Likes
856

hi,

could any one clarify whether

initialization event is to be written first or

selection-screen begin of block is to be written.plz tell whether this affects performance.

I have written a report with the following structure.plz correct me if i'm wrong

1)DB table declaration

2) internal tables declaration and ranges decltn

3)ALV variables & internal tables

4)constants & variables

5)initialization

6)selection-screen(begin of block-end of block)

7)at selection-screen on value req

😎 at selection-screen

9)start-of-selection

10)end-of-selection

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
805

Hi mamatha,

Initilaization eventt is to be written first, rather than going for selection-screen begin of block .

Coming to your code structure, this should be the order.

1,2,4,3,5,6,7,8,9,10

Hope this resolves your query.

Reward all the helpful answers.

Regards

7 REPLIES 7
Read only

Former Member
0 Likes
806

Hi mamatha,

Initilaization eventt is to be written first, rather than going for selection-screen begin of block .

Coming to your code structure, this should be the order.

1,2,4,3,5,6,7,8,9,10

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
805

hi Mamatha,

The structure for a program is:

INCLUDE

TABLES

TYPES (Including TYPE-POOLS)

CONSTANTS

DATA

INFOTYPES ( HR Specific)

INTERNAL TABLES

FIELD-SYMBOLS

FIELD-GROUPS

INSERT

CONTROLS

SELECT-OPTIONS

PARAMETERS

INITIALISATION

AT SELECTION-SCREEN

START-OF-SELECTION

GET

END-OF-SELECTION

AT LINE-SELECTION

AT PFXX

AT USER-COMMAND

TOP-OF-PAGE

END-OF-PAGE

FORM

CLASS

METHOD

INTERFACES

hope this helps u.

Regards,

Thasneem

Read only

Former Member
0 Likes
805

5)selection-screen(begin of block-end of block)

6)initialization

initialization is an event and selection-screen(begin of block-end of block)

id the declaration of selection screen so it is good practice to declare all the variables and selection screen before the event and then only code the events.. i dont think it will decrease in any performance but it is a good practice...

regards

shiba dutta

Read only

Former Member
0 Likes
805

HI Mamatha,

first you write Begin of block -- selection screen.

then you write Initilization.

Initilization is an event, by which the selection screen is automatically filled and modified.

At selection screen on value request, at selection-screen are the events of selection screen processing after the user entered the data.

a clear idea is initilization is -- PBO and At selection-screen is PAI.

Reward points if useful.

Regards,

Dhanunjay.

Read only

Former Member
0 Likes
805

Hi,

Initialization should come first .Whaterver we declare in the initialization part will work before the screen id displayed.

Read only

Former Member
0 Likes
805

Hi Mamatha

There is absolutely no need of worrying about which should come first and which next...

Anything is fine...whether INITIALIZATION coming first or vice-versa. and further, there is no connection of this with performance. Infact, let me tell you that PERFORMANCE comes into picture only when u r accessing the database or when u r processing large internal tables.

<b>and regarding the order of ur report:</b>

Its fine! How ever, for more readability, u can swap the 5th and 6th steps, so that all the events are grouped at one place and all the data declarations above them.

And let me tell u one important thing: Don't allow the data declaration to happen in SELECTION-SCREEN events, it will not be global.....

Hope u understand me completely

Reward points if helpful

Regards

Read only

Former Member
0 Likes
805

Hi Mamatha,

Performance will not come into this picture.

Anyway selection screen will be triggered first though you write initialization event first.

Hope this helps.

Thanks,

Srinivas