We can help. Together we learn....

CL_GUI_ALV_GRID

by Voice | Wednesday, December 24, 2008 in |

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.



5 comments:

  1. Raju on February 25, 2009 at 10:21 AM

    Hey Voice,

    How can we print the page number?

     
  2. Voice on February 25, 2009 at 11:17 AM

    Use PRINT_TOP_OF_PAGE method to print the page number.

    You have to take a variable and have to manually increment it (Can be done before/after printing in the Method

    And then use PRINT_END_OF_LIST or END_OF_LIST method to clear the variable storing the page number

     
  3. Ritesh Saurabh on February 26, 2009 at 9:59 PM

    hi dude

    do u know how to make value of some of cells in a column of ALV report as BOLD ?


    hoe do u increase font size?
    any oops method ? plz explain.

     
  4. Voice on February 27, 2009 at 7:04 PM

    Ritesh
    Use LVC_S_FCAT-style for style formating and LVC_S_FCAT-EMPHASIZE for colour.

    Hope that will resolve your queries

     
  5. Unknown on November 26, 2010 at 5:19 PM

    Hi,

    Can you post a sample code?

     

Categories