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

Read Table Stmt

Former Member
0 Likes
525

I selected some data from table and put into internal table.I want to change some fields by some calculations.I tried using read stmt.it fetches only one record.I need to change group of records(not in dbase.)in internal table.How to do this?

4 REPLIES 4
Read only

Former Member
0 Likes
508

loop at itab.

*--change fields of record

itab-field1 = 'A'.

modify itab index sy-tabix.

endloop.

Read only

Former Member
0 Likes
508

Hi Khanna,

You can do in this way... implement for your requirement...

Types: begin of ty_tab1,
             a type i,
             b type i,
             c type i,
           end of ty_tab1.

Data: itab1 type table of ty_tab1,
         wa1 type ty_tab1.

wa1-a = 10.
wa1-b = 20.
append wa1 to itab1.

wa1-a = 15.
wa1-b = 25.
append wa1 to itab1.

loop at itab1 into wa1.
 wa1-c = wa1-a + wa1-b.
 modify itab1 from wa1 transporting c.
 clear wa1.
endloop.

Reward Points if this helps.

Satish

Read only

Former Member
0 Likes
508

use EDITOR-CALL key

syntax is

EDITOR-CALL FOR ITAB TITLE 'editing of it'.

if it is helpful reward points

thanks

Read only

naimesh_patel
Active Contributor
0 Likes
508

You can do it with LOOP statment.

LOOP AT ITAB INTO WA_ITAB WHERE FIELD = 'TEST'.
 WA_ITAB-FIELD2 = 'TEST11'.
 MODIFY ITAB FROM WA_ITAB.
ENDLOOP.

Regards,

Naimesh Patel