Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem related to AT statement

hi gurus,

My internal table contain combination of ITEM, MATNR AND VAT data,

So i want total of vat for each unique combination of ITEM and MATNR together.

how it is possible please help me on this.

thanx,

manish.

Former Member
Former Member replied

Hi Manish,

Is it possible to maintain different number of MATNR for same Items?

anyway You may use 'on change of' Keyword for your scenario.

read table it_table index 1 into wa.

temp_item = wa-item.

loop at it_table into wa.

on change of wa-MATNR.

if wa-item = temp_item.

vat_sum = wa-vat + vat_sum.

add 1 to count.

elseif count = 1. " if Unique MATNR exist

clear: vat_sum,count.

temp_item = wa-item.

add 1 to count.

else." if multiple MATNR exist

clear: vat_sum,count.

temp_item = wa-item.

add 1 to count.

endif.

endon.

endloop.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question