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: 

Parameters V/s Select Options

Former Member
0 Kudos

Hi Friends,

I would like to ask one reason while executing the select option & parameters option.

Suppose I declare one field lifnr as parameters as well as select option.

i.e.

parameters: p_lifnr like lfa1-lifnr.

select-options: s_lifnr for lfa1-lifnr.

If i execute the report in which I m using parameter option in selection screen, if I will not enter any value in selection screen & execute the report then it will not display any output.

But if I execute the same report in which I m using select-options in selection screen & if I will not enter any value in selection screen & execute the report then it will display the records.

Anybody will tell me what is the reason for this??

6 REPLIES 6

Former Member
0 Kudos

HI neha,

U would written ur code like that.

I mean,in your select statements u would have used the Parameter in where condition.

Regards,

Imran.

Former Member
0 Kudos

hi

if u dont enter any value in parameter then it takes the default value according to the type of the field

char it takes space

int it takes zero...and so on

but in select-options if u dont give any values by default it takes all the values...

Former Member
0 Kudos

Hi,

In parameters default value is null or space according to paramenter data type but in case of select option by default is take range of min to max records so all the records is comming .

Rewards points if it is useful

Former Member
0 Kudos

Hi Neha,

This is one of the mail differece with the paraters. If u havn't passed any value for it and used in the select means the select will fails... because it will not equal to all the value.

If you want the parameter stuff and it is not a mandatory one, then it better to use the select-option with no-extention and no-intervel...

Regards,

Satya.

gopi_narendra
Active Contributor
0 Kudos

Parameter is a single value and when you dont enter any value means its blank value ie initial. so now when you select data from table where lifnr is empty... it does not return any value as LIFNR is never empty in the table LFA1.

Where as select options is a set of values from __ to __

ie it can be any starting number to any ending number, so now when you query on this it will consider all the values and will return you some records in your internal table

hope this is clear

Regards

Gopi

Former Member
0 Kudos

HI,

THERE IS A BIG DIFF BETWEEN PARAMETER AND SELECT OPTION

WHILE WRITING SQL

IN PARAMETER YOU USE = IN WHERE CLAUSE

BUT IN SELECT OPTION USE IN

PARAMETER CONTAIN ONE VALUE

SELECT CONTAIN N NO. OF VALUES / RANGE / NOT EQUEL ETC.

MUKESH