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

Total in dynamic internaltable

abdulgaffarmohd
Participant
0 Likes
1,125

Hi ,

i am populating data using dynamic internal table,

data is coming properly

i can't able to total the column wise data .

how to total the column.

regards,

Mohd.

9 REPLIES 9
Read only

Former Member
0 Likes
1,093

If u are using the dynamic internal table then your data should be in field-symbols.

Use the below statements to read the data of field symbols

ASSIGN COMPONENT sy-index OF STRUCTURE <wa> TO <comp>.

now <comp> will have the value of that field and u can do whatever u want.

Read only

Former Member
0 Likes
1,093

loop at that internal table.

you can use a variable in which you keep adding the value of that field inside loop.

Read only

Former Member
0 Likes
1,093

HI ,

After filling the internal table , again loop at this internal table and use AT LAST (control statement) and make another internal table .

Thanks

Shambhu

Read only

Former Member
0 Likes
1,093

Hi ,

Use Alv to display dynamic internal table so that u have standard option for Summation.

Read only

abdulgaffarmohd
Participant
0 Likes
1,093

we dont know exactly how many columns are there in the

internaltable .

regards,

mohd.

Read only

0 Likes
1,093

hi

u can do it . if able to populate the values in dyanamic internal table you can do totals also .

use AT LAST block on which field you want to do totals .

try it will work..

cheers .

~linagnna

Read only

0 Likes
1,093

while looping through the dynamic internal table it is considering as charcter value fields also .

regards,

mohd.

Read only

0 Likes
1,093

<table> is dynamic internal table for totals i declare one more dynamic internal table <table1>.

In which month is an month value that is 2009.01,2009.02.2009.03....,

for calculating the every column total so i am clearing month value ..,

but everytime it is appending one more row to <table1> table .

b'coz it is considering all the fields as character fields ..

LOOP AT <TABLE> inTO <STRUC>.

ASSIGN COMPONENT 'MONTH' OF STRUCTURE <STRUC> TO <FIELD>.

<FIELD> = IFINAL1-WEEK4.

clear: <FIELD>.

collect <struc> into <table1>.

ENDLOOP.

in fieldcatalog i am passing these values..,

IS_LVC_CAT-TABNAME = 'IFINAL'.

CONCATENATE IFINALT-VKGRP IFINALC-ZCARD INTO IS_LVC_CAT-FIELDNAME.

IS_LVC_CAT-SELTEXT = IS_LVC_CAT-FIELDNAME.

IS_LVC_CAT-OUTPUTLEN = 18.

IS_LVC_CAT-CURRENCY = 'WAERK'.

IS_LVC_CAT-CFIELDNAME = IS_LVC_CAT-FIELDNAME.

need to pass any othere values also.

regards,

mohd.

Edited by: abdul gaffar on Jul 2, 2009 12:15 PM

Read only

abdulgaffarmohd
Participant
0 Likes
1,093

self