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

Differences

former_member778253
Active Participant
0 Likes
736

Hi,

Can anyone tell me the difference b/w "Initialization" and "Parameters"

statement.

5 REPLIES 5
Read only

Former Member
0 Likes
706

<b>Initialization is an Event, Parameters is a keyword</b>

1 . It is not only the parameters default value

which are required/accessed/controlled

in initialization event.

2. In a program there are so many variables,

the values of these variables

can be set in intiailization event.

3. Such values sometimes cannot be hardcoded.

They may be requried to fetch from database

or do some calculations,

(which is not possible while declaration

data and parameters)

4. Sometimes, some variant can also be imported

for selection screen.

5.This event is invoked directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen.

This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.

When run in background, values initialized in initialization event are considered.

For eg: if you want to initialize like this:

carrid-sign = 'I'.

carrid-option = 'EQ'.

carrid-low = 'AA'.

carrid-high = 'LH'.

APPEND carrid TO carrid.

You cannot achieve this by giving 'default' or 'value' at selection-screen.

Regards,

Pavan

Read only

Former Member
0 Likes
706

Hi,

Parameters is used for taking inputs from the user, for a abap program. Initialization event is used to initialize the variables present in the program.

regards,

Navneeth K.

Message was edited by:

Navneeth Bothra

Read only

Former Member
0 Likes
706

Hi,

Difference between Select-Options and Parameters

The main difference between select-options and parameters is that the select-option creates a selection table consisting of 4 fields.

Please go thru the following details to learn more bout it...

Description of the individual components:

SIGN

The data type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows.

Possible values are I and E.

– I stands for "inclusive" (inclusion criterion - operators are not inverted)

– E stands for "exclusive" (exclusion criterion - operators are inverted)

OPTION

The data type of OPTION is C with length 2. OPTION contains the selection operator. The following operators are available:

– If HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions. Yet operators CP and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields.

If wildcards are entered on the selection screen, the system automatically uses the operator CP. The escape character is defined as #.

– If HIGH is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN

and NOT BETWEEN that you use when you check if a field belongs to a range. You cannot use wildcard characters.

- LOW

The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked.

– If HIGH is empty, the contents of LOW define a single field comparison. In combination with the operator in OPTION, it specifies a condition for the database selection.

– If HIGH is filled, the contents of LOW and HIGH specify the upper and lower limits for a range. In combination with the operator in OPTION, the range specifies a condition for the database selection.

- HIGH

The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection.

The parameter statement does not create a selection table .

The second thing is select-option gives us a range for selection, whereas parameter doesn't .

Using the parameter you can define radio buttons and checkboxes where as select-options can't

<b>Initilization:</b>

1 . It is not only the parameters default value

which are required/accessed/controlled

in initialization event.

2. In a program there are so many variables,

the values of these variables

can be set in intiailization event.

3. Such values sometimes cannot be hardcoded.

They may be requried to fetch from database

or do some calculations,

(which is not possible while declaration

data and parameters)

4. Sometimes, some variant can also be imported

for selection screen.

5.This event is invoked directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen.

This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.

When run in background, values initialized in initialization event are considered.

For eg: if you want to initialize like this:

carrid-sign = 'I'.

carrid-option = 'EQ'.

carrid-low = 'AA'.

carrid-high = 'LH'.

APPEND carrid TO carrid.

You cannot achieve this by giving 'default' or 'value' at selection-screen.

Regards

Read only

Former Member
0 Likes
706

Hi,

paramters: statement is used toaccept the values from the user...

initialization is an event which is used to set some default values before the selectionscreen appears..

if you give

p_par as a parameter

and in initialization

p_par = 123.

then when the selection screen appears

123 will be shown to the user and any how he can change it later

parameters is a statment which accepts the values from the user

initialization in an event which will be triggered befor the selection screen appears

thanks & regards,

Venkatesh

Read only

Former Member
0 Likes
706

Hi

reward if usefull

main difference is

PARAMETERS is a key word to creat a parameter in the selection screen and we can enter what ever value we want

INITILIZATION is a event which triggers when you click on execute button ,it will trigger only once in the whole program and what ever values u menationed unnder this by default exists on selection screen

and you can refer this also

<b><u>PARAMETERS</u></b>

Syntax

PARAMETERS {para[(len)]}|{para [LENGTH len]}

[ type_options]

[ screen_options]

[ value_options]

[ldb_options].

Declaration of a para parameter of length len. Parameters are components of a selection screen that are assigned a global elementary data object in the ABAP program and an input field on the selection screen.

The name of the para parameter may contain a maximum of eight characters. This statement is permitted in the global declaration part of executable programs, function groups and module pools. In function groups and module pools it is only permitted within the definition of a independent selection screen. In executable programs, it is otherwise automatically assigned to the standard selection screen.

The length len can only be specified if the data type specified in type_options is generic in terms of the length ( c, n, p and x). The length len must be specified as a numeric literal or as numeric constants. If len is not specified, the length is set to 1 for a generic data type, or else it is set to the length of the data type. From Release 6.10, it is possible to specify the length using the LENGTH addition.

In detail, the PARAMETERS statement has the following effect:

The statement declares a global variable para of the specified length in the program. The type of the data object is specified in type_options.

On the current selection screen, an input field with the same name and a suitable external data type is created in a new line at position 35. The length of the input field is aligned with the length of the parameter. The maximum length of the input field is 132. The maximum visible length of the input field is between 39 and 45, depending on the nesting depth in blocks with frames. If the len length is greater than the maximum visible length, the content is displayed as movable.

In front of the input field, in the first possible position, an automatically generated output field is displayed as a description, whose length is between 23 and 30 depending on the nesting depth in blocks with frames. The output field contains either the name of the para parameter or the selection text to which the parameter is assigned in the text elements of the program. If the user requests field or input help on the output field using the F1 or F4 function keys, the same output is displayed as when the input field itself is selected.

The attributes of the elements on the selection screen can be influenced in screen_options and with the SELECTION-SCREEN statement.

Before the selection screen is sent, the content of the para data object is transported to the input field on the selection screen. If the length of the parameter is greater than 132, the content is truncated from the right. After a user action on the selection screen, the content of the input field is transported to the data object, where various events are triggered. The content of character-type fields is converted into uppercase by default. Settings with regarding the content of the input field can be made in value_options.

If parameters are defined in the selection include in the logical database, additional ldb_options additions are necessary or possible.

If a parameter with a length greater than 132 is populated by SUBMIT when an executable program is called, the value is similarly truncated from the right at position 132. It is not truncated only if the parameter is declared with the NO-DISPLAY addition.

<b><u>INITIALIZATION</u></b>

Syntax

INITIALIZATION.

This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.

When an executable program defines a standard selection screen, it is called again by the ABAP runtime environment after execution, which triggers the INITIALIZATION event again. In this case, initializing parameters or selection criteria of the selection screen has no effect, because they are automatically supplied with the preceding user inputs from the selection screen during the selection screen event AT SELECTION-SCREEN OUTPUT. To explicitly initialize the selection screen for each call, you must use the event AT SELECTION-SCREEN OUTPUT.