Hi Friends,
I searched online but couldn't find an answer to this problem. I want to fill a variable declared as string or text1000 but it gets truncated at 255 length. Hope you can help check, fix or even provide an explanation atleast.
Below is the code I'm using:
*&---------------------------------------------------------------------*
*& Report ZTEST1
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
report ztest1.
data: lt_lines type standard table of tline,
lwa_lines type tline.
data: lv_complete_comment type text1000.
*Append information
lwa_lines-tdline = '************************************************************************'.
append lwa_lines to lt_lines.
lwa_lines-tdline = 'Changed By: Aaron Di (7777777)'.
append lwa_lines to lt_lines.
lwa_lines-tdline = 'Changed On: 09/08/2026 21:21:21'.
append lwa_lines to lt_lines.
lwa_lines-tdline = '************************************************************************'.
append lwa_lines to lt_lines.
lwa_lines-tdline = 'This is a test case for the TIM reminder email update to increase the character restriction. The comments need to show'.
append lwa_lines to lt_lines.
lv_complete_comment = reduce string(
init text = conv string( '' )
for line in lt_lines
next text = text && '' && line-tdline && cl_abap_char_utilities=>newline ).
write lv_complete_comment.Below is the debug screen showing the character length saved inside lv_complete_comment.
Appreciate your time and hope you can share your thoughts.
Geoff
Request clarification before answering.
What do you mean by truncated at 255 length? I do not see it in your screenshot.
When I try code I do not see problem either - LV_COMPLETE_COMMENT contains all the texts including the "The comments need to show".
Maybe you are asking about WRITE? For that I recommend reading WRITE | ABAP Keyword Documentation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Appreciate your time Tomas. please see comments below:
Mine gets cut out at "(include preceding comments)....This is a test case for the TIM reminder e" (continuation of -> "mail update to increase..." - and the rest are cut out (please see debug screenshot)). I wonder why mine is limited to only 255? is there a setting for this?
How did you get to that view? My variable when I try to pass to another string gets only until letter e. Not the complete text you are showing.
Here's my debugger view:
If it's just showing a preview then I suppose it should get all the text when I pass it to another variable... It only gets until "e" as shown above.
Appreciate your help.
Geoff
I see it now, the tabular view shows the complete text same as yours 🙂
Then the issue is not the variable, once I pass it to SOST it gets truncated shorter, only until "for the TIM remind" - compare to the fast display view showing "for the TIM reminder e". Once you changed to tabular it shows the whole text...
It appears SOST preview comment box has limitation as well?
Thank you for your help.
Geoff
Hello @jeff_broodwar
TRING in ABAP is not limited to 255 characters. The truncation is usually caused by an intermediate field (such as TDLINE) or by how the value is being displayed/debugged
Thanks,
Sravan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.