Skip to Content
0
Former Member
Apr 30, 2009 at 07:35 AM

Dynamic header and footer for ALV_LIST

37 Views

Hi all,

I m using FM REUSE_ALV_LIST_DISPLAY to display my report.

My requirements are as follows:

1. Display the header for every new key/sorted value

2. Display the footer at the end of the key/sorted value

3. Display a subtotal for numeric columns based on each key value

4. Page break at the change to a new key/sorted value

(based on sample data below, the key/sorted value is the Vendor code)

Appreciate if anyone can provide any sample codes to meet the above requirements.

Internal table Data:

Vendor Date Amount

1001 10.04.2009 1000

1001 11.04.2009 1500

2001 08.04.2009 800

2001 13.04.2009 1200

2001 15.04.2009 1000

3001 01.04.2009 500

3001 02.04.2009 700

ALV List output:

Header: Vendor: 1001

Vendor Date Amount

1001 10.04.2009 1000

1001 11.04.2009 1500

  • Subtotal 2500

Footer:

This is end of list for vendor 1001

-


Page break

Header: Vendor: 2001

Vendor Date Amount

2001 08.04.2009 800

2001 13.04.2009 1200

2001 15.04.2009 1000

  • Subtotal 3000

Footer:

This is end of list for vendor 2001

-


Page break

Header: Vendor: 3001

Vendor Date Amount

3001 01.04.2009 500

3001 02.04.2009 700

  • Subtotal 1200

Footer:

This is end of list for vendor 3001