cancel
Showing results for 
Search instead for 
Did you mean: 

Read text in Smartform

Former Member
0 Kudos

Hi,

I am working on a change to a Smartform and I need to restrict the text in an include text.  I can't find a way to change the Include text so I have been trying to use the function module 'READ_TEXT' even though everywhere I've looked says that this should be done in an include text.

I was just wondering whether READ_TEXT actually works in Smartforms or if there is another way to manipulate the text from include texts.

FYI I want to take the first x number of characters from the include text because any more won't fit on the form.

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

NagaPrakashT
Contributor
0 Kudos

Lee,

   You can use READ_TEXT in the initialization part and read the text then pull out x no.of characters from it. Create a global data variable and assign the value to it and display it in the smartform.

Thanks,

Naga.

Former Member
0 Kudos

Thank you for your helpful reply.

I used the READ_TEXT in the initialization part which worked fine, but then I realised that I actually needed it in the 'Main' window as I needed to use it for a table of item description texts, and then I used the code within the main window node, and it seems to work now.  I'm not sure what I did differently to how I tried it the first time though.

Thank you very much.

Answers (1)

Answers (1)

Florian
Active Contributor
0 Kudos

Hi Lee,

You should read the text into with read_text and after it create a node with a dynamic textnode, where you link your table. But please, do not handle that with a loop or a do node. That isn't a good way to solve problems like yours.

The table has to be type TLINE.

If you need help to implement the dynamic text, please check the official Helpsite. There is a good explaination how to use that.

If you are able to read the text in the driver program do it there and pass it to the interface. It is much easier to debug and manipulate while working with normal breakpoints and stuff like that.

Here i found a step by step tutorial for that:

Dynamic texts in smart form

Regards

Florian

PS: Questions to Smartforms or Sapscript are better posted in Space