Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

PB 12.5 Classic how to return a C# dll array

I created a dll in visual studio and using it in PB.  I am able to connect to the dll with no problems from PB.

If I call a function on the dll with a return of int or string it works fine but when I need to return an array/structure I get

"error calling external function"  How can/do you pass data (rows) back from a dll and into PB?


Dave V.

Former Member
Former Member replied

OK - well, that's the C# side and it all looks fine.  That was the first half of my question...

What does your method declaration AND invocation code look like in PB?

You have to use a variable of the ANY datatype as the return variable, then you cast that into the defined structure.  Something like this:

ANY myAnyVar

myStructure l_myStructure[]  // local array of your structure class

myAnyVar = ReturnItems( "INBOX" )

l_myStructure = myAnyVar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question