Skip to Content
avatar image
Former Member

VBA RFC to read data from SAP Chinese '#', CODE Page Issue

Dear All:

I have work out a Excel VBA macro to read RFC to read data from SAP Systems. But now the issue blocks me 2 weeks are that the data extracted, but Chinese letters show as unknow letters. Like #,? etc. I have searched the our community, someone use the following to solve the issue, but it could not work here.

R3Connection.Codepage = "8400"

and this statement seems also not working.

SAP_RFC_FM_EXPORT_TABLE("RfcParameter").Data = "SPRAS = 'ZH'" ' set condition of language of 'ZH'

Does someone else have the same issue as me? I paste code here.

R3Connection.Client = "100"
R3Connection.ApplicationServer = "XXX"
R3Connection.Language = "EN"
R3Connection.User = "XXX"
R3Connection.Password = "XXX"
R3Connection.System = "XXX"
R3Connection.SystemNumber = "00"
R3Connection.Codepage = "8400"

SilentLogon = True

If R3Connection.Logon(0, SilentLogon) <> True Then
StrStatus = "Could not connect to SAP R/3 System, Please Contact Conan Huang"
'11= MsgBox (StrStatus,"LOGON")
MsgBox (StrStatus)
Exit Sub
Else
StrStatus = "Logon OK"
End If

' IMPORT AND EXPORT TABLE FOR SAP RFC Function Module Consuming

SAP_RFC_FM_Control.Connection = R3Connection

Set SAP_RFC_FM_ADDRESS = SAP_RFC_FM_Control.Add(RFC_Function_Module_Name)

Set SAP_RFC_FM_EXPORT_TABLE = SAP_RFC_FM_ADDRESS.Tables(SAP_RFC_FM_EXPORT_TABLE_NAME)

' Start to Fetch the data from SAP RFC Function Module

SAP_RFC_FM_CALL_RESULT = SAP_RFC_FM_ADDRESS.call

If SAP_RFC_FM_CALL_RESULT = True Then

Num_Records_Found = SAP_RFC_FM_EXPORT_TABLE.Rows.Count

SAP_RFC_FM_EXPORT_TABLE("RfcParameter").Data = "SPRAS = 'ZH'" ' set condition of language of 'ZH'

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers