Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

concatenate problem

Former Member
0 Likes
618

Hi guys,

I am experiencing a weird behabour with the concatenate function.

I have a internal table with 4 lines, each line has a sentence, and I want pass the 4 lines to an unique string. Everything is working perfectly until the 232 character, from this point the string container doesn't allow more data. I try to see if any error occurs with the concatenate statement, but sy-subrc is always 0 (zero).

This is the code of the function:

FUNCTION zhr_pd_f_utility_tab_to_str.

*"----


""Interfase local

*" EXPORTING

*" REFERENCE(P_STRING) TYPE STRING

*" TABLES

*" P_IN_TAB STRUCTURE TLINE

*"----


CONSTANTS:

c_linebreak TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf.

DATA: l_linebreak(2) TYPE c.

DATA: str_aux(1000) type c.

FIELD-SYMBOLS: <l_convert>,

<l_line> LIKE LINE OF p_in_tab.

CLEAR p_string.

clear result_tab.

clear str_aux.

LOOP AT p_in_tab ASSIGNING <l_line>.

IF sy-tabix > 1 AND " not first line

( <l_line>-tdformat = '/' OR " new line

<l_line>-tdformat = '*' ). " new paragraph

CONCATENATE str_aux c_linebreak <l_line>-tdline INTO str_aux.

ELSEIF sy-tabix EQ 1.

str_aux = <l_line>-tdline.

ELSE.

CONCATENATE str_aux <l_line>-tdline INTO str_aux

SEPARATED BY ' '.

if sy-subrc eq 4.

break-point.

endif.

ENDIF.

ENDLOOP.

p_string = str_aux.

ENDFUNCTION.

any help?

thanks in advance.

cheers.

2 REPLIES 2
Read only

Former Member
0 Likes
594

What made you think that concatenation is not happening after 232 characters ? In debugging mode you may not see the content more than that..

did you try in debugging mode using offset like

str_aux+300(35) - to show string content from 300 th position to 335 th position..

is it blank/./ ?

Read only

0 Likes
594

Hi,

the weird behavour still continue...

now, I am count all the characters of the string, and all the characters of the table, so at the end of the loop, I can count the amount of characters, and if there is any difference, I can add the remaining text.

PROBLEM, when I count the characters, it counts characters that are not in the string. The string shows me until 255 characters (not 232 as I told before. 255 sounds like the maximun amount of numbrer that can be count with a byte), but 279 are counted!!!!

I discover that no more than 255 chars are permitted, therefore, i have changed the string variable for a char(1024) but the problem still continue.... it is driving me crazy!!!!

any help?

thanks.