How do I insert data from a text file into a multiple selection with a VBA post-query?

1 month ago 11

Hello SAP Community. I request to paste information from a substance record into aggregate selections.

Palookaville_0-1729233933161.png

I person codification that works successful part:

Dim bound As String Dim formData As String Dim fileBytes() As Byte Dim fullRequest() As Byte Dim filePath As String Dim record As String Dim byteContent() As Byte Dim one As Long Dim fileNumber As Integer Dim fileSize As Long Dim formDataLength As Long Dim totalLength As Long filePath = "D:Macro\WebSAPtest\exceptions.txt" record = "exceptions.txt" ' Random bound generation bound = "----WebKitFormBoundary" & GenerateBoundary() formData = "--" & bound & vbCrLf formData = formData & "Content-Disposition: form-data; name=""updownbase64in""" & vbCrLf & vbCrLf formData = formData & vbCrLf formData = formData & "--" & bound & vbCrLf formData = formData & "Content-Disposition: form-data; name=""updownchunkstatusin""" & vbCrLf & vbCrLf formData = formData & vbCrLf formData = formData & "--" & bound & vbCrLf formData = formData & "Content-Disposition: form-data; name=""updownfilesize""" & vbCrLf & vbCrLf formData = formData & fileSize & vbCrLf formData = formData & "--" & bound & vbCrLf formData = formData & "Content-Disposition: form-data; name=""LOCALFILE1""; filename=""exceptions.txt""" & vbCrLf formData = formData & "Content-Type: application/octet-stream""" & vbCrLf & vbCrLf formData = formData & ReadFileContent(filePath) & vbCrLf formData = formData & "--" & bound & "--" & vbCrLf ' nonstop request xmlHttp.Open "POST", "http://" & sap_web_server & nexus & "post", False xmlHttp.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & boundary xmlHttp.send formData

It writes 2 numbers to 1 compartment successful encoded form:
u3035\u3330\u3134\u3737\u0A0D\u3035\u3330\u3136\u3434\u0A0D

Also one have python codification that works correctly:

with open(os.path.join(input_folder, 'exceptions.txt'), 'rb') arsenic exceptions_file: r=session.post(f"http://{sap_web_server}{link}post", files={'exceptions.txt': exceptions_file}, params={'SEC_SESSTOKEN': sessiontoken, 'updownchunkstatusin': '', 'updownbase64in': '', 'LOCALFILE1': '(binary)'})

 how to alteration the codification truthful that information is written to antithetic cells, the values successful the substance record tin beryllium much than 300. what americium I doing wrong?

Read Entire Article