We can help. Together we learn....

CL_GUI_ALV_GRID

by Voice | Wednesday, December 24, 2008 in | comments (5)

I was writing a program for ALV Grid after a long time. I was using CL_GUI_ALV_GRID class for the required ALV display and I encountered some problems. I tried to consult with my friends and finally we did it but it took a lot of experimentation and time and also I came to know a lot of things about CL_GUI_ALV_GRID and thought it is worth sharing.

First and foremost, never make unnecessary custom screens and containers it is not totally unavoidable. Custom screens with containers look pretty but it causes a unique problem which is hard to conceive. Have a look.. 


This is normal display. I used a custom screen with container to show the ALV Grid. Click on Customize Local Layout (Alt+F12) and then Font and increase the font size.

Depending on your monitor size and resolution at some point you will see that scroll bars are gone. Something like this will happen

Actually the custom window has got magnified and the scroll bars are out of monitor size. This problem will not happen if you use the default screen for report display.

 

Now if you want to add a header you can use TOP-OF-PAGE event which I am sure most of you use. Now if you try printing the ALV grid display, all you will get is the ALV display only and no header in the print out.

If you want print out you have to add another Event, PRINT_TOP_OF_PAGE. What ever you will write here will get printed.

 

Then also you will face problems for printing the page number. Please write to me in the comment section if you want to know how, I don’t want to make this post any longer

Please let me know if any of you want the code or some other information. Reason is same… I don’t want to increase the size of the post.



Categories