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

Smartfrom Material Code and Quantity Addition

Former Member
0 Likes
621

Hi Experts,

I am Developed one Smartforms .

Output of the samarforms is below.

PRODUCT QUANTITY

TM500 100

TM500 100

TM250 100

TM200 55

TM250 100

BUT i want the output like

PRODUCT QAUNTITY

TM500 200

TM250 200

TM200 55

Please help me.

TM500,TM250 and TM200 are material codes.

Thanks in advance

purnaneelu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
596

Hi,

How are you displaying the data?

Are you making use of any table to display the data?

What you do is before displaying the data via the table add a program lines node.

In that collect the data from your internal table into a new internal table. This will calculate the sum and then you can display the data.

Code as folllows

Considering your ITAB1 is as follows

Product Quantity

Create one more internal table ITAB2 of the same structure and calculate the sum as follows


 LOOP AT ITAB1 into WA1.
MOVE:  WA1-PRODUCT to WA2-PRODUCT,
             WA1-QUANTITY to WA2-QUANTITY.
COLLECT WA2 into ITAB2.
ENDLOOP.          

Then make use of a table to display the data using ITAB2 in your smartforms.

Hope this helps you.

Regards,

Ankur Parab

4 REPLIES 4
Read only

Former Member
0 Likes
597

Hi,

How are you displaying the data?

Are you making use of any table to display the data?

What you do is before displaying the data via the table add a program lines node.

In that collect the data from your internal table into a new internal table. This will calculate the sum and then you can display the data.

Code as folllows

Considering your ITAB1 is as follows

Product Quantity

Create one more internal table ITAB2 of the same structure and calculate the sum as follows


 LOOP AT ITAB1 into WA1.
MOVE:  WA1-PRODUCT to WA2-PRODUCT,
             WA1-QUANTITY to WA2-QUANTITY.
COLLECT WA2 into ITAB2.
ENDLOOP.          

Then make use of a table to display the data using ITAB2 in your smartforms.

Hope this helps you.

Regards,

Ankur Parab

Read only

0 Likes
596

Thank you very much probelm is solved.

And more probelm for me here i need to generate one system generate number .

And display in smartforms

Means this form is delivery challan form

i need to give one dc no in the output.

like DC No : 12345

Pls help me

Thanks in Advance

purnaneelu

Read only

0 Likes
596

Thank you very much probelm is solved.

And more probelm for me here i need to generate one system generate number .

And display in smartforms

Means this form is delivery challan form

i need to give one dc no in the output.

like DC No : 12345

Pls help me

Thanks in Advance

purnaneelu

Read only

Former Member
0 Likes
596

HI ,

Please use Ankur Suggestion.it will work