pralash
13th July 2018, 16:07
Hi,
I'm doing a customization in order to fetch the text from the table tttxt010 by checking the text number from the sales order table as follows...
select tttxt010.ctxt, tttxt010.text
from tttxt010
where tttxt010.ctxt = {:tdsls400.txta}
selectdo
text.header = tttxt010.text
message("%s",tttxt010.text)
endselect
Actually I can view two lines of text for the particular text no via the Text manager tool in ERPLN... But I can get only one line of text while execute the above script... So how can I get all lines in that particular field.
Note : I have created report input field as follows for "text.header"
text.header tcmcsstr300m
Can anybody please help me...
Regards,
Pralash
bdittmar
13th July 2018, 16:37
Hello,
text.to.buf()
text.to.buf()
Syntax:
function long text.to.buf (string text_field, string lang, long nr_lines, ref string buf [, long rtf.text])
Description
This stores the text of a specified text field in a two-dimensional string array.
Arguments
string text_field The name of the text field that must be retrieved. See Text fields overview.
string lang This specifies the relevant language.
long nr_lines This specifies the maximum number of lines that can be stored in the buffer.
ref string buf This specifies the buffer in which the text must be stored.
[long rtf.text ] Set this argument to true if you want the text to be stored in RTF format instead of ASCII format. This is possible only when using a text group that supports RTF data.
Return values
>0 number of stored lines
0 error
- 1 no permission to store the text
Context
This function can be used in all script types.
or use the textfield directly with domain tctxtn in your Report layout.
Regards
pralash
14th July 2018, 18:48
Hi,
Thanks so much for replied....
Whenever I created the report input field for "tttxt010.text", the domain "tttxt.buf" is automatically allocated.... Then as you suggested, I have used the filed name "tttxt010.text" in the report layout... but it highlight a error such "Field length cannot be grater than 116"... So how can I use the field name directly in the report layout in order to get the multiple lines from that field...
Regards,
Pralash
andreas.toepper
16th July 2018, 08:51
"Field length cannot be grater than 116
This means the field does not fit in the layout. Its selected or defaulted width will extend the layouts width (mind the maximum width of 255 chars).
You can simply correct the width of the field "Print Length" (needs to be less than 116+1).
This needs to be done before you save the field data of field tdsls400.txta is saved.
Oh, btw: if you want to print field tdsls400.txta in the report, you just need to insert the text field tdsls400.txta in the layout. There's no need to fetch data from the tools table tttxt010. LN will print the text data if a text field is inserted in the layout.
And don't be surprised: insert the text field, extend the value of field "Print Length" to the width you need. This will result in a field with the high of 1 row. On runtime LN will print as many text lines as presented in the text.
pralash
16th July 2018, 10:36
Hi Andreas,
Thanks so much for your guidance... I'll try as you suggested...
Regards,
Pralash