AsString vs AsVarString

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

Please Log in to join the conversation.

  • Serge Volkov
  • Serge Volkov's Avatar
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.

Please Log in to join the conversation.

Contact US

  • gs-soft AG

    Delfterstrasse 10

    CH-5000 Aarau

    Switzerland

    Phone:
    +41 62 832 20 40
    E-Mail:
    This email address is being protected from spambots. You need JavaScript enabled to view it.


  • Language