Skip to Content
0
Former Member
Jul 13, 2009 at 04:20 PM

How to transpose data matrix ?

32 Views

Dear all,

I am having difficulty of designing a report, please help.

Basically, I have created a query to get the results like below.

ItemCode | Qty | ItemGroup | Costs

ABC001 | 1 | G001 | 10.00

ABC001 | 1 | G002 | 5.00

ABA001 | 1 | G003 | 8.00

ABC002 | 5 | G001 | 20.00

ABC002 | 5 | G003 | 10.00

ABC002 | 5 | G005 | 25.00

ABC002 | 5 | G007 | 18.00

ABC003 | 2 | G002 | 20.00

ABC003 | 2 | G004 | 10.00

ABC003 | 2 | G006 | 15.00

However, I would like to have a report to show the data like that

ItemCode | Qty | G001 | G002 | G003 | G004 | G005 | G006 | etc.....

ABC001 | 1 | 10.00 | 5.00 | 8.00 | 0.00 | 0.00 | 0.00 |

ABC002 | 5 | 20.00 | 0.00 | 10.00 | 0.00 | 25.00 | 0.00 |

ABC003 | 2 | 0.00 | 20.00 | 0.00 | 10.00 | 0.00 | 15.00 |

Hope this makes sense.

I know I could export the data to Excel to do some sort of programming, but can we have this done within SAP? (because I have some good reasons)

Many thanks

Yang