cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

.GetString from Table contains only Zeros SAP NCo 3.0

Former Member
0 Kudos
243

Hello,

I'm using SAP NCo 3.0.

The Connecetion to the Server and the Function Module works. But after that I need the String which is inside a table, Field is LINE.

fm_sel.Invoke(_ecc)

After Invoke fm.sel shows me that:

SAP.Middleware.Connector.RfcFunction = {FUNCTION YCP_DIS2LOCPC (IMPORT PARAMETER IP_DOKAR=127, IMPORT PARAMETER IP_MATNR=300003819, IMPORT PARAMETER IP_WSAPPL=TIF, TABLES PARAMETER ET_BIN=TABLE [STRUCTURE SDOKCNTBIN { FIELD LINE=49492A00080000001100FE00040001000000020000000001040001000000000900...

Later I need that string to get the bytes of the document.

Dim fm_string As String = fm_sel.GetTable("ET_BIN").GetString("LINE")

But now fm_string contains only zeros and that's not correct, only the lenght is correct.

"000000000000000...."

In my old application I do it likes this, but with SCo 3 ist more difficult and I don't know how to handle.

Becaue of that it's very important to have to correct content of LINE.

      For Each row In dieFunc.tables("ET_BIN").rows
                line_len = Len(row("LINE"))

                For y = 0 To line_len - 2 Step 2
                    n = "&h" & row("LINE").substring(y, 2)
                    w.Write(n)
                Next y

            Next row

I Hope somebody can help me!

Thank you!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hmm...the problem is:

How can I get the content of the field LINE who has the Type RAW?

Former Member
0 Kudos

Now I solved my problem. Maybe it helps others

Dim fs As New IO.FileStream(SaveFileDialog1.FileName, IO.FileMode.Create)
            Dim w As New IO.BinaryWriter(fs)
            Dim n As Byte
            Dim y As Integer
            Dim line_len As Integer
            Dim content_row As String

            For Each row In fm_sel.GetTable("ET_BIN")

                ' Inhalt der Reihe
                content_row = row.GetString("LINE")

                ' Länge der Reihe
                line_len = Len(content_row)

                For y = 0 To line_len - 2 Step 2
                    n = "&h" & content_row.Substring(y, 2)
                    w.Write(n)
                Next y

            Next row