Skip to Content
0
Oct 24, 2019 at 02:52 PM

Doubt in abap report program.

116 Views

Can any one help me to Build a best logic for my internal table data to my output as i mentioned in PICTURE.

I have done it by using grouping concept it is working fine but i want to minimize the logic and increase the performance.

In the below picture there is an internal table and I want the output as in the picture.

And Don't forget to include commas please.

************************************************************************************

LOOP AT it_manufacture INTO lw_manufacture GROUP BY lw_manufacture-name.
WRITE :/ lw_manufacture-name.
LOOP AT GROUP lw_manufacture INTO lw_manufacture_group.
IF lv_var EQ 1.
CONCATENATE ':' lw_manufacture_group-description INTO lv_str.
WRITE lv_str.
ELSE.
lv_str = lw_manufacture_group-description.
CONCATENATE ',' lv_str INTO lv_str.
WRITE lv_str.
ENDIF.
lv_var = lv_var + 1.
ENDLOOP.
CLEAR lv_var.
lv_var = 1.
ENDLOOP.

Attachments

sap.png (4.1 kB)