Application Development 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: 

Group By

Former Member
0 Kudos
121

I have an internal table that needs to be processed in a way that is

similar to a select statement with a "where" and "group by" condition, like:

SELECT objid gjahr accrule acrtype effdate INTO CORRESPONDING FIELDS OF

TABLE parent_class->acepsoit_table_ FROM acepsoit

WHERE bukrs IN parent_class->company_code_range

AND acrtype IN parent_class->accrual_type_range

AND accrule IN parent_class->acct_principle_range

AND effdate IN parent_class->key_date_range

AND poyear IN parent_class->fiscal_yr_range

GROUP BY effdate objid gjahr accrule acrtype.

Is it possible to duplicate the "group by" functionality in a loop?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
93

Sort and use AT NEW.

Rob

4 REPLIES 4

Former Member
0 Kudos
94

Sort and use AT NEW.

Rob

Former Member
0 Kudos
93

I have used "Collect". This works fine

0 Kudos
93

ON CHANGE OF will also work.

Rob

ferry_lianto
Active Contributor
0 Kudos
93

Hi,

I don't think it is possible to duplicate the "group by" functionality in a loop.

Perhaps you can use sort and control break statement within the loop.

Regards,

Ferry Lianto