on 2011 Nov 15 6:53 PM
In my own NW RFC-SDK based application, I am trying to create a RFC module description the hard way, which is to not download such a description from a SAP system, but to craft the description on-the-fly using API functions RfcCreateFunctionDesc, RfcCreateTypeDesc, RfcAddTypeField, RfcAddParameter and RfcCreateFunction. When calling RfcCreateFunction the system responds with the message
"inconsistence in description detected: non-unicode length is too small".
As far as I can tell all values I provided in the API arguments are correct, including the unicode and non-unicode lengths in the type description of a structure that is underlying the only RFC parameter in the module.
Here is what the module isi supposed to look like:
module has only one Export parameter
the parameter is structured
the structure has a single field only, which is a character array of length 64 (i.e 128 bytes).
My application is unicode based. I added some code to the application to trace the API calls along with the argument values. Here is the output:
******
API RfcCreateFunctionDesc
Created function description object; returned handle: 024A1880
API RfcCreateTypeDesc
Created type description object; returned handle: 024A1A00
API RfcAddTypeField
Added Field to type description 024A1A00:
name DEST
type 0
nucLength 64
nucOffset 0
ucLength 128
ucOffset 0
decimals 0
typeDescHandle 00000000
extendedDescription 00000000
API RfcAddParameter
Added parameter to funtion description 024A1880:
name ATTRIBUTES
type 17
nucLength 64
ucLength 128
decimals 0
typeDescHandle 024A1A00
optional 0
direction 2
parameterText
defaultValue
extendedDescription 00000000
API RfcCreateFunction
Created function object from description 024A1880; returned handle: 00000000
RFC_INVALID_PARAMETER inconsistence in description detected: non-unicode length
is too small
***
Thanks so much for any help!
Request clarification before answering.
Case closed. There was an API call missing in my code, RfcSetTypeLength, which sets the total lengths (unicode and non-unicode) of the structure after adding the structure components.Without that call the system assumes those lengths to be zero, thus the error ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.