cancel
Showing results for 
Search instead for 
Did you mean: 

Optimizing the Code GROUP BY in loop

karthik_sub
Participant
0 Kudos
173

Hi Experts,

Can i know an alternate way of using the below code which was existing already in the system.

We observed that this statement causes the performance issues.

Kindly guide me the same. Thanks.

      LOOP AT lt_sa_from_init_screen ASSIGNING FIELD-SYMBOL(<sa>)
        GROUP BY (  vkorg <sa>-vkorg
                    vtweg <sa>-vtweg )
        WITHOUT MEMBERS ASSIGNING FIELD-SYMBOL(<sa_group>).
        INSERT VALUE mdg_ecc_bp_vkorg_vtweg_key(
          vkorg <sa_group>-vkorg
          vtweg <sa_group>-vtweg INTO TABLE lt_sales_keys.
      ENDLOOP.

 

Regards,

Karthik s

 

 

Accepted Solutions (0)

Answers (0)