Hi Dileep - You mentioned that your scenario is JDBC - IDOC and you are talking about the function module?
Can you please explain what function module has got to do with your scenario?
What that function module should do? and if you need any help with ABAP development post it in the relevant forum as this is not the right place.
However for sample FM you can refer to - Creating Function Modules (SAP Library - ABAP Programming (BC-ABA))