Posted: Tue Jul 28, 2009 12:14 pm Post subject: Проблемы кодировки при выгрузке в Excel через вызов BAPI
Не подскажете в чем может быть причина:
При выгрузке в Excel через вызов BAPI кирилические данные выгружаются в виде ########.
Это происходит на различных версиях MS Office и Windows, кроме одной машины... на ней все ок.
Пример конфигурации:
Windows 2000 SP4
Excel 2003 (11.5612.5606)
SAPGUI 710
SAP ERP Central Component 5.0
Методика выгрузки
Создан ФМ в SE37 по выгрузке
function z_bapi_get_bu_details.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" IMPORTING
*" VALUE(P_BUKRS) LIKE T001Z-BUKRS
*" VALUE(P_PARAM) TYPE ZSTR_KND
*" EXPORTING
*" VALUE(P_FIO_CACF) LIKE T001Z-PAVAL
*ФИО ГБПолн
select single paval into p_fio_cacf from t001z
where bukrs = p_bukrs
and party = 'SAPR16'.
Создан объект:
SWO1\Z_SPPFD с методом GetBuDetails (ссылка на z_bapi_get_bu_details)
Вызов из Excel
Dim loSAPObject As Object
Dim loReturn As Object
Dim bResult As Boolean
Dim lvTmp As Variant
Dim oParam As Object
Dim oPCompanycodeDetail As Object
Dim oPCompanycodeAddress As Object
Dim sDate As String
' Тип для передачи параметров соединения с SAP-системой
Type TConnection
host As String
sysname As String
sysnum As Integer
mandant As Integer
router As String
language As String
user As String
password As String
End Type
Dim strucSAP As TConnection
и далее использовал...
strucSAP.user = .Sheets("SAP").Range("SAPПользователь").Value
strucSAP.password = .Sheets("SAP").Range("SAPПароль").Value
' Создание BAPI-объекта
Set oBAPICtrl = BAPIConnect(strucSAP)
если не определить CodePage в структуре - прокол....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.