Application Development 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: 

CL_GUI_ALV_GRID, PRINT_TOP_OF_PAGE How to print content of 1. row of page

Former Member
0 Kudos

I use CL_GUI_ALV_GRID with method set_table_for_first_display and implemented an event handler with handle_top_of_page.

Does anybody know how to write something dependend on the contend of the first row on each page as headline in the event PRINT_TOP_OF_PAGE?

For example: Page1 Row1 Matnr=5 I want to write: 'Five' as heading of page1. Page2 Row1 Matnr=21 I want to write 'twentyone'. The problem is, that I don't have access to the data, that will be printed in the first row on each page and I can't calculte somthing like a cursor position because there can be several rows of subtotals and units.

I'm a little bit desperate and start to beleave that there is no way to access the data of the first row.

If somebody has an working idea, this would be a breakthrough and help me a lot.

Hope to hear something from the experts.

Guenter

1 ACCEPTED SOLUTION

ssimsekler
Active Contributor
0 Kudos

Hi Gunther

What does your sceanrio say if the user makes a sorting or filtering on the list? It seems a bit problematic or you ought to put some more rules.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

4 REPLIES 4

ssimsekler
Active Contributor
0 Kudos

Hi Gunther

What does your sceanrio say if the user makes a sorting or filtering on the list? It seems a bit problematic or you ought to put some more rules.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

0 Kudos

Hi Serdar,

You are right. The forgott to mention, that in our case the user is not allowed to manipulate the list by filtering, sorting ore changing layout.

But I still have the problem to access the data of the first row on each page. I already WRITE the sy-pagno to the top of each page when the event PRINT_TOP_OF_PAGE starts. But how can I access data of the first row in this event?

0 Kudos

Hi Guenter

What you require seems so difficult to get. The first row of each page can not be determined so easily. It will depend on the list size and list length. The page number may be found but the first row for each page needs some more estimation which seems to me impossible. Nevertheless, I generally think that "There is nothing impossible".

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Former Member
0 Kudos

Hi,

Check this sample program.

http://www.geocities.com/victorav15/sapr3/utilities/zvvooa_alv5.txt

Also see http://help.sap.com/saphelp_nw04/helpdata/en/ee/c8e06ed52611d2b468006094192fe3/frameset.htm

Thanks & Regards,

Judith.

Message was edited by: Judith Jessie Selvi