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

Data type to be used

Hi All,

I have a requirement where i have to fetch mutiple rows of a table and then concatenate the data of a particular field of all the rows and put it into a single variable.

I have no restrictions on the no of rows to be fetched due to which i cannot plan of the size of that single variable.

Can anyone suggest me some data type which can take variable lengths at run time. also the size limit can go beyond 255.

Please help.

Thanks,

Chandna

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 10:48 AM

    hi,

    u can choose data type as STRING also.

    Cheers,

    Rudhir

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2009 at 10:48 AM

    Hi,

    U can use string or xstring as the data type and concatenate all the variables into the string type one.

    U can declare as :

    DATA: str type string.

    concatenate field1 field2 field3 into str.

    Keerthi

    Edited by: Keerthy K on Feb 25, 2009 11:49 AM

    Edited by: Keerthy K on Feb 25, 2009 11:50 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 10:52 AM

    Hi,

    You can use string or CHAR_1536.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 10:53 AM

    HI,

    use EDI_SDATA data element which can hold 1000 characters.

    OR

    text should be treated as Long Text.

    And the steps are:

    1. Create Text Object Using SE75.

    2. Create Text ID Using SE75.

    3. Now you have to Save the text with FM SAVE_TEXT.

    Regards,

    Venkatesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2009 at 10:55 AM

    Hi,

    Use SYCHAR512

    Pl. refer table TAB512

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2009 at 10:59 AM

    Hi,

    You can use local variable with lenght 65535 type c. It's the maximum length allowed for char data type.

    Regards,

    Surendar Reddy.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 11:18 AM

    Hello Chandna,

    You can go with the following workaround;

    DATA:
      w_var1 TYPE string,
      w_var2 TYPE string.
    
    LOOP AT t_table INTO fs_table.
      CONCATENATE w_var1 fs_table-field1 INTO w_var2.
    ENDLOOP.

    Now, every time loop is run, current value is attached to previous value and at the end, you'll get concatenated values in w_var2.

    You can very well use w_var2.

    Hope, it helps you.

    Thanks: Zahack

    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.