AsString vs AsVarString
- Bruce Smith
- Topic Author
8 years 6 months ago - 8 years 6 months ago #15 by Bruce Smith
AsString vs AsVarString was created by Bruce Smith
What is the difference between ValueAdapter.AsString and ValueAdapter.AsVarString ?
I assume the property "AsString" should be used to access a value of the ABAP type "CHAR" while "AsVarString" used for values of ABAP type "STRING".
Is that correct?
I assume the property "AsString" should be used to access a value of the ABAP type "CHAR" while "AsVarString" used for values of ABAP type "STRING".
Is that correct?
Last edit: 8 years 6 months ago by Serge Volkov.
Please Log in to join the conversation.
- Serge Volkov
8 years 6 months ago #16 by Serge Volkov
Replied by Serge Volkov on topic AsString vs AsVarString
Yes, you are right.
You use "AsString" for RFC "CHAR" type value and "AsVarString" for RFC "STRING" value.
Also please note that when using "AsString", you should explicitly set the property ValueAdapter.CharacterSize as the RFC type "CHAR" has a fixed length: e.g. CHAR15.
And the explcit definition of "CharacterSize" is not required for RFC "STRING" values.
You use "AsString" for RFC "CHAR" type value and "AsVarString" for RFC "STRING" value.
Also please note that when using "AsString", you should explicitly set the property ValueAdapter.CharacterSize as the RFC type "CHAR" has a fixed length: e.g. CHAR15.
And the explcit definition of "CharacterSize" is not required for RFC "STRING" values.
Please Log in to join the conversation.