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

Group By

Former Member
0 Likes
749

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
Read only

Former Member
0 Likes
721

Sort and use AT NEW.

Rob

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?

4 REPLIES 4
Read only

Former Member
0 Likes
722

Sort and use AT NEW.

Rob

Read only

Former Member
0 Likes
721

I have used "Collect". This works fine

Read only

0 Likes
721

ON CHANGE OF will also work.

Rob

Read only

Former Member
0 Likes
721

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