AsString vs AsVarString

  • Bruce Smith
  • Bruce Smith's Avatar Topic Author
3 years 5 months ago - 3 years 5 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?
Last edit: 3 years 5 months ago by Serge Volkov.
  • Serge Volkov
  • Serge Volkov's Avatar
3 years 5 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.

Contact US

  • gs-soft AG

    Delfterstrasse 10

    CH-5000 Aarau


    +41 (0)62 832 20 40

  • Language