2012 Mar 08 12:06 PM
Hi all,
i am using the function module READ_TEXT, to fetch the long text for my program, when i am fetching the same, into the internal table from the tables column in the function to a internal table tlinetab which has a include type of the structure tline.
i am able to get the values through the function module into the table tline tab, where the long text is of 325 characters. i am also aplying a loop on the table tlinetab in order to concatenate the tdline component into a variable of length 350 characters, but, i am not able to do so, the output of the function module shows 325 characters, but after concatenating the same i am able to see and show only 255 characters, on checking upon the debugger i am seeing that there is a index of the output of the function module as 6, also there is the full text available, on debugging the same step by step along the loop when it reaches sy-tabix = 5, and sy-tabix = 6 the text fails to get concatenated to the character that i defined to be of 350 characters, instead only 255 characters are visible. What do i do for it...as i am not able to find a suitable answer, please help me out for the same.
waiting for a positive reply.
sriram.
Hi all,
i am using the function module READ_TEXT, to fetch the long text for my program, when i am fetching the same, into the internal table from the tables column in the function to a internal table tlinetab which has a include type of the structure tline.
i am able to get the values through the function module into the table tline tab, where the long text is of 325 characters. i am also aplying a loop on the table tlinetab in order to concatenate the tdline component into a variable of length 350 characters, but, i am not able to do so, the output of the function module shows 325 characters, but after concatenating the same i am able to see and show only 255 characters, on checking upon the debugger i am seeing that there is a index of the output of the function module as 6, also there is the full text available, on debugging the same step by step along the loop when it reaches sy-tabix = 5, and sy-tabix = 6 the text fails to get concatenated to the character that i defined to be of 350 characters, instead only 255 characters are visible. What do i do for it...as i am not able to find a suitable answer, please help me out for the same.
waiting for a positive reply.
sriram.
2012 Mar 08 12:33 PM
if you are concerned about the length, don't rely on visible length.... declare a variable of type i and check the length.
data: lv_len type i.
loop....
.....concatenate.....
endloop.
lv_len = strlen( 350-char-variable ).
write: / lv_len.
2012 Mar 08 12:48 PM
Hi thanks for the quick response, but my query was.....i am not able to get the full text of the 325 characters into my final variable which can hold 350 characters....it only holding 255 whereas i defined the variable as
data: lv_specs(350) type c.
i am getting the values in tlinetab which is a type of tline from the read text. the tdformat has a index value of 6 and the tdline has a text of 325 characters
but when i am doing this:
loop at tlinetab.
concatenate lv_specs tlinetab-tdline into lv_specs separated by space.
condense lv_specs.
clear tlinetab.
endloop.
here in the variable lv_specs i am having the text as only 255 characters.
my doubt is when i am having the table tlinetab with the complete value but why does it not concatenate all of it while i run the loop....
2012 Mar 08 12:49 PM
HI,
DECLARE IT OF TYPE STRING.
data: lv_specs type STRING.
REGARDS,
GAURAV.
2012 Mar 08 1:32 PM
Hi,
here in the variable lv_specs i am having the text as only 255 characters.
Where do you actually check this? are you using write statement? Is it displayed in a ALV? are you only checking the value in debugger?
There shouldn't be any issue with your code, wether you use a string or char type ... the problem is probably on some other part...
Kr,
Manu.
2012 Mar 08 6:05 PM
It will concatenate it all...the problem is the tool that you're viewing the 350-byte variable with!... In fact, people routinely do:
data: my_string type string.
field-symbols <lfs_t> type tline.
loop at tlinetab assigning <lfs_t>.
if <lfs_t> is assigned.
if sy-tabix eq 1.
my_String = <lfs_t>-tdline.
else.
concatenate my_string <lfs_t>-tdline
into my_String separated by space.
endif.
endif.
endloop....
to do this, we don't care how many rows are in tlinetab! ALL will be concatenated, whether we can view them with some limited capability desktop tool or not...
Did you do the step to look at the "real" length with the code I gave you? What is in LV_LEN?
2012 Mar 08 12:48 PM
HI,
THE CHARACTER YOU DEFINED IS OF WHAT TYPE?
REGARDS,
GAURAV.
2012 Mar 08 12:50 PM
i have mentioned it above....it is of type 'C' with length 350
2012 Mar 08 12:52 PM
Hi gaurav,
i tried using it, but in vain, i am obtaining the same result.
2012 Mar 08 12:52 PM
HI,
TYPE C CAN HOLD ONLY 255 CHARACTERS, THATS WHY THE VARIABLE SHOWS ONLY 255 CHARACTERS.
REGARDS,
GAURAV.
2012 Mar 08 1:00 PM
but even we can define the variables like
DATA : lv_spec(350) type C.
right....i tried this after i tried string......
2012 Mar 08 1:12 PM
Hi,
I created a test program something like this:
i appended the values into table during debugging and its working fine.
data: ITAB1 type STANDARD TABLE OF TLINE.
data: WA_ITAB1 type TLINE.
LOOP AT itab1 INTO wa_itab1.
CONCATENATE lv_var wa_itab1-TDLINE INTO lv_var SEPARATED BY SPACE.
condense LV_VAR.
ENDLOOP.
var2 = strlen( lv_var ).
write VAR2.
Regards,
Gaurav.
2012 Mar 08 6:01 PM
NOT true...the widest type c is 65535. try it....data: lv_c(65535) type c.
2012 Mar 08 1:11 PM
Hi ,
Try this data element CHAR339
Hope will work .
Thanks,
Pradeep.
Edited by: Pradeep Mohandass on Mar 8, 2012 2:12 PM