‎2006 Oct 10 9:34 AM
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 years 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
‎2006 Oct 10 1:14 PM
what do you think about using a cursor in this case ?
good or bad idea ?
Marc