02-08-2007 10:56 AM
Hi Experts,
When at new is triggered, the data of the right side field is also changed to * or 0.
But I want to pass the data(unchanged data) of that row on which the at new is fired to another internal table.I can't use on change of. Please help.
02-08-2007 11:02 AM
To avoid that you can use work areas or use read table statement
loop at itab.
at new field1.
read table itab index sy-tabix.
endat.
endloop.
OR
loop at itab into wa_itab.
at new field1.
*you can use the workarea here
endat.
endloop.
02-08-2007 10:57 AM
declare a flag.
data: g_fl type c.
loop at itab.
at new.
g_fl = 'X'.
endat.
if g_fl = 'X'.
move.
clear g_fl.
endif.
endloop.
02-08-2007 10:58 AM
hi Dilip,
Use read table statement to avoid the same ..
Regards,
Santosh
02-08-2007 11:00 AM
data: wa_temp like line of itab.
Loop at itab into wa_itab.
here copy data from wa_tab to wa_temp
at new.
move the data from wa_temp to ur desired internal table
clear wa_temp.
endat.
endloop.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
02-08-2007 11:02 AM
To avoid that you can use work areas or use read table statement
loop at itab.
at new field1.
read table itab index sy-tabix.
endat.
endloop.
OR
loop at itab into wa_itab.
at new field1.
*you can use the workarea here
endat.
endloop.
02-08-2007 11:06 AM
02-08-2007 11:15 AM
loop at itab.
at new field1.
read table itab index sy-tabix.
endat.
move-corresponding itab to itab1. "declare itab1 same as itab
append itab1.
endloop.
now ur itab1 will contain all the unchanged values
Is this what you are looking for???
02-08-2007 11:29 AM
Hi Chandrasekhar,
Thanks for your reply.This is what I have done but the itab to which I am passing the data contains all the records.
Regards,
Dillip.
02-08-2007 11:32 AM
Oh sorry..
look at this
data : flag(1).
loop at itab.
<b>clear flag.</b> " Clear the flag here
at new field1.
read table itab index sy-tabix.
flag = 'X'.
endat.
if flag ne 'X'.
move-corresponding itab to itab1. "declare itab1 same as itab
append itab1.
endif.
endloop.
Message was edited by:
Chandrasekhar Jagarlamudi
02-09-2007 10:58 AM
02-09-2007 11:05 AM
Please reward and close the thread if ur problem is completely solved
02-08-2007 11:37 AM
Hi,
u can use the following code to pass the the data(unchanged data) of that row on which the at new is fired to another internal table.
loop at <internal table>.
at new <field>.
read table <internal tbale> index sy-tabix.
if sy-subrc eq 0.
move-corresponding <internal table> to <internal table1>.
append <internal table1>.
clear: <internal table1>, <internal table>.
endif.
endat.
endloop.
Here <internal table1> and <internal table> should be of same type.
Hope this helps.
Regards,
Sruthi
02-08-2007 11:47 AM
Hi Sruthi,
in this way i can get the changed value after trigerring at new how to captured the previous or unchanged data.