Application Development 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: 

Problem in using At new

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

12 REPLIES 12

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi Dilip,

Use read table statement to avoid the same ..

Regards,

Santosh

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

But I want the unchanged value.

0 Kudos

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???

0 Kudos

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.

0 Kudos
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

0 Kudos

Thanks a lot Chandrasekhar. My problem is solved.

0 Kudos

Please reward and close the thread if ur problem is completely solved

Former Member
0 Kudos

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

0 Kudos

Hi Sruthi,

in this way i can get the changed value after trigerring at new how to captured the previous or unchanged data.