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

at new

Former Member
0 Likes
728

Hello,

I am using At new field1.

I want to transfer field1 & field2 field3 to other itab along with field1.

But when i wrote this code it just transfer field1 not other fields along with field1.

At new field1.

move field1 to itab

move field2 to itab

............

endat.

can u help me for that.

Thanks.

Hello,

I am using At new field1.

I want to transfer field1 & field2 field3 to other itab along with field1.

But when i wrote this code it just transfer field1 not other fields along with field1.

At new field1.

move field1 to itab

move field2 to itab

............

endat.

can u help me for that.

Thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
710

hi,

Do like this:

move field1 to itab-fld1.

move field2 to itab-fld2.

Regards

Subramanian

Read only

Former Member
Read only

Former Member
0 Likes
710

This will only work if field 2 and 3 are to the left of field 1 in the structure.

Regards,

John.

Read only

Former Member
0 Likes
710

hiiii

i had the same problem.

if you are moving fields to another internal table then use following code..it will solve your problem.

DATA:
    lw_werks TYPE mard-werks.


  SORT i_output BY matnr.
  LOOP AT i_output INTO wa_output.
    wa_output2-matnr = ' '.
    wa_output2-werks = wa_output-werks.
    wa_output2-prctr = wa_output-prctr.


    AT NEW matnr.
      wa_output2-matnr = wa_output-matnr.
    ENDAT.                             " AT NEW matnr

    lw_srecid = lw_srecid + 1.
    wa_output2-srecid = lw_srecid.
    APPEND wa_output2 TO i_output2.
    CLEAR wa_output.
  ENDLOOP.                             " LOOP AT i_output

reward if useful

thx

twinkal

Edited by: twinkal patel on Jun 19, 2008 4:46 PM

Read only

Former Member
0 Likes
710

U need to read the table inside at new ...

loop at itab1.

At new field1.

read table itab1 index sy-tabix.

move field1 to itab

move field2 to itab

............

endat.

endloop.