Include text's paragraph format

Hi experts,
I have a include text in my smartforms. I'm using the smartform's form routine section to include this text, because my text is dinamically set up. After including it with the following code the paragraph and text formats are ignored. How could I apply my character and paragraph formats?
  CALL FUNCTION 'SSFRT_READ_INCLUDE_TEXT'
       EXPORTING
            I_TEXTKEY   = TEXTKEY
            I_LANGUAGES = ls_LANGUAGES
       IMPORTING
            O_LANGU     = LANGU
            O_TEXT      = lt_text
       EXCEPTIONS
            OTHERS      = 1.
  CHECK SY-SUBRC EQ 0.
  CALL FUNCTION 'SSFCOMP_CONVERT_ITF_TO_TOKEN'
       EXPORTING
            I_TEXT     = lt_TEXT
            I_NAME     = NAME
            I_LANGU    = 'H'
            I_TEXTTYPE = ''
       IMPORTING
            E_TOKEN = L_TOKEN.
  CALL FUNCTION 'SSFCOMP_WRITE_TEXT'
       EXPORTING
            NAME              = NAME
            LANGU             = LANGU
            STYLE             = STYLE
            STYLEVARI         = STYLEVARI
            TEXT              = L_TOKEN
            APPEND_MODE       = APP_MODE
            PROTECT           = PROTECT
            TEXTTYPE          = ''
       EXCEPTIONS
            NON_MAIN_OVERFLOW = 1
            OTHERS            = 2.

Okay, I've got the solution.  L_TOKEN contains the smartforms style. I have to set it according to my form.

Similar Messages

  • Script to add markers to text by paragraph format

    With previous versions of Framemaker, I had a FrameScript which would loop through my document and add a marker to text based on the paragraph format applied. The marker text would be the selected paragraph.
     I am now trying to recreate this in Extendscript for use in Framemaker 10 and am completely stumped. 
    I have no doubt that my script (copied below) is completely off-track, but I wondered if anybody would be able to help point me in the direction of my many mistakes.
    Basically, I want the script to find all paragraphs with the "*Part no." format applied, make that text the text range and then apply a marker to that range. A bit of research has shown that I probably need to create a list of paragraph formats, but I believe that I have far more problems than just that.
    var pgfFmt1 = flow.GetNamedPgfFmt (*Part no.);
    while (pgfFmt1.ObjectValid())  
        function createMarker (doc, pgf, offset, type, text)    {
            var tRange, marker;
            tRange = pgfFmt1.TextRange;
            marker = doc.NewAnchoredObject(Constants.FO_Marker, tRange);
            marker.MarkerType = type;
            marker.MarkerText = text;
            return 1;
    createMarker (doc, pgf, 0, "Index", 0);
    Many thanks in advance to anyone who is able to offer me some pointers!

    Well, it seems that my script is only 95% there. While my script finds the target paragraphs and adds a marker, only the first word of each paragraph is selected as the marker text. I really need the script to select the whole paragraph as the marker text. I have tried many combinations, but cannot seem to get the right outcome. Could anybody please point me in the right direction? Script is copied below. Many thanks!
    var doc = app.ActiveDoc;
    var flow = doc.MainFlowInDoc;
    var tframe = flow.FirstTextFrameInFlow;
    var pgf = tframe.FirstPgf;
    var target1 = doc.GetNamedObject(Constants.FO_PgfFmt, "*Part no.");
    var target2 = doc.GetNamedObject(Constants.FO_PgfFmt, "*Parent Bold");
    var target3 = doc.GetNamedObject(Constants.FO_PgfFmt, "*Child");
    var target4 = doc.GetNamedObject(Constants.FO_PgfFmt, "*Child indent");
    var target5 = doc.GetNamedObject(Constants.FO_PgfFmt, "*Child indent 2");
    while (pgf.ObjectValid())   {
    if (pgf.Name == target1.Name)   {
        createMarker (doc, pgf, 0, "Index", "");
    else if (pgf.Name == target2.Name)  {
        createMarker (doc, pgf, 0, "Subject", "");
    else if (pgf.Name == target3.Name)  {
        createMarker (doc, pgf, 0, "Subject", "");
    else if (pgf.Name == target4.Name)  {
        createMarker (doc, pgf, 0, "Subject", "");
    else if (pgf.Name == target5.Name)  {
        createMarker (doc, pgf, 0, "Subject", "");
    pgf = pgf.NextPgfInDoc;
    function createMarker(doc, pgf, offset, type, text) {
        var tLoc = new TextLoc(pgf, offset);
        var marker = doc.NewAnchoredObject(Constants.FO_Marker, tLoc);
        var markerType = doc.GetNamedObject(Constants.FO_MarkerType, type);
        marker.MarkerTypeId = markerType;
        marker.MarkerText = text;
        return 1;

  • For SAPscript INCLUDE TEXT, how to align as Paragraph format

    Hi experts and ABAP colleagues!
    Need your help on this sapscript problem:
    How to align texts taken from "INCLUDE TEXT" in SAPscript, according to tab defined in Paragraph Format?
    For example, I defined BG to have tabstop at the 2nd column (or equivalent to 1st tab position) where I need to print the text, and then declared it in SE71 like below:
    However the text prints at the leftmost instead of at the 2nd col position - (8th char tab defined in par. format BG).  Hence it is not aligned to its proper heading.  Line Number instead of Description - which is not okay for client view that needs these Thai texts. 
    The technical details I included below.  Kindly examine:
    1.)  Window >Main > Text Element > Include Text command
    /E   ITEM_TEXT
    BG   ,,&TTXIT-TDTEXT&
    /:   INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID&
    /:   NEW-PARAGRAPH BG
    Note:  I used command "NEW-PARAGRAPH" and had exactly the above code in se71.  Anything missed here?  Pls. help.  Thanks.
    #2.) Paragraph Format > Tab
    No. -
      Tab Position -
    Alignment
    1            8,00 CH            LEFT
    2            28,00 CH          CENTER
    etc.
    Note:   and then i put in  ",,&TTXIT-TDTEXT&" (see above) with the 2 comma's beforehand to say that its on the 1st tab or at the 8th character where it should be printed, but does not give intended result... pls help.
    #3.) Paragraph Formats > Standard Attributes
    Left Margin - 0 cm
    Alignment - Left
    no blank lines checkbox - ticked
    Note:  Is there any more attribute i can manipulate from here to force display at the right position?
    Thank you so much in advance for all your help.  Our project team will really appreciate it.  May the Lord bless you as we go through our SAP work!
    Sincerely,
    Celeste

    Here's a thought, instead of using tabs, try writing a method that takes a string that is the starting string, a pad character, and a length and returns a string padded to that length with the specified character.
    public String padR(String src, String padChar, int len)
        // ... You get to fill in the rest suggestion try to do it without a loop
    }Have fun,
    PS.

  • How to control formatting of include text in smartform

    Hello Everyone - I have converted sales order acknowledgements from sapscript to smartform. I need to print material sales text at line level. Include text method is being used, it works in most cases. However, in some cases the Std Paragraph format coded in the include text, is being ignored and the text prints as per default standard paragraph format defined in the smart style.
    The only difference I could find in the text set up, using read_text function, is that the format character for the first line. The desired formatting is achieved when the formatting character is '*', otherwise the format defaults to the standard default paragraph defined in the smart style.
    Could anyone suggest if there is a way to keep the paragraph formatting consistent and always use the formatting defined in the include text.
    Thanks in advance,
    Anil

    I have resolved this issue. The include text node was defined twice for the form and I had only assigned standard and first paragraph to one of them. The alignment error occured when the second include text was executed. Modified the second node to be same as the first and all worked as expected.

  • Smartforn Std text Paragraph format not getting picked up

    Hi,
       I have to include Standard texts from SO10 in my smart forms. I am using Incude Text option. The issue is that my std texts are dynamic ( I pass std text name in the form ) and hence it has many paragraph formats. When I run my form I get the result in default para format. If i create a para format in my style then it takes that in output but the issue is that the std texts are dynamica and can have many para formats. I cannot define all the para formats in my smartstyle and If i dont define in my style is does not pick the para format from std text. It works in script but not in smartforms. Pls help
    Thanks
    Abhinav

    <af:commandButton text="#{ad4jResBundle.JVM_TARGET_DELETE_MESSAGE12}" id="dummyB1"
                                        action="#{viewScope.TargetHandlerBean.destinationPage}" visible="false" clientComponent="true"></af:commandButton>
                  <af:resource type="javascript">
                    function customHandler(event) {
                        var exportCmd = AdfPage.PAGE.findComponentByAbsoluteId("emT:dummyB1");
                        alert(exportCmd);
                        var actionEvent = new AdfActionEvent(exportCmd);
                        actionEvent.forceFullSubmit();
                        actionEvent.noResponseExpected();
                        actionEvent.queue();
    When customHandler is called , it shows alert as "AdfRichCommandButton [oracle.adf.RichCommandButton] id=emT:dummyB1" so i guess it got the handle of button. but call to action - "#{viewScope.TargetHandlerBean.destinationPage}" never happens.
    Any idea what i am doing wrong?

  • Using paragraph format for long text...

    Hello,
    When I try to print the long text using include then
    it starts printing from the very first line.
    But I want to use some paragraph format for it. How can I use it because I am using
    /: INCLUDE '200007200000100' OBJECT AUFK ID KOPF
    So where do I mention the paragraph format in the tag column becaue I am already using /: controll command in font of the include ?

    Check this thread...
    SAPScript - Standard Text
    It looks like the PARAGRAPH P2 statement can do that declaration, on the subsequent line.
    This website also has some good examples:
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    Cheers,
    John

  • Character format on include text in smart form ??

    hello,
    i want to apply a character format on my include text, as we do on text elements .. how to apply it on include text ??
    thanks..

    Hey dude ,
    Just go to the <b>output option</b> of the text and include the smartstyle, where you have mentioned the required charecter format. Before doing this you should have activated your smartstyle .
    Your problem will be solved.
    Regards,
    Kunal.

  • Hw could copy a unformatted text from a formated paragraph

    Dear all,
    I am trying to copy an unformatted text from a formatted paragraph i have a code snippet, Please check it out and tell me that how can i copy a unformatted text from a paragraph. Result of this script should be a unformatted selected text...
    var par = app.selection[0].paragraphs[0];
        if (app.selection[0] instanceof InsertionPoint)
            if (par.characters[-1].contents != "\r")
                par.insertionPoints[-1].contents = "\r";
                par.characters.itemByRange(app.selection[0], par.insertionPoints[-1]).select();
                app.copy();
            else
                par.characters.itemByRange(app.selection[0], par.insertionPoints[-1]).select();
                app.copy();

    It's not the copy that 'removes' formatting, it's the paste that pastes without.
    Text can exist on the clipboard in any number of internal formats. It's possible to copy InDesign formatted text and paste it into a plain text editor -- so you won't get the formatting. But if you paste the same text again in InDesign, the formatting is still there.
    When copying, it's the responsibility of the copying program to put its copyable content in any useful format onto the global Clipboard.
    When pasting, a program should go through the list of supplied data formats (regardless of the source) and pick whatever it thinks is best. So, apparently, the usual Paste picks up InDesign "Native objects", while "Paste w/o Formatting" uses the plain (unformatted) text form.
    The only way to get an unformatted copy on the pasteboard would be to copy the string contents (raw ASCII characters) instead -- but InDesign's Javascript does not allow this. The app.copy() command only works on native InDesign objects.
    So, long story short, what you need can't be done.

  • Paragraph Formatting Shifts Text Down?

    In my page's column3 div if I format the text as paragraph, then the first line of text shifts down. Is this normal? Is there a way around it other than to be sure to format the text as none? I have it formatted none right now.
    http://www.kiefferfurniture.com/testcss.html

    Yes, it's normal in HTML because browsers apply default margins and padding to block level tags such as <p> (for paragraph).
    You can adjust any page formatting (such as unwanted whitespace caused by the default top margin in this instance) via the CSS (the stylesheet).
    So if you format that text as a paragraph, you add the following to the CSS.
    p {
         margin-top: 0;
    The above applies zero top margin to all <p> tags on the page. If that's not what you want then you can tweak the CSS rule to make it more specific.
    e.g.
    #column3 p { 
         margin-top: 0;
    only applies to <p> tags inside any HTML element with an attribute of id="column3" (in your case, the third column div).

  • How to perform a character protect when using include text in Script form?

    In my main window I have code as below:
    INCLUDE &GS_EKKO-EBELN& OBJECT EKKO ID F19 LANGUAGE EN
    INCLUDE &GS_EKKO-EBELN& OBJECT EKKO ID F19 LANGUAGE ZH
    There is nothing wrong with language zh but...
    For English,Every word at the end of line was splited
    EG:In text,It should be "I hate Sap script"
    But it is "I hate sap scr
                 ipt"
    I noticed that there is a protect in character which is used to prevent this,But text included is a command so I can't give them a character format.In default paragraph format there is only "para protect" which can't protect word but paragraph...
    I don't want to code in abap because I have static text and included long text appear alternatively,if coding,I will use so many text element one by one to loop the tdlines...
    So,If anyone can help me?
    Thanks~

    Thanks but
    If append tdlines...It would be
    /e Text element1
    xxxxxxxxxx
    /e tdlines1
    loop tdlines
    /e text element2
    xxxxxxx
    /e tdlines2
    loop tdlines
    /e text element3
    xxxxxx
    /e tdlines3
    loop tdlines
    Too many text element....
    Is there any other solution...?

  • TAB in paragraph format for Script

    hi,
    i am doubt with the tabs for paragraph format in the script. how actually it work? i try to make change on the tab, but some time even i put a larger value, the space in the output will become smaller, can anyone explain to me how the tab actually work?
    thanks

    Thanks you very much.
    but one more question, let say, if i have 3 tabs for an output.
    HARLO,,MY,,WORLD,,!
    any i configure the tabs as, 20, 30,15 all in CH
    so after the "HARLO, it will have 20 CH of spacing, follow by "MY", 30 spacing, and 'MY" 15 spacing, end with "!"?
    it this the way it works?
    or it works in accumulate way, which include the text display as well?
    i found in the forum, say that, it will fix the length of a field( if i display a field), even there is no any value in that field. so how does it work on this?
    alot of question very thansk for the temper.

  • How to include text

    hi i m working on smartform
    i want to include text
    for example
    <b>subject</b> : is text window
    i want to include text after colon in subject
    but include text is coming in new line
    now coming like below
    <b>subject:
    hi this is include txt</b>
    but i want like this
    b]subject: hi this is include txt</b>.
    so how can i do this please suggest me
    thanks in advanced.

    u can't  do that.
    only one way  also add  'subject to :' in standared text  than display standared text.
    one more way just store text in variable and  use this variable in smartforms.
    ph  'subject :' &variable&
    ph-paragraph format.
    kishan negi

  • Justify include text in Smartform

    Hi All,
    My requirement is to justify(not left, right or centre but to align the texts in the complete line of the page).
    I have done the following things:
    1) Created a style in which paragraph format is justified.
    2) Used the stylr in the include text.
    But still I am not getting the desired output.Am I missing something?
    Regards,
    Jeetu
    Edited by: Jeetu on May 26, 2008 6:27 PM

    what you are doin is only to be done..
    still to be more clear hopefully u r doin this only:
    create a desired style...activate it and then in you required text module in smartform..give the name of the style( in output option tab)..
    that is what needs to be done
    Thanks
    richa
    Edited by: Richa Khosla on May 26, 2008 2:05 PM

  • Indent /tab position for text from INCLUDE texts in SAPscript

    Hi, ABAP colleagues!
    Need your help on this sapscript problem:  How to align texts taken from "INCLUDE TEXT" in SAPscript, according to tab defined in Paragraph Format?
    Or, how to control tab positions for texts which were extracted from “INCLUDE text” commands in SAPscript?
    I defined a paragraph format with tab stop at 8 CH so that with 2 commas (,,) my text will be displayed there.  However it always appears to the left (e.g. 1st column) and not indented at the proper column for description/text (e.g. which is in second column). 
    Pls help, bec a different heading and information is not acceptable to client for the Thailand characters. 
    Above is the description of the problem.  Below are some technical details.
    For specific example, I am editing Zversion of standard sap MM form MEDRUCK Window Main -  Text Element Item Text.
    BG ,,&TTXIT-TDTEXT&
    /: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID&
    /: NEW-PARAGRAPH BG
    So far, tried these approaches:
    PARAGRAPH
    NEW-PARAGRAPH
    LANGUAGE '2'
    THANGSAN font
    Any ideas?
    Thank you so much in advance for all your help. Our project team will really appreciate it. May the Lord bless you as we go through our SAP work!
    Sincerely,     
    Celeste

    Hello Caleste,
    Please let me know what settings you have done to solve this issue.
    Help me with steps for Spool Request/Print settings.
    Regards!!
    Surya

  • Paragraph format in scripts

    hi experts,
    in scripts, in paragraph formats we have a tan called "outline".
    can any one help me to know abt that. plz give me what is the purpose of it, n how to implement that one. i mean how to use it.
    thanks in advance for ur responce.

    hi
    good
    The paragraph numbering and marking attributes are used to structure texts into chapters, subchapters, and sections. Numbering is carried out automatically by SAPscript.
    You can create an outline with the entry options available:
    Outline
    Enter the name of the highest-level paragraph in an outline hierarchy here. The outline hierarchy is created by assigning this paragraph to all outline paragraphs.
    Outline level
    Enter the level in the outline hierarchy. The outline levels of the paragraphs are numbered upwards from 1; the highest outline level therefore has the outline number 1.
    Number margin
    Specify the space between numbering and window border. Note that your numbering may extend into the text area of the paragraph if the difference between the left margin and the number margin is not great enough to hold the numbering characters.
    Left/right delimiter
    Specify the character that precedes or follows the numbering.
    Number chaining
    Specify whether you want the paragraph numbering of the paragraph to be preceded by the numbering of all higher paragraphs in the hierarchy.
    Example for number chaining
    with   without
    3.     3.
    3.1     1.
    3.2     2.
    3.2.1     1.
    Character string
    Specify the numbering format. The numbering can be assigned a different font or character format to the rest of the paragraph.
    Numbering type
    ARABIC
    Arabic numerals: 1, 2, 3.
    CHAR Fixed character: letter or numeral, entered in the field
    LETTER Letters: A-Z
    ROMAN Roman numerals: I, II, III, IV
    Depending upon the numbering type that you select, the following attributes may also apply:
    Fixed character
    Define the fixed character to be used for numbering. You should only make an entry in the field Fixed character if you have specified CHAR as the numbering type. Fixed characters include + - and o .
    Output length
    Enter the number of characters for Arabic numerals.
    Upper case
    Specify for letters or Roman numerals.
    check this link hope this will help you to solve your problem.
    http://abapprogramming.blogspot.com/2007/11/sap-script-controls-2.html
    thanks
    mrutyun^

Maybe you are looking for

  • PS created JPEG's won't open after being emailed

    first, apologies if this has been discussed here before, but the search on the adobe forums is dreadful at best, so i wasn't able to find the answer that way...now... i'm working in CS2 on the only Mac in my company of 100+ doing design work (print a

  • How do I change the workspace background color?

    Hi all, I need to change the workspace background color from the default mid grey. But I can't find how to do this! Any ideas! Thanks in advance, Pedro.

  • Loop in message mapping

    Hi all, I have a requirement and have been breaking my head on this . Source                              Target PO1 - 0 to 999999                   Idoc Segment(E1EDK2)    Item No(field)    SCH 0 to 999999 (Node)                     Here I have a Pa

  • HT201441 PLEASE HELP ive purchased a pre owned iphone 5s

    Purchased it off ebay was working fine then locked me out by previous owner i called the owner up but no answer or reply what can i do its saying the device is lost or stolen help please.

  • Multi-channel Audio Recording

    I am using a Canon XL1s and recording to 4 audio channels. On Location recognizes this and says it is capturing all 4 channels. But how do I access the 3/4 channels after recording? Channels 1/2 are the only ones that play back.