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

Former Member
0 Likes
1,452

hi,

data:num1 type num.

num type c.

loop at int_final.

int_final1-matnr = int_final-matnr.

int_final1-vkorg = int_final-vkorg.

int_final1-num1 = int_final-num.

collect int_final1 into int_final1.

endloop.

this case y this collect is not working.

vkr.

hi,

data:num1 type num.

num type c.

loop at int_final.

int_final1-matnr = int_final-matnr.

int_final1-vkorg = int_final-vkorg.

int_final1-num1 = int_final-num.

collect int_final1 into int_final1.

endloop.

this case y this collect is not working.

vkr.

10 REPLIES 10
Read only

former_member189629
Active Contributor
0 Likes
1,428

collect int_final1 into int_final.

Message was edited by:

Karthik

Read only

Former Member
0 Likes
1,428

it seems to me num is a number field but you declare as character type so it is not adding when it is getting repeating value of matnr and vkorg .

declare num as type i or type p it will work (except type C,N,D,T,X).

regards

shiba dutta

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,428

it should not be

collect int_final1 into <b>int_final1.</b>

it should be

collect int_final1 into <b>int_final.</b>

Read only

Former Member
0 Likes
1,428

Hi,

see the code

loop at int_final.
int_final1-matnr = int_final-matnr.
int_final1-vkorg = int_final-vkorg.
int_final1-num1 = int_final-num.
collect int_final1 .   " No need to write collect int_final1 into int_final1.
endloop.

Regards

Sudheer

Read only

Former Member
0 Likes
1,428

hi,

you should use the collect statement seperate seperate fields according with some keys....

we cannot collct all the fields...

try with seperately....

thanks,

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

former_member404244
Active Contributor
0 Likes
1,428

Hi,

declare num as type i .It will work.also try like this

loop at int_final.

int_final1-matnr = int_final-matnr.

int_final1-vkorg = int_final-vkorg.

int_final1-num1 = int_final-num.

collect int_final1 .

endloop.

Regards,

Nagaraj

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,428

u r looping at int_final and y r u using int_final1 inside?

what is int_final1 ? is it work are? then ur loop should like below

<b>loo at int_final into int_final1.</b>

and collect as i mentioned above.

if there is no work area and the itab is with header line.

then

change all int_final1 to int_final

and write <b>collect int_final.</b>

Read only

Former Member
0 Likes
1,428

Hi,

In your case 'NUM' and 'NUM1' should be declared as an interger vairable (either type 'I' or 'P').

COLLECT: will add the numeric fields for the same character field values.

For more information on Collect , see the F1 help..

Hope this helps you.

Regards,

Dilli

Read only

0 Likes
1,428

hi

you should declare as an interger vairable (either type 'I' or 'P'). after that write the code as:

loop at int_final.

int_final1-matnr = int_final-matnr.

int_final1-vkorg = int_final-vkorg.

int_final1-num1 = int_final-num.

collect int_final1 .

endloop.

regards,

praveen.

Read only

Former Member
0 Likes
1,428

hi vkr,

you are collecting int_final1 into again int_final1 , that is not correct .

So write the code as,

loop at int_final.

int_final1-matnr = int_final-matnr.

int_final1-vkorg = int_final-vkorg.

int_final1-num1 = int_final-num.

collect int_final1 .

endloop.

<b>please reward points if helpfull</b>

with regards,

radhika kolluru.