2007 May 31 6:45 AM
What will happen if we execute a report without giving any value in parameter in selection screen ?
What will happen if we execute a report without giving any value in select-options in selection screen ?
What will happen if we execute a report without giving any value in parameter in selection screen ?
What will happen if we execute a report without giving any value in select-options in selection screen ?
2007 May 31 7:14 AM
it will take initial values for the seletion criteria and display all the values
2007 May 31 7:17 AM
Hi Swapna ,
If it is a parameter then it will try to select all those records from the database where the feild corresponding to the parameter is blank/initial, chances are that it would not select any record.
In case of select options , it will select all records ,i.e. it will basically ignore that condition in the where clause and select data based on other conditions in the where clause.
Regards
Arun
2007 May 31 7:30 AM
hi,
What will happen if we execute a report without giving any value in parameter in selection screen ?
it won't fetch any record. but if we give another input filed in select statement it will fetch data depending on that filed.
What will happen if we execute a report without giving any value in select-options in selection screen ?
It will fetch all tha data contained in that field.but if we give another input filed in select statement it will fetch data depending on that filed along with this one.
2007 May 31 10:11 AM
Hi,
if parameter and sel option is not obligatory and will run report as usual.
about filtering of data , it will assume that all values are sielected so no fileter will be added.
e.g. p_para and s_selopt doesnot contin any value
then
select ..... where matnr = p_para. will NOT retun any record.
select .... whre matnr IN s_selopt . will rerutn all recors.
Jogdand M B
Message was edited by:
Jogdand M B
2007 May 31 10:22 AM
Hi Swapna,
<b>1) What will happen if we execute a report without giving any value in parameter in selection screen ?</b>
A) It will consider parameter's intial values based on the data type
<b>2) What will happen if we execute a report without giving any value in select-options in selection screen ?</b>
A) It will consider all the entries for that field in the table
Thanks,
Vinay
2007 Jun 01 6:09 AM
hi swapna,
if u excute parameter without giving anything in it, then it goes to database and search abt null values in the database, then output is empty,
if u excute select-options without giving anyting in it, then it goes to database and takes all records from the database, then ouptut is all avbl records in the database.
regards,
seshu.
2007 Jun 01 7:38 AM
Hi
Parameters: It will check if there is any record which has value as INITIAL or blank
Select-options: It will consider all records. Its as good as giving no condition at all.
Regards
Navneet
2007 Jun 01 5:06 PM
Hi Swapna
if u didnt give any value for parameter or select-option then the select query will select all all the records from the table.
if u declare these as a mandatory then u should pass value. If u didnt give any value u cannot get any value. Ur program will goes to error.
using Al selection-screen event u can validate ur Selection-screen.
need ur reward points.
Regards
Ravi
2007 Jun 04 7:22 AM
Hi
Please look at the following code to understand.
REPORT zz_session_method.
TABLES: bkpf.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE bukrs.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs.
SELECTION-SCREEN : END OF BLOCK b1.
DATA: t_bkpf TYPE TABLE OF bkpf.
** Selection using Parameters as initial.
SELECT bukrs FROM bkpf INTO TABLE t_bkpf
WHERE bukrs = p_bukrs.
IF sy-subrc >< 0.
** This will select only the values from BKPF where BUKRS is equal to SPACE.
ENDIF.
** Selection Using Select Options as Initial.
SELECT bukrs FROM bkpf INTO TABLE t_bkpf
WHERE bukrs IN s_bukrs.
IF sy-subrc = 0.
** This will select all the values from BKPF with out any restriction on BUKRS.
ENDIF.Hope this will help
Anirban M.
2007 Jun 04 7:24 AM
Hi
Please look at the following code to understand.
REPORT zz_session_method.
TABLES: bkpf.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE bukrs.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs.
SELECTION-SCREEN : END OF BLOCK b1.
DATA: t_bkpf TYPE TABLE OF bkpf.
** Selection using Parameters as initial.
SELECT bukrs FROM bkpf INTO TABLE t_bkpf
WHERE bukrs = p_bukrs.
IF sy-subrc >< 0.
** This will select only the values from BKPF where BUKRS is equal to SPACE.
ENDIF.
** Selection Using Select Options as Initial.
SELECT bukrs FROM bkpf INTO TABLE t_bkpf
WHERE bukrs IN s_bukrs.
IF sy-subrc = 0.
** This will select all the values from BKPF with out any restriction on BUKRS.
ENDIF.Hope this will help
Anirban M.
2007 Jun 04 4:15 PM
hi swapna,
for the both screnarios if u are not passing any value at selection-screen,if will table all the field values in the perticulat table.
see the below example.
parameter: matnr like mara-matnr.
selction-options: matnr for mara-matnr.
u r program will have MATNR at u r selction screen.
if u not giving any value in MATNR it will read all the MATNR value in MARA table.
reward if useful.
Thanks,
Madhukar.
2007 Jun 13 1:11 PM
Hi Swapna,
Here you go..Use this code and find the differennce
*----
*-- 2) Difference between Parameters and Select options with
*-- No-Intervals and No-extension
*----
Explanation: -
1) If u dont enter any value in parameter, the system consider it as a initial value and dont retrive any records. If u dont enter any value in select-options, the system selects all values from the database.
2) The other difference is You can check a value againist a Entries against a check table with Parameter option by as " VALUE CHECK ". However it is recommended to use this only when the parameter is obligatory becuase it checks for blank entries also. This option( VALUE CHECK ) cannot be used in SELECT-OPTIONS.
( Eg:- p_matnr like mara-matnr OBLIGATORY VALUE CHECK. )
TABLES: MARA.
DATA: p_count TYPE i,
s_count TYPE i.
PARAMETERS: p_mtart like mara-mtart.
SELECT-OPTIONS: s_mtart FOR mara-mtart NO INTERVALS NO-EXTENSION.
SELECT count(*) FROM
MARA into p_count
WHERE matnr = p_mtart.
SELECT count(*) FROM
MARA into s_count
WHERE matnr IN s_mtart.
WRITE:/ p_count,
s_count.
In this output, p_count = 0.
and s_count will be total no. of records in database.
Reward points if this code is helpful.
Thanks.
Hari krishna
2007 Jun 13 10:12 PM
Hi,
For PARAMETERS: It wont select any record.
For SELECT-OPTIONS: It will fetch all the records from the database.
Regards,
*DJ
Reward, if its useful
2007 Jun 14 7:30 AM
hi swapna,
when u will execute a report without giving any value in parameter in selection screen it will not return any value..the output will be blank...
where as when u execute a report without giving any value in select-options in selection screen it will return all the values based on select query...
hope this will clear ur doubt...
please reward points in case useful...
regards,
prashant
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |