Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP Data Transfer to Excel using Transaction Code

Hello,

I am trying to retrieve data from a transaction code in SAP using VBA in MS Excel. I understand that there is one way of doing this using SAP GUI scripting but is there another way using Remote Function Calls?

I was looking at RFC_CALL_TRANSACTION and RFC_CALL_TRANSACTION_USING. Does this accomplish what I need? For example, I have a transaction code called "TCODE" and I need to pass some arguments in such as a date range to generate data. Can I use RFC's or should I stick to GUI scripting?

So far, I can connect to SAP and retrieve specific table information but how can I execute a transaction code while passing in parameters.

Set obSAPFnCntrl = CreateObject("SAP.Functions")

Set obSAPConn = obSAPFnCntrl.Connection

With obSAPConn

  .System = "system"

  .User = "user"

  .Password = ""

  .Language = "EN"

  .Client = 750

End With

Set obSAPFnUserDetail = obSAPFnCntrl.Add("RFC_CALL_TRANSACTION")

'Set obSAPFnUserDetail = obSAPFnCntrl.Add("BAPI_USER_GET_DETAIL")

Thanks in advance!

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question