This may sound silly or obvious but this is my case; I work at a company that recently implemented SAP and I was the responsible to generate/migrate the master data of the company which let me learn a lot from this system. SAP comes with its own language known as ABAP and since the system went live I've been learning and programming with it. Before ABAP I worked as a freelancer in other projects with VB6, VB.Net, C# and ASP.Net building a lot of stuff, here I've made some utilities that are been using daily, so I came with long experience in programming. At first ABAP was difficult but eventually after long analysis, googling and trial and error I became the guy who makes basically all the development in SAP from reports, to user-exits, enhancements, BADIs, tables, dynpros, etc. Daily I learn more and more because of all the requests I receive which makes me investigate and code a lot everyday. It has become challenging and funny at the same time. You could be very productive in ABAP once you get into.Ok, the question is - can I post how I resolved a certain thing in SAP? That implies that I'd publish production code. I feel doubtful about this.
Is it legal/ethical to post production code?
legal;ethics
I would say that it is clearly wrong to publish code you have written as part of your contract with your employer.  That code is owned by your employer and you probably don't have either the legal or the ethical right to publish it.Publishing knowledge you've gained as part of your employment is a much greyer area.  Broadly I would suggest that;If it's knowledge you've learnt for yourself, not relating to proprietary systems, then it's probably okay to write a code snippet from scratch and publish that.If it's knowledge you could only have gained by working for your employer than you probably should not publish it.If it's knowledge relating to proprietary company systems then you should not publish it.Bottom line is that if you are concerned then talk to your management and get their, preferably written, consent before you do so.