on 02-06-2012 6:44 AM
Hi Gurus,
How to protect line break in a text element of smartforms. Text in that line is printing exactly 70 characters. I want the text to be printed fully till the size of the window. How to stop this automatic line break.
Regards,
Rithika.
What I have done may be helpful, so here are the details:
I had a table of text values, so I converted this to a string with concatenate, then string to a long character field, then used RKD_WORD_WRAP to put into table of 132 characters. Then I constructed a table of type tline by looping at my RKD_WORD_WRAP output, and utilized SAVE_TEXT to temporarily store a TEXT entry, like you would save with SO10, saving my desired paragraph format into TDFORMAT field and inserting any necessary character format commands into the text.
In my SmartForm, I then have dynamic text processing pointing to the internal table fieldnames containing tdname, tdid, tdobject, tdspras of what I saved. This allows SmartForms to utilize the full width of the window and optimize text output, based on window width, font, scale, paragraph format, character format, etc. These text identifier values are passed as part of my internal table via the SmartForms interface.
At the end of SmartForms processing, I loop at my internal table and utilize DELETE_TEXT to remove the temporary texts that I created for this set of output.
To avoid page breaks in my text, I put my output for a "block" of data into a folder (see the SmartForms folder feature). I have page protection on the folder...that way, SmartForms examines the length of the folder content and decides whether a page break should occur before any output for my block of data begins. My block of data contains a few data elements over 5 rows of output followed by two separate dynamic texts of various lengths. If the entire block won't fit on the remaining part of a page, page-break occurs first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Include your text between protect and endprotect.
Best regards.
Aswath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
PROTECT/ENDPROTECT stops the text from being printed in separate pages.
From what I understand the OP wants the text to be printed in only one line and if it exceeds the space just be truncated. Is this correct?
I have done something like this but in a very "unorthodox" way... Basically I checked if the text that was going to be printed was longer than a certain number of characters, and if it was I would change it to something like 'ABCDE...'
Hope this helps.
Bruno
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Protect-Endprotect is used in case of page break rite. My case is am printing the header text content from PO. Am looping the internal table which contains this text and printing each line of header text using work area. But it is only printing 70 characters per line. I want to print the text more than that, because of this issue lot of empty space is coming.
Regards
Rithika
No we should not reduce the font size. Actually there is lot space in that line but still its printing only 70 characters in that line.
I don't know why its applying line break after 70 characters. I should not get empty space in that line it should be printed till the border of the window. I also checked the length of the workarea field its 132 char lenght. what will be the problem.
I don't use a variable to contain the text...I use variables to point to where I have the text stored..... I have an element type as "INCLUDE TEXT" and my values contain >_DATA-TDNAME&, >_DATA-TDID& etc. SmartForms then figures out how to lay down the rows of text that are retrieved based on the TDNAME, TDID, TDOBJECT, TDSPRAS, etc.
It sounds like you're trying to manage text output via a variable, rather than letting SmartForms handle the text as it was designed to do?
Always let SmartForms (or SAPScript) manage text output, where possible. I would use a variable containing text only when I had one specific value of a certain length, e.g., I want only one row of output containing up to x number of characters, essentially just another table-fieldname in the output.
Hi friend,
I think already other friends have given a lot of information
Let me add a few of my opinion to it.
Just check whether there is space after the 70 character of the text.
Or see whether the window size can hold only up to 70 characters of text.
Try to increase the size of variable into which you are getting or declare it as string and process it.
I think this will solve your problem. If you face issues please revert back to us we will help you.
Thanks,
Sri Hari
Hi,
According to my knoledge you are trying to display text that has stored in s010 using dynmaic text screen......because you are using loop to write text header it is not comming properly....try to use READ_TEXT function module,pass the TEXT ID ,TEXT NAME to FM before calling smartform in print program might will give correct output.....
Thank you....
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.