Delphi SAP SAPFunctions DELIMITER 突然被忽略?
我有一个旧的 Delphi 应用程序,它使用 SAP ActiveX SAPFunctions,
var
TmpSAPFunctions: TSAPFunctions;
...
begin
...
TmpSAPFunctions.RemoveAll;
Funct:=TmpSAPFunctions.Add('RFC_READ_TABLE');
Funct.Exports('QUERY_TABLE').Value:='JEST';
Funct.Exports('DELIMITER').Value:=',';
然后我在 Delphi 2010 中重新编译了该应用程序,但发生了一件奇怪的事情。我不再获得数据逗号分隔的 CSV,而是数据似乎是 FWV(固定宽度值),
我只是更新应用程序的其他部分,所以我对 SAP 编程并不是那么了解,但这是我通过搜索得到的理解网络中CSV模式(允许使用分隔符)应该是默认的吗?
我不明白当目标/主机系统上的 ActiveX 相同时,从 D6 到 2010 的更改会产生什么影响。
I have an old Delphi application that uses the SAP ActiveX SAPFunctions
var
TmpSAPFunctions: TSAPFunctions;
...
begin
...
TmpSAPFunctions.RemoveAll;
Funct:=TmpSAPFunctions.Add('RFC_READ_TABLE');
Funct.Exports('QUERY_TABLE').Value:='JEST';
Funct.Exports('DELIMITER').Value:=',';
I then recompiled the application in Delphi 2010, but a strange thing is happening. I no longer get data comma delimited CSV, but instead the data seems to be FWV (fixed width values)
I was just updating other parts of the application, so I am not really that wellknown with SAP programming, but it is my understanding from searching the net that CSV mode (that enables the use of delimiter) should be default?
I don't understand how the change from D6 to 2010 can make any difference when the ActiveX on the target/host system is the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你的回答是对的。单个字符“字符串”被解释为 Char,例如“A”存储为#65。这存储在变体中。变体是变体记录,因此如果查询变体以获取字符串,它将返回“65”,并且 SAP 例程会选择该字符串的第一个字符。
所以你可以这样做:
或者
I think you are right in your answer. A single character "string" is interpreted as Char, e.g. 'A' is stored as #65. This is stored in the variant. A variant is a variant record, so if the variant is queried for a string, it returns "65", and the SAP routine picks the first character of that.
So you could do:
or
您好,我建议您从 GSsoft 获取完全支持 Unicode 的 SAPx 更新版本,您需要根据您的 AP 是否启用了 unicode 来重新生成包装类,
来自 GS-soft 的下载链接是 此处
致以诚挚的问候
Hi I recomend that you get an updated version of SAPx from GSsoft that fully supports Unicode, you need to regenerate the wrapperclass based on wether your ap is unicode enabled or not
the download link from GS-soft is here
Best regards
使用字符串作为分隔符,如下所示:
Funct.Exports('DELIMITER').Value:='12345';
SAP 引擎选择第一个字符作为分隔符,此处为“1”
当使用单字符值作为分隔符(如假设的那样)时,会发生以下情况:
CR (Ascii 13) 变为“1”,(Ascii 44) 变为“4”:(Ascii 58) 变为“5”; (Ascii 59) 变成“5” X (Ascii 88) 变成“8” Z (90) 变成“9”
所以我们可以得出结论,Delphi2010/SAP-ActiveX/Delphi-variant-code 转换例如“;”首先是 ascii-numeric-value,然后是“59”。然后 SAP 引擎选择第一个字符“5”。
...
不确定这是否是 Delphi 变体代码或 SAP ActiveX 中的错误
Using a string as delimiter like this:
Funct.Exports('DELIMITER').Value:='12345';
SAP engine picks first character as delimiter, here '1'
When using single-char values as delimiter (as supposed) following happens:
CR (Ascii 13) becomes "1" , (Ascii 44) becomes "4" : (Ascii 58) becomes "5" ; (Ascii 59) becomes "5" X (Ascii 88) becomes "8" Z (90) becomes "9"
So we can conclude that Delphi2010/SAP-ActiveX/Delphi-variant-code converts e.g. ";" to first ascii-numerical-value and then to "59". The SAP engine then picks first character, "5".
...
Not sure if this is a bug in Delphi variant-code or SAP ActiveX