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

data updation into table

Former Member
0 Likes
901

Hi abapers,

Here iam facing an interesting situation in one of my object.am putting my words abt that object .

THANKS IN ADVANCE

i have more than 10,000 records in one internal table. i need to update that internal table with all the records. but i need to update in a frequency of 1000 records at a time...i.e., from that 10,000 records i need to update that itab in 10 loops. Please help me out.

Will give points.

9 REPLIES 9
Read only

Former Member
0 Likes
878

hI,

It is very easy

Just use PACKAGE SIZE in your select query.

Do F1 on PACKAGE SIZE you will get details.

Regards,

Atish

Read only

varma_narayana
Active Contributor
0 Likes
878

Hi..

You can do this by declaring another Itab like ITab2 .

Eg:

DATA V_START TYPE I VALUE 1.

DATA V_END TYPE I VALUE 1000.

DO 10 TIMES .

APPEND LINES OF ITAB1 FROM V_START TO V_END TO ITAB2.

INSERT ZDBTABLE FROM TABLE ITAB2 ACCEPTING DUPLICATE KEYS.

V_START = V_END + 1.

V_END = V_END + 1000.

REFRESH ITAB2.

ENDDO.

<b>reward if Helpful.</b>

Read only

0 Likes
878

Hi Varma,

Thanx alot. really this hint worked in my case. am giving you points.

Read only

rainer_hbenthal
Active Contributor
0 Likes
878

the most performant way is to use fieldsymbols.

having 10 points where the whole table is updated is bad programming style. You have to recode that. Loop over the table, then deliver the fieldsymbol to formroutines which are doing the changes, e.g:


DATA:
  itab type standard table of t_something.

FIELD-SYMBOLS:
  <p> type t_something.

loop at itab assigning <p>.
  perform first_change using <p>,
  perform second_change using <p>.
  perform third_test using <p>.
....
endloop.

Read only

Former Member
0 Likes
878

Hi Govardhan,

do like this

select <f1> <f2> from <dbtable> into table itab

package size 1000 where <clause>.

-


update records.

-


endselect.

Let me know if you are not clear.....

<b>Reward for helpful answers</b>

Satish

Read only

0 Likes
878

How should that work on an internal table? Please read postings more carefully.

Read only

0 Likes
878

Hi Rainer,

I am not telling about doing process after getting the data into internal table.. Before getting the data to the internal table...

Cheers,

Satish

Read only

Former Member
0 Likes
878

is it better to make sy-index to 1 after 1000 records

Read only

Former Member
0 Likes
878

Thanx for giving your valuable solutions