What Marra said!
If you get scanned and fined this will affect your rep, not massively though I'm unsure your rep is affected more or less depending upon the size of the fine.
You are definitely less likely to be scanned and fined if you are on good terms with the faction controlling the station. I can't remember the last time I got scanned by a station I was allied with.
Also, i case you were unaware, always go into the hangar on outposts if you're carrying illicit cargo as occasionally a security ship will turn up and scan you - if you've taken the opportunity for a comfort break or to make a coffee that can really sting when you get back and only discover the fine 30 minutes later (after leaving the station that you now need to travel 150000ls back to to pay off the fine)