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

Initializing Parameters

Former Member
0 Likes
1,989

Hi All

We can assign default values to the parameters or select options using default addition or we can initialize the same in Initialization event

Can anybody plz tell me whatz the difference between two cases and when to use which alternative

Thanks in Advance

and plz tell me how to close the thread

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,655

Hi,

adding to above you cannot give default values for select options like include, exclude, between , equal options that can be done only with initialization event.

dynamic defaults can be done in initialization , you cannot default in selection screen with dynamic values as stated above.

Regards

vijay

12 REPLIES 12
Read only

Former Member
0 Likes
1,655

hi,

When u use default value for the parameter it is contants.

but when use initialize in inilize event value u specify is dynamically generated.

eg :-

initialize.

para1 = sy-datum + 7.

select something from table into itab

para2 = itab1-key1.

feel free to ask any question.

mark helpfull answers

Regards

manoj

Message was edited by: Manoj Gupta

Read only

Former Member
0 Likes
1,656

Hi,

adding to above you cannot give default values for select options like include, exclude, between , equal options that can be done only with initialization event.

dynamic defaults can be done in initialization , you cannot default in selection screen with dynamic values as stated above.

Regards

vijay

Read only

0 Likes
1,655

Hey vijay

we can assign default values to sign (I,E), option (LT,GT..)fields of select options using

select-options fnane for <ref> default sign..option..

and you said we cannot default in selection screen with dynamic values .. i din get what exactly u r trying to say.. coz we can assign default values in selection screen also

Read only

0 Likes
1,655

Hi nikita,

Check the Amit answer for dynamic values .if you want to assign certian data from data base to selection screen then you need to go for initialization.

regards

vijay

Read only

0 Likes
1,655

Nikita,

Unless you append the I,E, LT, GT values, it will not be reflected in the SELECT-OPTIONS, right and you cannot use the append option it the DEFAULT setting.

If you have process something before you arrive at a value that cannot be done in DEFAULT, where as you can do that in INITIALIZATION.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
1,655

ya Ravi u r right

but that will be the case if i want to add more than one record to the selection table

But if i just wann give single record than that i can do using default addition without using Initialization Event

Isnt it??

Read only

0 Likes
1,655

Nikita,

Yes that is the case even if you have append one record to the SELECT OPTIONS, Unless you append it, that same will NOT be considered, and you cannot APPEND while defaulting, right?

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
1,655

I will try this first

Anyways Thanks a lot for your responses and

plz tell me how to close the thread

Read only

Former Member
0 Likes
1,655

Hi nikita,

1. good question.

2. when we use default,

we have to HARDCODE the value in the program.

3. but suppose, u want to

pick some field from database,

and show it as default,

then,

DEFAULT won't work.

(bcos we have to write code for getting data first)

4. In such cases, we use INITIALIZATION event.

5. Other wise there is no difference.

regards,

amit m.

Read only

Former Member
0 Likes
1,655

HI

GOOD

PARAMETERS

Declares parameters for a selection screen.

Syntax

PARAMETERS <p>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>]

[DEFAULT <f>]

[MEMORY ID <pid>]

[LOWER CASE]

[OBLIGATORY]

[VALUE CHECK]

[AS CHECKBOX]

[RADIOBUTTON GROUP <radi>]

[NO-DISPLAY]

[MODIF ID <key>].

SELECT-OPTIONS

Declares selection criteria for a selection screen.

Syntax

SELECT-OPTIONS <sel> FOR <f>

[DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]

[MEMORY ID <pid>]

[LOWER CASE]

[OBLIGATORY]

[NO-DISPLAY]

[MODIF ID <key>]

[NO-EXTENSION]

[NO INTERVALS]

[NO DATABASE SELECTION].

THIS IS THE WAY TO PASS THE VARIOUS PARAMTERS IN SELECT-OPTIONS AND PARAMTER STATEMENTS, AND YOU CAN USE THEM AS PER YOUR REQUIREMENTS

THANKS

MRUTYUNJAYA TRIPATHY

Read only

Former Member
0 Likes
1,655

Nikita,

You can click on the stars on the left side of the screen, and by clicking "Solved Problem" you close the thread.

Please mark all the helpful answers.

Regards,

Ravi

Read only

0 Likes
1,655

Thanks to All

for your quick responses

I got the funda

Thanks Once again