02-13-2006 8:48 AM
Hello folks,
I am facing one problem .when I dont give any selection criteria my program searches for blank records in respective table for that criteria and blank records are not there so sy-subrc is not coming as 0, But this should not happen in this way , rather program should display all records because that selection criteria is blank. To overcome this issue each time I am checking whether that selection criteria is blank or not. If that criteria is blank I will simply exclude condition for selection from database table and criteria is there on selection screen I have to select for accordingly. <b>Is there any other way to get all data from database table for particular column if I dont give any value for that column on selection screen</b>?
02-13-2006 9:05 AM
hi again,
*----
1 .Best thing is that for PARAMETES,
use select-options like this way.
SELECT-OPTIONS : bukrs FOR t001-bukrs NO INTERVALS no-extension.
2. This will give the LOOK and FEEL of parameters only.
3. Moreover, in sql,
use IN (instead of 😃
regards,
amit m.
02-13-2006 8:50 AM
02-13-2006 8:52 AM
Hi nirad,
1. SELECT-OPTIONS vs parameter
2. This problem happens in parameter.
3. In select-options,
even if we give blank (do not enter anything)
and bcos we use
IN abc
sql,
the system understand and gives
ALL records.
4. So u can use SELECT-OPTIONS (instead of parametes)
and use IN sql
5. Other wise
make your paramters OBLIGATORY.
6. Or else, as u have already used,
use IF conditions for sql.
7. There is no other way !
regards,
amit m.
Message was edited by: Amit Mittal
02-13-2006 8:54 AM
Hi Nirad,
you can dynamically create your Selection criteria..
for eg.
data : sel_cri type string.
if s_bukrs is not initial.
concatenate sel_cri 'bukrs eq s_bukrs' into sel_cri.
endif.
if s_belnr is not initial.
concatenate sel_cri 'and belnr in s_belnr' into sel_cri.
endif.
....
select * from bseg where (sel_cri).
hope this helps you..
regards
satesh
02-13-2006 8:55 AM
Hi,
Check whether u have specified in the WHERE contion of ur SELECT Query with selection screen parameters.
In that case it wont retrieve if it doesnot satisfy the selection param.
02-13-2006 8:56 AM
Hi Nirad,
Using select option if you don't enter any thing it will fetch all the records from the table.
select-options: s_vbeln for vbak-vbeln.
"don't enter any thing in selection screen
select vbeln
from vbak
into it_vbak
where vbeln in s_vbeln.
now it_vbak has all vbak records..
regards
vijay
02-13-2006 9:05 AM
hi again,
*----
1 .Best thing is that for PARAMETES,
use select-options like this way.
SELECT-OPTIONS : bukrs FOR t001-bukrs NO INTERVALS no-extension.
2. This will give the LOOK and FEEL of parameters only.
3. Moreover, in sql,
use IN (instead of 😃
regards,
amit m.