How can we interact with other databases instead of native SAP databases like Oracle SQLserver or MS Access? Please give me the code.
Your question seems to be asking me to supply code that allows you to make native database calls to SAP using SQL or some other high level database language. Please do not attempt to do this. SAP has very stringent restrictions about how data which resides within R/3 should be accessed. Rather than attempting to call the database directly, you must retrieve data using SAP prescribed RFCs and BAPIs. Check out this tip for a code example on calling and retrieving data from SAP.
This was first published in May 2002