请尝试使用以下脚本 -Dim sapConn As Object \声明一个连接对象 Set sapConn = CreateObject("SAP.Functions") \创建一个 ActiveX 对象 sapConn.Connection.user = "用户名" sapConn.Connection.Password = "xxxx" sapConn.Connection.client = "客户端号" sapConn.Connection.ApplicationServer = "应用服务器” sapConn.Connection.Language = "PT" If sapConn.Connection.Logon(0, True) True Then //在此处检查连接 MsgBox "无法登录到 SAP" Else MsgBox "登录成功!!" End If Dim rfcAcctDocCheck As Object Dim oAcctHeader As Object Dim otAcctAR, otAcctGL, otAcctAP, otAcctAMT, otReturn As Object Set rfcAcctDocCheck = sapConn.Add("BAPI_ACC_DOCUMENT_CHECK") Set oAcctHeader = rfcAcctDocCheck.Exports("DOCUMENTHEADER") Set otAcctGL = rfcAcctDocCheck.Tables("ACCOUNTGL") Set otAcctAR = rfcAcctDocCheck.Tables("ACCOUNTRECEIVABLE") Set otAcctAP = ... 阅读更多
在结构中指定表的基本规则是,您必须为该字段提供一个非唯一约束。TYPES: myType TYPE TABLE OF string WITH NON-UNIQUE DEFAULT KEY然后在结构定义中使用它:TYPES: BEGIN OF ty_itab, ….. myTable type myType, …….. TYPES: END OF ty_itab.
在 SAP 系统中,异步调用 (aRFC) 是使用 RFC 接口在 func 中指定的远程启用功能模块。addition DESTINATION 用于在 dest 中指定单个目标,或使用 IN GROUP 指定一组应用服务器。后者支持并行处理多个功能模块。查看以下链接,其中介绍了异步 RFC:https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/abapcall_function_starting.htm#!ABAP_ADDITION_2@2@
查看处理并行处理的代码-gv_semaphore = 0. DESCRIBE TABLE lt_itab LINES lv_lines. LOOP AT lt_itab INTO ls_itab. CALL FUNCTION 'ZABC' STARTING NEW TASK taskname DESTINATION IN GROUP srv_grp PERFORMING come_back ON END OF TASK EXPORTING ... EXCEPTIONS ... . "
当您想要修改内容并将其存储到表中,以及添加一个用于值的列时,请使用类似以下内容DATA: my_string TYPE StringLOOP AT itab INTO wa_itab. my_string = sy-tabix. CONCATENATE some_text my_string more_text into wa_itab-my_field. MODIFY itab FROM wa_itab. CLEAR my_string. ENDLOOP.