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

Adding quantity

Former Member
0 Likes
2,102

HI Friends,

I have an internal table it_send and has many char and NUM fields....

It has Material no, Quantity, origin, Destination....

I have to send this internal table to an external system to get the Freight Rate, But i have to send only one line because external system cant read more than one line.

For multiple materials i have to sum quantities of all the materials and send it to the external system with the first material no in my IT_SEND.

I am having problems with it. Any advice will be of great help to me.

Shejal.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,734

Hi Shejal,

It makes no sense to add quantities of different materials possibly having different units of measures.

YOu have to call whatever rfc function module multiple times within a loop to pass each record at a time, or make the other system capable of recieving a table data.

Regards,

Ravi

9 REPLIES 9
Read only

Former Member
0 Likes
1,734

hi,

do this.

wa_temp.

loop at itab.

wa_temp-quantity = wa_temp-quantity + itab-quantity.

Endloop.

read table itab index 1.

wa_temp-material = itab-material.

send wa_temp.

Read only

0 Likes
1,734

Manoj,

I cant send the WA i have to send the it_send.

Shejal.

Read only

0 Likes
1,734

Hi Shejal,

I don't understand what your exact requirement is but in that case, you can append the work area to the itab after refreshing the itab.

loop at itab.

wa-qty = itab-qty + wa_qty.

endloop.

refresh itab.

append wa to itab.

Regards,

Ravi

Read only

Former Member
0 Likes
1,735

Hi Shejal,

It makes no sense to add quantities of different materials possibly having different units of measures.

YOu have to call whatever rfc function module multiple times within a loop to pass each record at a time, or make the other system capable of recieving a table data.

Regards,

Ravi

Read only

0 Likes
1,734

I am converting all the unit of measure to the same units. Hence want to add the fields.

Shejal.

Read only

0 Likes
1,734

if u want the total quatity u can refer above post.

But u r populating first material number with the quantity isnt conflicting. ( material and quantity)

<b>as per the ned do this

it_send2.

append wa_temp to it_send2.</b>

Message was edited by: Manoj Gupta

Read only

0 Likes
1,734

Yaa its conflicting i agree but the materials have almost the same properties hence have decided to send the first material NO and the sum of all the materials quantity.

Shejal.

Read only

0 Likes
1,734

hi,

Refer the post above ( which i have given )

i think this should solve ur problem.

Read only

0 Likes
1,734

Thanks,

I got it.

Shejal.