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: 

format

Former Member
0 Kudos

hi guyz,

i have itab1 with negative values init

for eg: -1 -2

and im moving those values to itab2 of same structure and this values changing as 1- 2-

plz advise..

thanks

3 REPLIES 3

Former Member
0 Kudos

Hi,

The format for representing the negative values will be 2- and 3- only.

Check how you are populating the data into internal table itab1? What is the data type used for that?

Check whether the same data type is being used for the internal table itab1 and itab2 for refering to the fields.

Former Member
0 Kudos

Hi,

The data type might be different .

Check the data type.

Regards,

Nandha.

bpawanchand
Active Contributor
0 Kudos

Hi

If both the internal table have same field name then try to assign the values

t_tab2[] = t_tab1[].

check this Sample Snippet

DATA :
   BEGIN OF fs_tab,
     a TYPE i,
     b TYPE i,
   END OF fs_tab.

DATA :
   t_tab1 LIKE
 STANDARD TABLE
       OF fs_tab,

   t_tab2 LIKE
 STANDARD TABLE
       OF fs_tab.


DO 10 TIMES.

  fs_tab-a  = -1 * sy-index.
  fs_tab-b  = fs_tab-a * sy-index.

  APPEND fs_tab TO t_tab1.

ENDDO.



loop at t_tab1 into fs_tab.

write :
  / fs_tab-a , fs_tab-b.

endloop.


t_tab2[] = t_tab1[].

skip 5.

loop at t_tab2 into fs_tab.

write :
  / fs_tab-a , fs_tab-b.

endloop.

Regards

Pavan