by default the Print Version button will be displayed on ALV. you may want to refer the code in method WDDOINIT method of standard application WDT_ALV.
regarding using this button - Once the Print Version button is displayed then click it. if everything is fine then you will be able to see PDF else error message will be displayed along with Display Help link. Just click it and follow the instuctions as per it.
It says, Note 918236 contains detailed information.
I hope this is useful for you.