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

Conversion and aggregate datas from large table

Former Member
0 Likes
260

Hello,

I have to make a report reading aggregate datas from MSEG linked as an

inner join with MBEW. Some fields have to be convert with conditions.

In a first time, I thought select datas from mseg and create an internal

table with basic operations and conversions.Then, I thought aggregate datas

on another internal table target.

But MSEG is a very large table, for example selecting year’s 2006 there

is more than 6 millions of rows.

In your opinion, what is the best statement to minimise the number of datas

transfers ? (An example of code will be very appreciated).

Thanks and regards

Marc

Selection__________________________Operation

Material______________mseg-matnr___Group by

Plant_________________mseg-werks___Group by

Storage location______mseg-lgort___Group by

Special stock_________mseg-sobkz___Group by

Code valuation________mseg-kzbws___Group by

Supplier______________mseg-emlif___Group by

Order Number__________mseg-aufnr___If bwart = '101' => Type Order = 'S'

Movement type_________mseg-bwart___Group by

Posting date__________mkpf-budat___Group by month and year

Debit/credit__________mseg-shkzg

Quantity______________mseg-menge___If shkzg ='H' => Sum( -1 * menge ) Else Sum( menge )

Standard price________mbew-vmstp

1 REPLY 1
Read only

Former Member
0 Likes
231

what do you think about using a cursor in this case ?

good or bad idea ?

Marc