‎2010 Jan 08 4:20 PM
Is there syntax that will fill a field value in every record in an internal table without looping?
‎2010 Jan 08 4:29 PM
use MODIFY with the TRANSPORTING option. Check the online help
something like...
name1 = 'ABHI'
MODIFY TABLE ITab FROM WA TRANSPORTING name1where name2 = 'THAPAR' .
‎2010 Jan 08 4:25 PM
Hi ,
Check MODIFY statement for table with where clause.
Press F1 on Modify.
Hope this helps you.
‎2010 Jan 08 4:29 PM
use MODIFY with the TRANSPORTING option. Check the online help
something like...
name1 = 'ABHI'
MODIFY TABLE ITab FROM WA TRANSPORTING name1where name2 = 'THAPAR' .
‎2010 Jan 08 4:45 PM
‎2010 Jan 09 12:16 AM
Hi Rob,
I didn't know this, after studying online help on MODIFY itab, ABAP Statement
MODIFY itab - itab_lines
Syntax
... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
I tried
DATA:
ls_t100 TYPE t100,
lt_t100 TYPE TABLE OF t100.
SELECT * INTO TABLE lt_t100 FROM t100 UP TO 20 ROWS.
MODIFY lt_t100 FROM ls_t100 TRANSPORTING text where text <> ls_t100-text .clears field text in all rows of lt_t100.
after many years of field-symbols finally a reason to use MODIFY again
Regards,
Clemens
‎2010 Jan 11 9:09 PM
But ABAP must do an internal loop through the table to find and replace the values.
Rob
‎2010 Jan 12 11:20 AM
‎2010 Jan 08 6:11 PM
Try this out: (Here looping is used only to fille the itab and display the records)
types: begin of ty_name,
first_name(20),
last_name(20),
end of ty_name.
data: t_name type standard table of ty_name,
wa_name like line of t_name.
do 5 times.
wa_name-first_name = 'John'.
wa_name-last_name = 'Myers'.
append wa_name to t_name.
enddo.
wa_name-last_name = 'Mathew'.
MODIFY t_name FROM WA_NAME TRANSPORTING last_name
where first_name = 'John'.
clear WA_NAME.
loop at t_name into wa_name.
write:/ wa_name-first_name, ', ', wa_name-last_name.
endloop.
‎2010 Jan 08 7:34 PM
APPEND LINES OF itab1 TO itab2.
INSERT <line> INTO TABLE <itab>.
Check f1 help for this statements