Good morning. I have a problem in finding information on a structure of type any. Let's go by order: 1) I declare a variable of type amy: 2) I call a WS that returns an array of structures (see down) 3) at this point, how do I access the values of the structure? case a) string ls_ = la_return [1].code. PB Ide tells me it does not exist. ( la_return is declared: any la_return [] ) case b) istr_getitems [] = la_return []. Creates an error in execution. (istr_getitems [] is created equal to what i see in debugging. You can help me ?
thy Gimmy
debug window
==========
any la_return [2]
- [] any [1]
- boolean aftermarket = true
- long mid = 502
- long sort = 2
- powerobject classdefinition
- string code = "123"
- description = " desc"
- string info = "informazioni"
- manufacturer = " Hella "
- [] any [2]
- boolean aftermarket = true
- long mid = 50222
- long sort = 21
- powerobject classdefinition
- string code = "abc"
- description = " descizione"
- string info = "informazioni importanti"
- manufacturer = " Hella "
How can i access to the data in this any variable?
Sample code below:
any la_return[]
la_return[] = proxy_obj.getitems(is_token, sle_1.text, ll_null , '', 'S','it',false,ll_null,'','',ll_null,100)
Regards
Stefano
In my experience, PB uses the any datatype when there is something it can't handle in the return. The structure/collection may be too complex or have some datatype(s) that it can't handle, so instead of generating the normal nvo's you'd expect, it uses any. You can verify this (and you probably already have) by exporting the service proxy object and looking at it in Edit. If it says "function any myfunction(..." and you go through debugger and the variable you are using for the response is null, it usually means that what is being returned can't be properly interpreted properly by PB. If possible, contact the ws creator (hopefully in-house) and examine their structure to see if you can figure out the offending data type. good luck!