Find SAP IDoc linked function module
find function module linked to inbound idoc
For inbound IDoc's finding the linked function modules is very easy, simply execute tcode @WE19, enter an existing IDoc or idoc message type and press execute.
on the resulting page double click on the top partner details line and it will show you detail including message type and default linked FM
or go to the standard inbound to get the default FM or use inbound function module to access a drop down list that will show you all the possible function modules that are available for this IDoc message type.
Find outbound function modul
For Outbound IDoc's its a bit different and you can't view the linked FM via @WE19 but you can still get the Messaage type as shown in the image above. Then you check tcode @WE57 which has the link between the function module and IDoc Message type / Basic type.
If it's not maintained in here it could be linked to a process code (via an output type), the easiest way to find out if this is the case would be to check in partner profile tcode @WE20. Choose the relevant outbound message, via the message control tab and get the process code, then use @we41 to see which function module the process code is assigned too. You can also double click on the process code within @WE20
If still no joy it checkout the document output configuration, which is maintained in tcode @NACE.