‎2008 Dec 19 10:29 AM
Hi,
In smartforms I am getting the item text content thru "READ_TEXT" function module.It contains more lines.I want to put each line(132 long) to be spitted and put into variables.How can i get this?
‎2008 Dec 19 11:03 AM
Hi Khanna,
Are you getting the values in Export structure (Header) or in Tables parameter (Lines)?
If it is Header, then you can move it to variables as follows:
Var1 = Header+0(132).
Var2 = Header+133(132).
The above mentioned numbers can be dynamic. Meaning, you can use DESCRIBE statement to find the actual length and accordingly you can move it.
If it is Lines, you need to loop in to Lines table and move the values to variable as stated above.
Loop at Lines into Workarea.
" Here you can treat this workarea similar to the Header structure.
endloop.
Hope this throws some light on the issue that you are facing
Best Regards,
Ram.
‎2008 Dec 19 11:31 AM
HI,
My text is with header.I tried with
DATA: TXT(150),TXT1(150).
TXT = g_txt1+0(132).
TXT1 = G_TXT1+133(132).
But i am getting second line too in first variable.How to use DESCRIBE for dynamic values ?
‎2008 Dec 19 11:39 AM
Hi Khanna,
You can use
Describe Fieldstatement to get the length of the structure.
As the Header is defined in the export parameter as structure, i think you would be getting only one line as the output. It contains fields. It can be moved as follows.
var1 = header-TDNAME.
var2 = header-TDFORM.
var3 = header-TDREFOBJ.
Kindliy check.
Best Regards,
Ram.
‎2008 Dec 19 11:35 AM
Hello,
I am not sure about your requirement. Bu i feel you want the text lines to be split into variables of some
fixed length. You can make use of FORMAT_TEXTLINES func. module for this purpose.
BR,
Suhas