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

collect problem

Former Member
0 Likes
557

Hi guys,

I have this data below for my itab:

type numc type c type c type p

90001 cca cca 1000

90002 cca cca 2000

cca cca 1000

90002 cca cca 3000

cca cca 2000

then i collect here: collect itab.

my new data for itab is this:

type numc type c type c type p

90001 cca cca 1000

90002 cca cca 5000

cca cca 1000

cca cca 2000

My expected output should be :

type numc type c type c type p

90001 cca cca 1000

90002 cca cca 5000

cca cca 3000

why is it that when the first entry is blank, the collect seem not to work...?

thanks!

rgds,

mark

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
529

i think u hv to close this thread or u hv any probelm just post.

3 REPLIES 3
Read only

Former Member
0 Likes
529

go throuth code , i did same wht u want , at the end see output. its coming correct only.

run this code.

data: begin of it_out occurs 0,

a type n,

b(3) type c,

c(3) type c,

d type p,

end of it_out.

it_out-a = 90001.

it_out-b = 'cca'.

it_out-c = 'cca'.

it_out-d = 1000.

collect it_out.

it_out-a = 90002.

it_out-b = 'cca'.

it_out-c = 'cca'.

it_out-d = 2000.

collect it_out.

clear it_out.

it_out-b = 'cca'.

it_out-c = 'cca'.

it_out-d = 1000.

collect it_out.

it_out-a = 9002.

it_out-b = 'cca'.

it_out-c = 'cca'.

it_out-d = 3000.

collect it_out.

clear it_out.

it_out-b = 'cca'.

it_out-c = 'cca'.

it_out-d = 2000.

collect it_out.

loop at it_out.

write:/ it_out-a, it_out-b, it_out-c , it_out-d.

endloop.

Read only

Former Member
0 Likes
529

Hey,

U can use like wise............

LOOP AT ITAB.

AT END OF...........

SUM <FLD3>

WRITE.............

ENDAT

ENDLOOP.

Try yhis out. it will help u

Reward all helpful answers,

Thanks

Read only

Former Member
0 Likes
530

i think u hv to close this thread or u hv any probelm just post.