Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Splitting Header text

Former Member
0 Likes
590

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?

4 REPLIES 4
Read only

Former Member
0 Likes
532

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.

Read only

0 Likes
532

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 ?

Read only

0 Likes
532

Hi Khanna,

You can use

Describe Field

statement 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.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
532

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