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

Select statement

Former Member
0 Likes
1,189

Hello All,

i am using a select statement on table ADRS.

Since huge amount of data is fetched into the internal table the report is giving me a dump.

Other then declaring the internal table as Hash table is there any other way out.

Regards,

Vimal Khare

Use meaningful Title

Edited by: Vijay Babu Dudla on Jan 28, 2009 10:55 PM

11 REPLIES 11
Read only

rob_postema
Participant
0 Likes
1,162

Try to narrow your search by using 'WHERE' ..............

Read only

0 Likes
1,162

Hi,

I have narrowed the search as much as possible but still it gives me a dump.

Regards,

Vimal Khare

Read only

tarangini_katta
Active Contributor
0 Likes
1,162

HI,

Y do u want to get all the data using select.

Better serch for function module to get data from ADRS.

It will solve u r problem otherwise use where condition.It is not good to get all the data from the table using select.Go with FM then u wont get any pblm.

Thanks

Read only

0 Likes
1,162

Hi,

I think the problem here is with the internal table.

This program runs in the background. So even if i use the select statement ideally there should not be any problem.

I believe the error is due to the overflow of the internal table.

So without changing my internal table as Hash table is there any other way out.

Regards,

Vimal Khare

Read only

0 Likes
1,162

Hi Vimal,

Use SELECT .. ENDSELECT. Do the processing between SELECT .. ENDSELECT.

Otherwise check with your BASIS team, if they can increase your session memory.

Mubeen

Read only

Former Member
0 Likes
1,162

hi,

yes u can use CURSOR statements (open cursor and close cursor)

sample code attached below

OPEN CURSOR WITH HOLD d_cursor FOR

SELECT frdlt

srdlt

mrslofd

qmnum

vbeln

bukrs

werks

spart

vhvin

dbm_licext

vhcex

matnr

mcodecs

kunnr

frlsdt

srlsdt

frssdt

srssdt

fresdt

sresdt

mrslofd

vbeln_new

FROM zdm_mrs_mast

WHERE ( srdlt IN s_frdlt OR

frdlt IN s_frdlt ) AND

mrslofd IN it_searchcrit1 AND

spart IN s_spart AND

werks IN s_werks AND

mcodecs IN s_mcode.

ENDIF.

DO.

FETCH NEXT CURSOR d_cursor

INTO CORRESPONDING FIELDS OF TABLE it_final_c

PACKAGE SIZE 4000.

IF sy-subrc = 0.

SELECT vhvin

zzdrnam

zzusad1

zzusad2

zzuspob

zzuspoc

zzustel

zzusfax

zzemlid

zzusprs

zzusgsm

zzserdt

zzserdtp

zzserkms

zzvioem

iobjguid

FROM VLCVEHICLE

INTO CORRESPONDING FIELDS OF TABLE et_vlcdiavehi

for ALL ENTRIES IN it_final_c

WHERE vhvin = it_final_c-vhvin.

*MIN003-

APPEND LINES OF et_vlcdiavehi TO it_vlcdiavehi.

APPEND LINES OF it_final_c TO it_final.

CLEAR: wa_final_c,wa_searchcrit.

REFRESH: it_final_c,it_searchcrit,et_vlcdiavehi.

ELSE.

CLOSE CURSOR d_cursor.

EXIT.

ENDIF.

ENDDO.

Read only

Former Member
0 Likes
1,162

Use SELECT/ENDSELECT. The performance difference is not large, and you save a lot of memory.

Read only

Former Member
0 Likes
1,162

Hi

Restrict the select condition using where clause.Try to pass all the primary key in the where condition.If it is not possible to pass all the primary key try to pass the maxm primary key.

Read only

Former Member
0 Likes
1,162

Hi,

Please try to pass the primary key.

If you are not in position to pass the primary key, please try to create an index with the fields you are passing in the input.

Read only

Former Member
0 Likes
1,162

Hi Vimal,

Use Package size in select statement

Select * * *

from ADRC

into table I_ADRC

package size 10000 (may varies).

your processing code .................

endselect.

Kiran

Read only

Former Member
0 Likes
1,162

Hi Vimal,

You should try narrowing your SELECT Query with WHERE Condition and

try to put all the primary keys in your SELECT clause it will help in the

SELECT Queries performance.

And after putting it into your internal table,then apply binary search on that internal table,

to manipulate with the data.

Hope it helps you

Regrds

Mansi