03-25-2008 8:39 PM
Hi,
i do select from big DB table in fm and i wont to now if i can select limited records,
meaning not more then 1000 records if it happen raise massage like to much records .
Regards
03-26-2008 1:59 PM
Hi,
You can also check FM RFC_READ_TABLE on how to read DB table with row skips and row count options.
Regards,
Ferry Lianto
03-25-2008 8:45 PM
Hi,
Instead of raising a exception in the function module may be you can do is
1. Create a import parameter in the function module as "No of Hits" ( if want make it as optional /mandatory)
2. In the select
select *
into corresponding fields of table i_mara
up to p_maxsel rows
from mara.
" Here p_maxsel is the import parameter in the function module.
" that contains the number of records to be selected
a®
03-26-2008 12:25 AM
Hi ,
We can limit our selection criteria.
If you are using a function module , then create a parameter for holding the value of the number of records to be selected.
In the Fm use select query as follows:
"Select fields from source_name into destination_table up to X rows." where X is the mo of records parameter sent from the FM.
once the query gets executed then you can raise an error message or warning message or abend message.
samplecode:
call Function 'GETDATA'
exporting
mx_records = 1000
tables = itab.
select field1 field2 ..... fieldn from source_table into itab up to mx_records rows.
if mxrows > 1000.
message e000(0) with 'Too Many Records'.
endif.
thats all the requirement.
Reward points if helpful.
thanks and regards.
03-26-2008 1:59 PM
Hi,
You can also check FM RFC_READ_TABLE on how to read DB table with row skips and row count options.
Regards,
Ferry Lianto
03-26-2008 2:07 PM
U can select limited records .. using up to ..n rows
select * from <table> into table it_tab up to n rows ..
03-26-2008 2:08 PM
hi check this program..
tables: mara.
data: begin of itab occurs 0,
matnr like mara-matnr,
meins like mara-meins,
pstat like mara-pstat,
end of itab.
select-options:s_matnr for mara-matnr.
parameters:p_no type i.
select matnr
meins
pstat
from mara
into table itab
up to p_no rows
where matnr in s_matnr.
loop at itab.
write:/ itab-matnr,
itab-meins,
itab-pstat.
endloop.
regards,
venkat.
03-26-2008 2:49 PM
hi,
u can use select ..... upto 1000 rows.
It fetches only 1000 records and comes out of that statment...
No mgs display in required...
if u use any other ways it hits the database several times...
u program performence will get reduce....
Regards,
priya