If we want to create a custom connector to connect SAP data from SharePoint 2010 ... how to do that? what steps are involved?
why create a custom connector when you have Duet Enterprise created by SAP and Microsoft?
Creating a connector is pretty straight forward. You have a project type in Visual Studio, Busines Data Connectivity Model under SharePoint 2010 project group, and good tutorials on MSDN, but since accessing SAP through BAPI must be done in the right way, both in terms of licensing and performance, whrer you risk shooting yourself in the foot in several ways, I would strongly recommend using Duet Enterprise that was created by SAP and MS developers who hopefully knew what they were doing:)
Exposing SAP content in SharePoint is not straight forward if the content is protected using SAP proprietary permissions. We have analyzed requirements for indexing SAP content using SharePoint 2013, and concluded that effort required in both SP and SAP would not give enough value for the money, poor ROI. You would need custom BAPIs and logic, depending on how you have structured your SAP content using hierarchy and DIR characteristics.
I recommended a thorough analysis of effort, benefit, maintainability, information security and more. Connecting to open/public info in SAP may be much simpler.