Can anyone help me out regarding A standard code for importing data from SAP SYSTEM TO EXCEL using VBA. I use SE16 transaction and a table named .I need to import data from TFACS table to excel using vba.
            Asked
            
        
        
            Active
            
        
            Viewed 1,947 times
        
    -1
            
            
        - 
                    possible duplicate of [VBA pulling data from SAP for dummies](http://stackoverflow.com/questions/19452461/vba-pulling-data-from-sap-for-dummies) – eirikdaude Mar 25 '15 at 12:28
- 
                    Actually my company have disabled the record option in the sap system.I want solution without dummies. – Yashwanth Inti Mar 25 '15 at 12:58
- 
                    Thanks for your reply,I need to automate the process,its a manual process,with a click in excel the data need to be refreshed in the excel from SAP system using vba.I need the code for it @eirikdaude – Yashwanth Inti Mar 25 '15 at 13:04
1 Answers
0
            
            
        If you have access to SE16n you can export directly from there to csv or text file. You can also get with IT to create a nightly spool that will dump a text file into a folder and then link directly to that file with excel.
 
    
    
        jbay
        
- 126
- 9
- 
                    Hello ,Thanks for your reply,I need to automate the process,its a manual process,with a click in excel the data need to be refreshed in the excel from SAP system using vba.I need the code for it – Yashwanth Inti Mar 25 '15 at 12:59
- 
                    Are you currently able to connect directly to a server? You can create a text file and save as foo.udl then close the file and open it to get your server connection info. Then write something like the below: Public Function ObjectConnect(AID As String, APswd As String) ObjectConnect = "Provider=MSDASQL.9;Password=" & APswd & ";Persist Security Info=False;User ID=" & AID & ";Data Source=ServerName" End Function – jbay Mar 25 '15 at 13:40
- 
                    Otherwise if you cannot connect directly to the server then you need to get IT to create a nightly extract for you. As I mentioned you can use this extract to automate in excel. Do something like: Private Sub Workbook_Open() QueryTable.Refresh BackgroundQuery:=False end sub – jbay Mar 25 '15 at 13:43
 
    