11-07-2008 4:19 PM
Hi,
Can you please let me know how the output of the FM READ_TEXT is controlled!
eg: If we have TD = / , then the output is 132 char length!
If we have TD = * , then each line is not more than 72 I guess!
How does it works based on the TD values?
Coz in our system, in SD users are entering Text in 5 lines each 132 in length, but the READ_TEXT is showing the ouput in 9-10 lines each line is 70-72 in length .
Instead i want to display in 5 lines as entered by the users!
OR
We want to read the first 2 lines entered by the users using READ_TEXT. if there is any method to find the number of lines in READ_TEXT which corresponds to the 2 lines entered by the users, so that we can limit reading the text to 2 lines!
We are on ECC5.0
11-07-2008 5:42 PM
Look at [Line Width|http://help.sap.com/saphelp_nw70/helpdata/EN/d6/0db600494511d182b70000e829fbfe/frameset.htm]
Regards
11-07-2008 5:42 PM
Look at [Line Width|http://help.sap.com/saphelp_nw70/helpdata/EN/d6/0db600494511d182b70000e829fbfe/frameset.htm]
Regards
11-07-2008 6:14 PM
That was helpful and its 72 in our case.
Can you asnwer my 2nd question plz!
We want to read the first 2 lines entered by the users in SD Text using READ_TEXT. if there is any method to find the number of lines in READ_TEXT which corresponds to the 2 lines entered by the users, so that we can limit reading the text to 2 lines!
11-07-2008 6:25 PM
check the table STXL ,it might help you..
else use read_text Fm and the values will be returned in table LINES
try using this FM:
* CALL FUNCTION 'RKD_WORD_WRAP'
* EXPORTING
* textline = ztext
* delimiter = ' '
* outputlen = 200
* IMPORTING
* out_line1 = zoutline1
* out_line2 = zoutline2
* out_line3 = zoutline3
* TABLES
* out_lines = zoutline.loop at lines.
if sy-tabix LE 2.
move-- to table..
endif.
endloop.
11-07-2008 6:30 PM
use READ_TEXT_INLINE to read a specific # of lines in a text
11-07-2008 6:38 PM
We cant use just READ or LOOP in order to read 2 lines, Coz:
Suppose user entered 3 Lines of text while creating an order:
1st Line: 132 char length
2nd Line: 49 Char length
3rd Line: 120 Char length
Now I want to read only the first 2 lines into a internal table.
If we use READ_TEXT now, it splits the 1st line enetered by the user into 2 lines as the length of the Text is more than 72.2nd Line is displayed in 1 line as it is less than 72.
So totla number of lines to be read in this case would be 3. So we cant use Loop or READ int his case..and also READ_TEXT si not splitting at 72, instead its splitting at a logical position.
eg: if 72nd position is n in 'and' text, then its not splitting at n, instead its splittin before and starts so that the line looks logical to read. Hope you got it.
11-07-2008 6:45 PM
hmm..
even though in the page window we specify as 72 characters, most of the times the window will accept near to 200 characters for text.. in a trail run, give a try to send a character of 200 characters and see if its printed fine...
11-07-2008 6:47 PM
11-07-2008 6:49 PM
11-07-2008 6:49 PM
loop at td_line into wa_line.
concatenate zoutline wa_line-tdline into zoutline.
endloop.
now Zoutline is a big string with all the text..
using the FM i sent before split the zoutline string to max 3 lines of what so ever width you want and use that..
11-07-2008 7:01 PM
This really doesnt help as we dont know into how many lines and at what position the FM READ_TEXT splits the incoming Text.
We may have to depend on TDFORMAT!
Even READ_TEXT_INLINE is not a solution.
Help wud be awarded!
07-27-2009 2:23 PM
Hi. Sorry, I know it's about 8 months late, but I just had basically this same problem and was searching SDN for a solution, and have just found that function FORMAT_TEXTLINES will sort it out.
Just pass your table with 72 chars in as table LINES and set FORMATWIDTH to 132, and when you get the table back it will have put it in lengths of 132 but still use original formatting, so if the user has pressed enter you will get a new line for example.
Once you have back your table formatted to 132 chars you can just read the first 2 lines.
Regards,
Dave.