Skip to Content
author's profile photo Former Member
Former Member

Data Type for String...

Hi,

I need to hold text data in an internal table.

So I created a structure as follows:

data: begin of str,

val type c,

end of str.

later when I go and add text values to the internal table,it displayes only the first character of the texts that I append.

How do I define the length of "C"?or which data type can I use to store strings of variable length?

Could someone pelase help me with this?

Thanks,

Sudha.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 06:26 PM

    Try this,

    data: var1 type string.

    TYPE C - Stores only 1 char by default. You may declare fixed length by saying

    DATA: VAR1(10) TYPE C.

    To store variable length use TYPE STRING.

    Thanks,

    SKJ

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.