SAPscript to MS-Word

Hi all,
I am trying to optimize the layout of  our quotes and orders.   For this I am searching a way to give the data from the SAPscript into  MS-Word with using a normal.dot 
Can anybody tell me what is the best way to do this?
Thank you,

Hi,
I'm really confused by your question.
In what sense you want to optimize? I don't you can optimize anything by seding something from SAP to MS document.
But any way Script is used to print data in a specific format, alternatives are Smartforms and PDF.
If you want to write only data into MS document better write into Excel or note pad document by using OLE or function modules.
Regards
Surya.

Similar Messages

  • Convert SAPScript output into Word document (.doc)

    Hi,
    I want to convert the output of sapscript into the word document. Will u pls. suggest the appropriate way to achieve it.
    We have a Function Module which converts the ouput in to the PDF and RTF format. Is dere a possibility to convert it into the DOC file.
    Thanks,
    Hitz

    hi ,
    Use ABAP program: RSTXSCRP
    It will download and upload your sapscripts as a text file in your local harddisk.
    when u execute that program ,one screen appears.there u have to enter the directory path and the name of the upload or download file. Use the naming conventions of the file system where the file is located.
    File system Example
    Windows, DOS d:\tmp\text.rtf
    Unix /usr/sap/c11/SYS/global/text.rtf
    When uploading, the data in the file is transported into the SAP System. When downloading, the data is stored in the file by the SAP System.
    If you are working on a PC, enter a file that is located on a hard disk or a disk of the PC.  If the PC is connected to a network, or if you are on a workstation, you can specify a file on a remote disk.
    and for converting the output in to PDF format use the function module CONVERT_OTF.
    u can use these function modules to convert the script.
    SX_OBJECT_CONVERT_OTF_PDF Conversion From OTF to PDF (SAPScript conversion)
    SX_OBJECT_CONVERT_OTF_PRT Conversion From OTF to Printer Format (SAPScript conversion)
    SX_OBJECT_CONVERT_OTF_RAW Conversion From OTF to ASCII (SAPScript conversion)
    i think  there is no such function module to convert script out put into DOC format.
    Reward points if useful.
    Thanks,
    Usha
    Message was edited by:
            usha

  • How to stop sapscript calling MS word when I want to edit the elemets...

    Hello Experts,
    In SE71, when I want to edit the element/codes of a particular window, I click on the 'edit text elements'
    window but it calls MS word and the code is displayed there. I want the 'original' editor
    wherein I can see the '/E', '=', etc.

    HI,
    In the EDIT menu , there should be a change editor option..... dont you have it ? If it is not there..... then i am not sure what to do further...
    regards,
    Venkatesh

  • How to debug script

    1) i heard that we have to put layout in debug mode and then go to print program and execute it also in debug mode.
    am i right?
    2)where do we check like compilation errors in layoutset.

    One way to start the script debugger is:
    Se71->utilities->activate debugger.
    This may be a time-consuming process. Instead, open a session and execute the program RSTXDBUG. Even if you follow the above menu path to activate the script, it will internally execute the program RSTXDBUG. So you are saving some time in going through all of the above processes.
    2. Generally SAP script contains the Layout and corresponding print program.
    First go to SE71 and enter ur script name. In the same screen go to Utilities->click on activate debugger option.
    Now go to SE 38 and enter ur Print Program name and execute the program.
    Now you can debug the script Page wise and window wise.
    RSTXDBUG - SAPScript debugger
    Debug SAPScript
    You can debug a SAPScript: Use Tools - Word Processing - Layout Set.
    Enter name of layout set and then Utilities - Activate Debugger.
    It is of no consequence which layout set you enter when selecting the SAPscript debugger. (Menu path: Tools-Word-processing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).
    Another way to set the SAPScript debugger is to run program RSTXDBUG.
    When a Form is copied from one client to another .And If U try to display or change the form in the copied client .The possible error message cud be :
    1.Form not found
    Try coping again specifing the language .
    2.IF IT dispalys an error message saying That the text file is inconsistent .
    Then go to SE38 and Run “RSTXCHKO” .
    It will ask for the form name ,then check all the checkboxes and then run the program.
    Note : all Script related problems can be solved using Program ‘RSTX*’.
    Reward points if this Helps.
    sanjay

  • Amount in words in F110 (sapscript -indian format)

    Hi Experts.
    I have changed the F110_PRENUM_CHCK to Z110_PRENUM_CHCK .
    I want the amount to be in word in indian format.
    say Ten Lakh ninty thousand and fifty
    But i am getting the output in "One millon .. " format
    Pls give me the coding and also suggest me how to incorporate in sapscript .
    Window CHECKSPL
    545
    Amount in words -
    &'*** 'SPELL-WORD& &' and 'SPELL-DECWORD&***
    Example for amount and decimal places in words
    &'*** 'SPELL-WORD& &REGUD-WAERS&&' and 'SPELL-DECWORD' Cents'& ***
    Example for numbers in words
    &SPELL-DIG06(6)&&SPELL-DIG05(6)&&SPELL-DIG04(6)&&SPELL-DIG03(6)&&SPELL-DIG02(6)&&SPELL-DIG01(7)&
    Pls revert back its urgent
    Thanks
    Pravesh Deshbhratar

    same code i used in smartform:
    DATA : l_spell_a TYPE pc207-betrg,
    l_local   TYPE string,
    w_len     TYPE i.
    * Internal Table Declaration
    DATA : BEGIN OF t_char OCCURS 0,
    char(80) TYPE c,
    END OF t_char.
    l_spell_a = l_amtsum.
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
    amt_in_num         = l_spell_a
    IMPORTING
    amt_in_words       = l_spell
    EXCEPTIONS
    data_type_mismatch = 1
    OTHERS             = 2.
    IF sy-subrc = 0.

  • Including a Word document within a SAPscript?

    We currently have a SAPscript that pulls a text document from document
    management and prints it in the middle of  a SAPscript.
    Does anyone know if there is a way I could do the same thing with a Word document instead?  If so, please let me know if there is a way to do it.
    Thanks.
    Mike

    Hi
    This link will help you in your requirement
    Printing documents - document management
    Regards
    Raj

  • Sapscript - Repited spaces between words

    Hi friends.
    I'm working on a ZMEDRUCK sapscript and when printing a line item, the item text (field EKPO-TXZ01) is being printed with spaces between words.
    E.g.:
    Original value in EKPO-TXZ01: material test.
    Printed: material      ...(two or more spaces)...       test.
    This also happened with other text variable, but stopped happen when I formated with <K> text </>.
    But in this case, its not working. I'm using standard IT Paragraph format.
    What to do to take out the repited spaces ?
    Edited by: Glauco Kubrusly on Mar 24, 2011 5:02 PM
    Edited by: Glauco Kubrusly on Mar 25, 2011 4:27 PM

    Hi Atul.
    I have already tested (C) statement in this variable and performs too.
    There are more texts with same problem. Literal words have same problem too in address in the header.
    I've already tryied copting standards paragraphs too, but without sucess.
    A friend concultant said to me to make a test with a new paragraph with LEFT alignment only and LEFT alignment to all tabulators. I'll try that once and give feedback here.
    Any other idea ?
    thanks.
    Glauco
    Edited by: Glauco Kubrusly on Mar 27, 2011 10:16 PM

  • BC - Word-Processing in the SAPscript Editor

    Hi,
    Could anyone tell me how the Link functionality in the SAPscript Editor is working?
    Regards,
    Morten

    Thanks.  Well there's a little bit of doco at:
    http://help.sap.com/saphelp_nw04/helpdata/en/a4/d47f0f49e111d189730000e8322d00/frameset.htm
    but basically the "link" option calls function 'DOCU_LINK_BUILD' which allows you to create a "hyperlink" to another document e.g. in the editor you could type
    here is a link
    and put your cursor on the word "link" and chose Insert  > Link, and in the popup identify that you want it to go to (say) program ZLOCAL_JC_SDN_PROG2, and the following will be inserted in your SAPScript editor:
    <DS:RE.ZLOCAL_JC_SDN_PROG2>link</>
    and when you display this documentation you see the work "link" highlighted.
    Is this the sort of info you needed?
    Jonathan
    (there should be a slash showing in the angle brackets after the "link" word in the example above)

  • Attachment of Word/PDF to Sapscript layout

    Hello everyone,
    Need some help regarding attachment of document in script.
    I know that we can convert the ouput of a SAPscript form to a PDF in a mail attachment or a spool.
    But what we require is attaching a word/pdf document to an existing SAPscript so we can print it at the end of the existing SAPscript layout as terms & conditions.
    Has anyone does this before? I know how to upload word documents in ole and in document management, but am unsure if its possible to add it to a layout. We can add bmp/tiff files, but pdf files??
    Please advise! Thank you in advance.
    Regards,
    Ketaki

    Hi Rich
    Great to hear that someone has already solved the challenge we are facing now.
    We have to print some PDF’s which are stored in iXOS archiving system and linked with archive link to a SD invoice.
    Is it possible you describe a bit more detailed your solution and if possible you send a copy of the coding to me.
    Thanks in advance.
    Walter Wohlgemuth

  • Merging SAPscript documentation into an MS WORD document

    Dear gurus,
    our SAP add-on products are consisting of quite a lot of single programs each that we are maintaining and translating the standard SAPscript documentation for.
    Separately we maintain and translate manuals for our products in MS WORD where we add a lot of screenshots from our applications.
    To a certain extent the maintenance of the texts as well as their translation is double work that we would love to get rid off. Downloading texts from SAPscript to RTF/PDF/ASCII does not seem to offer any real solution to our "synchronization" problem. The same goes for ideas (that were already brought up) like writing VBA-functions to retrieve data from SAP (we don't have too much VBA know-how in our company and we do not want to program our a...s off for that). Does anybody have a good idea how we could achieve that?
    Thanks a lot in advance
    Andreas

    Open the PDF in Acrobat and use File > Properties.
    Go to Security.
    Change to "No security" - here is where you will enter the control
    password.
    Now save the file.
    This unprotected file can now be copied and pasted etc.
    Aandi Inston

  • Amount in words display Problem in sapscript

    Hi All,
    I am worked on cheque print out. I have an amount in words u2018nine crore seventy two lakh thirty three thousand nine hundred ninety nine rupees fifty eight paise onlyu2019 based on the amount value, I have a number of character 105. How will u split the character 50 and 55 character?

    Hi,
    Try this code
    First 50 characters will be in first line of OUT_LINES. Remaining you can concatenate from line 2 and 3
    DATA : OUT_LINES TYPE TABLE OF STRING.
    CALL FUNCTION 'RKD_WORD_WRAP'
      EXPORTING
        TEXTLINE                  = 'nine crore seventy two lakh thirty three thousand nine hundred ninety nine rupees fifty eight paise only'
    *   DELIMITER                 = ' '
        OUTPUTLEN                 = 50
    * IMPORTING
    *   OUT_LINE1                 =
    *   OUT_LINE2                 =
    *   OUT_LINE3                 =
    TABLES
       OUT_LINES                 = OUT_LINES
    * EXCEPTIONS
    *   OUTPUTLEN_TOO_LARGE       = 1
    *   OTHERS                    = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Text Printing in Purchase Order SapScript

    Hi Abapers,
    I am chaniging an existing SapScript that was not working properly. Client wants to print "Item Text" in output which is of 3 to 4 page. where as there is only one line item in PO. Also there is "Header Text"  of 1 page. Client wants to display all line items then "Item Text" should displayed. and at last the "eader Text". The Format is Like as Follows:-
    PO No.                           12.12.2006
    Vendor Name
    Country
    S.No.     Mat. Desc.                          Qty. ...............and so on..........
    1            abc                                    11 .....................
    Item Text starts from here........................
    Problem is here
    This text is of 3 page (say).
    So text starts from here and est of text goes to next page.
    Only 4 Lines are printed properly and rest of lines are not printed.
    I also checked in debuging mode.
    so attachibng the code for reference kindly go through this.
    Header Text Starts from here
       Total amt.  in words......
    *******************************8Code**************************************
      IF &NEXTPAGE& EQ 0
      PROTECT
      PERFORM READ_TEXTS IN PROGRAM ZPERFORMS_ZMEDRUCK1
      USING &EKKO-EBELN&
      CHANGING &WRK_IT1&
      CHANGING &WRK_IT2&
      CHANGING &WRK_IT3&
      CHANGING &WRK_IT4&
      CHANGING &WRK_IT5&
      CHANGING &WRK_IT6&
      CHANGING &WRK_IT7&
      CHANGING &WRK_IT8&
      CHANGING &WRK_IT9&
      CHANGING &WRK_IT10&
      CHANGING &WRK_IT11&
      CHANGING &WRK_IT12&
      ENDPERFORM
      PROTECT
      IF &WRK_IT1& NE ' '
      <S>&WRK_IT1&</>
      ENDIF
      IF &WRK_IT2& NE ' '
      <S>&WRK_IT2&</>
    and so on..............
    then i also go to the Calling program.
    FORM READ_TEXTSLO1 TABLES IN_TAB200  STRUCTURE ITCSY
                           OUT_TAB200 STRUCTURE ITCSY.
      READ TABLE IN_TAB200 INDEX 1.
      EBELN1 = IN_TAB200-VALUE.
      READ TABLE IN_TAB200 INDEX 2.
      EBELP = IN_TAB200-VALUE.
      CONCATENATE EBELN1 EBELP INTO OBJNAME.
      CLEAR WRK_IT1.
      CLEAR WRK_IT2.
      CLEAR WRK_IT3.
      CLEAR WRK_IT4.
      CLEAR WRK_IT5.
      CLEAR WRK_IT6.
      CLEAR WRK_IT7.
      CLEAR WRK_IT8.
      CLEAR WRK_IT9.
      CLEAR WRK_IT10.
      CLEAR WRK_IT11.
      CLEAR WRK_IT12.
      CLEAR WRK_IT13.
      CLEAR WRK_IT14.
      CLEAR WRK_IT15.
      CLEAR WRK_IT16.
      CLEAR WRK_IT17.
      CLEAR WRK_IT18.
      CLEAR WRK_IT19.
      CLEAR WRK_IT20.
      CLEAR WRK_IT21.
      CLEAR WRK_IT22.
      CLEAR WRK_IT23.
      CLEAR WRK_IT24.
      CLEAR WRK_IT25.
      CLEAR WRK_IT26.
      CLEAR WRK_IT27.
      CLEAR WRK_IT28.
      CLEAR WRK_IT29.
      CLEAR WRK_IT30.
      CLEAR WRK_IT31.
      CLEAR WRK_IT32.
      CLEAR WRK_IT33.
      CLEAR WRK_IT34.
      CLEAR WRK_IT35.
      CLEAR WRK_IT36.
      CLEAR WRK_IT37.
      CLEAR WRK_IT38.
      CLEAR WRK_IT39.
      CLEAR WRK_IT40.
      CLEAR WRK_IT41.
      CLEAR WRK_IT42.
      CLEAR WRK_IT43.
      CLEAR WRK_IT44.
      CLEAR WRK_IT45.
      CLEAR WRK_IT46.
      CLEAR WRK_IT47.
      CLEAR WRK_IT48.
      CLEAR WRK_IT49.
      CLEAR WRK_IT50.
      CLEAR WRK_IT51.
      CLEAR WRK_IT52.
      CLEAR WRK_IT53.
      CLEAR WRK_IT54.
      CLEAR WRK_IT55.
      CLEAR WRK_IT56.
      CLEAR WRK_IT57.
      CLEAR WRK_IT58.
      CLEAR WRK_IT59.
      CLEAR WRK_IT60.
      CLEAR WRK_IT61.
      CLEAR WRK_IT62.
      CLEAR WRK_IT63.
      CLEAR WRK_IT64.
      CLEAR WRK_IT65.
      CLEAR WRK_IT66.
      CLEAR WRK_IT67.
      CLEAR WRK_IT68.
      CLEAR WRK_IT69.
      CLEAR WRK_IT70.
      CLEAR WRK_IT71.
      CLEAR WRK_IT72.
      CLEAR WRK_IT73.
      CLEAR WRK_IT74.
      CLEAR WRK_IT75.
      CLEAR WRK_IT76.
      CLEAR WRK_IT77.
      CLEAR WRK_IT78.
      CLEAR WRK_IT79.
      CLEAR WRK_IT80.
    break abap7.
    ITEM TEXT.
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
        WHERE TDOBJECT = 'EKPO'
        AND TDNAME = OBJNAME
        AND TDID EQ 'F01'.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F01'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
        IF SY-SUBRC = 0.
         delete it_line where tdline EQ ' '.
    BREAK ABAP7.
         DESCRIBE TABLE it_line LINES wrk_lines1.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
            Y = STRLEN( WRK_TDLINE ).
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 100
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *break abap7.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT1 = OUT_LINE1.
              WHEN 2 .
                WRK_IT2 = OUT_LINE1.
              WHEN 3 .
                WRK_IT3 = OUT_LINE1.
              WHEN 4 .
                WRK_IT4 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT4 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
              wrk_it4 = out_line1.              " Change Uncommented"
              WRK_ITA = OUT_LINE1.
              WRK_ITA4 = OUT_LINE2.
            ELSE.
              WRK_ITA = WRK_TDLINE.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR WRK_TDLINE.
        CLEAR OUT_LINE1.
        CLEAR OUT_LINE2.
        CLEAR OUT_LINE3.
        OUT_TAB200-VALUE = WRK_IT1.
        MODIFY OUT_TAB200 INDEX 1 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT2.
        MODIFY OUT_TAB200 INDEX 2 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT3.
        MODIFY OUT_TAB200 INDEX 3 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT4.
        MODIFY OUT_TAB200 INDEX 4 TRANSPORTING VALUE.
      ENDIF.
    break abap7.  """"""""""""""""""''
      CLEAR IT_LINE.
      REFRESH IT_LINE.
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
         WHERE TDOBJECT = 'EKPO'
         AND TDNAME = OBJNAME
         AND TDID EQ 'F02'.
      IF SY-SUBRC = 0.
    break abap7.  """"""""""""""""""''
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F02'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
         DESCRIBE TABLE it_line LINES wrk_lines2.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE.
            ENDIF.
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 50
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT5 = OUT_LINE1.
              WHEN 2 .
                WRK_IT6 = OUT_LINE1.
              WHEN 3 .
                WRK_IT7 = OUT_LINE1.
              WHEN 4 .
                WRK_IT8 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT8 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
           wrk_it8 = out_line1.
              WRK_ITB = OUT_LINE1.
              WRK_ITB8 = OUT_LINE2.
            ELSE.
              WRK_ITB = WRK_TDLINE.
            ENDIF.
          ENDIF.
          CLEAR WRK_TDLINE.
          CLEAR OUT_LINE1.
          CLEAR OUT_LINE2.
          CLEAR OUT_LINE3.
          MODIFY OUT_TAB200 INDEX 5 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT6.
          MODIFY OUT_TAB200 INDEX 6 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT7.
          MODIFY OUT_TAB200 INDEX 7 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT8.
          MODIFY OUT_TAB200 INDEX 8 TRANSPORTING VALUE.
        ENDIF.
      ENDIF.
      CLEAR IT_LINE.
      REFRESH IT_LINE.
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
        WHERE TDOBJECT = 'EKPO'
        AND TDNAME = OBJNAME
        AND TDID EQ 'F03'.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F03'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE.
            ENDIF.
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 50
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT9 = OUT_LINE1.
              WHEN 2 .
                WRK_IT10 = OUT_LINE1.
              WHEN 3 .
                WRK_IT11 = OUT_LINE1.
              WHEN 4 .
                WRK_IT12 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT12 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
           wrk_it12 = out_line1.
              WRK_ITC = OUT_LINE1.
              WRK_ITC12 = OUT_LINE2.
            ELSE.
              WRK_ITC = WRK_TDLINE.
            ENDIF.
          ENDIF.
          CLEAR WRK_TDLINE.
          CLEAR OUT_LINE1.
          CLEAR OUT_LINE2.
          CLEAR OUT_LINE3.
          OUT_TAB200-VALUE = WRK_IT9.
          MODIFY OUT_TAB200 INDEX 9 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT10.
          MODIFY OUT_TAB200 INDEX 10 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT11.
          MODIFY OUT_TAB200 INDEX 11 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT12.
          MODIFY OUT_TAB200 INDEX 12 TRANSPORTING VALUE.
        ENDIF.
      ENDIF.
      CLEAR IT_LINE.
      REFRESH IT_LINE.
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
        WHERE TDOBJECT = 'EKPO'
        AND TDNAME = OBJNAME
        AND TDID EQ 'F04'.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F04'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE.
            ENDIF.
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 50
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT13 = OUT_LINE1.
              WHEN 2 .
                WRK_IT14 = OUT_LINE1.
              WHEN 3 .
                WRK_IT15 = OUT_LINE1.
              WHEN 4 .
                WRK_IT16 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT16 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
           wrk_it16 = out_line1.
              WRK_ITD = OUT_LINE1.
              WRK_ITD16 = OUT_LINE2.
            ELSE.
              WRK_ITD = WRK_TDLINE.
            ENDIF.
          ENDIF.
          CLEAR WRK_TDLINE.
          CLEAR OUT_LINE1.
          CLEAR OUT_LINE2.
          CLEAR OUT_LINE3.
          OUT_TAB200-VALUE = WRK_IT13.
          MODIFY OUT_TAB200 INDEX 13 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT14.
          MODIFY OUT_TAB200 INDEX 14 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT15.
          MODIFY OUT_TAB200 INDEX 15 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT16.
          MODIFY OUT_TAB200 INDEX 16 TRANSPORTING VALUE.
        ENDIF.
      ENDIF.
      CLEAR IT_LINE.
      REFRESH IT_LINE.
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
       WHERE TDOBJECT = 'EKPO'
       AND TDNAME = OBJNAME
       AND TDID EQ 'F05'.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F05'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE.
            ENDIF.
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 50
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT17 = OUT_LINE1.
              WHEN 2 .
                WRK_IT18 = OUT_LINE1.
              WHEN 3 .
                WRK_IT19 = OUT_LINE1.
              WHEN 4 .
                WRK_IT20 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT20 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
           wrk_it20 = out_line1.
              WRK_ITE = OUT_LINE1.
              WRK_ITE20 = OUT_LINE2.
            ELSE.
              WRK_IT20 = WRK_TDLINE.
            ENDIF.
          ENDIF.
          CLEAR WRK_TDLINE.
          CLEAR OUT_LINE1.
          CLEAR OUT_LINE2.
          CLEAR OUT_LINE3.
          OUT_TAB200-VALUE = WRK_IT17.
          MODIFY OUT_TAB200 INDEX 17 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT18.
          MODIFY OUT_TAB200 INDEX 18 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT19.
          MODIFY OUT_TAB200 INDEX 19 TRANSPORTING VALUE.
          OUT_TAB200-VALUE = WRK_IT20.
          MODIFY OUT_TAB200 INDEX 20 TRANSPORTING VALUE.
        ENDIF.
      ENDIF.
      OUT_TAB200-VALUE = WRK_ITA.
      MODIFY OUT_TAB200 INDEX 81 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITB.
      MODIFY OUT_TAB200 INDEX 82 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITC.
      MODIFY OUT_TAB200 INDEX 83 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITD.
      MODIFY OUT_TAB200 INDEX 84 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITE.
      MODIFY OUT_TAB200 INDEX 85 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITA4.
      MODIFY OUT_TAB200 INDEX 86 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITB8.
      MODIFY OUT_TAB200 INDEX 87 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITC12.
      MODIFY OUT_TAB200 INDEX 88 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITD16.
      MODIFY OUT_TAB200 INDEX 89 TRANSPORTING VALUE.
      OUT_TAB200-VALUE = WRK_ITE20.
      MODIFY OUT_TAB200 INDEX 90 TRANSPORTING VALUE.
      CLEAR IT_LINE.
      REFRESH IT_LINE.
    ENDFORM.                    "read_textslo1
    So kindly review this and let me know what should i do ?
    Helpful answer rewarded.
    Regards
    Robin

    It is very confusing to read your code. If possible please post it in
    block formatted properly.
    If I read it right, looks like you have your texts in PROTECT ENDPROTECT block. If that is the case, then your text will not be written in multiple pages because the PROTECT ENDPROTECT statements will try to fit all the text on one page.
    Hope that helps.
    Regards,
    -Ramesh

  • Box in Long text of sapscript

    Hi All,
    I have  created a script.....in that i have to print  only long text in the main window.
    Now my problem is...the LONG text is breaking and going to next page...
    means a part on 1 page and remaining  on subsequent pages..
    And the problem is the box which i have put arround the main window is coming only in first page and last page .  In between pages the box arround the main window is not coming .
    How to get the box around those pages also.
    help me out...
    Thanks,
    Guru

    Hi
    The property of MAIN window is like that, If the Data is more than a Page it automatically goes to next pages.
    So better decide where I mean in which you wants to print ? In MAin window , then it automatcially goes to other pages. use a new paragraph format and mention PAGE PROTECTION for that such that it prints in the Same page.
    For the boxes see the seetings of the main window in all pages, especially in NEXT page.. so that the box is coming properly
    see the box related commands
    SAPScripts
    POSITION WINDOW
    SIZE WIDTH '160' MM HEIGHT '140' MM
    BOX FRAME 10 TW
    Box
    BOX HEIGHT '11' MM WIDTH '160' MM FRAME 10 TW INTENSITY 35
    linessssssss
    BOX XPOS '20' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '45' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '80' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '120' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    Boxes, Lines, Shading: BOX, POSITION, SIZE
    Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
    The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
    Syntax:
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX Command
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
    XPOS, YPOS
    Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    WIDTH
    Width of the box. Default: WIDTH value of the SIZE command.
    HEIGHT
    Height of the box. Default: HEIGHT value of the SIZE command.
    FRAME
    Thickness of frame.
    Default: 0 (no frame).
    INTENSITY
    Grayscale of box contents as %.
    Default: 100 (full black)
    Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    TW (twip)
    PT (point)
    IN (inch)
    MM (millimeter)
    CM (centimeter)
    LN (line)
    CH (character).
    The following conversion factors apply:
    1 TW = 1/20 PT
    1 PT = 1/72 IN
    1 IN = 2.54 CM
    1 CM = 10 MM
    1 CH = height of a character relative to the CPI specification in the form header
    1 LN = height of a line relative to the LPI specification in the form header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shading having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION Command
    Syntax
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    XORIGIN, YORIGIN
    Origin of the coordinate system.
    WINDOW
    Sets the values for the left and upper edges to match those of the current window (default setting).
    PAGE
    Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE Command
    Syntax
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    WIDTH, HEIGHT
    Dimensions of the rectangle or line.
    WINDOW
    Sets the values for the width and height to the values of the current window (default setting).
    PAGE
    Sets the values for the width and height to the values of the current output page.
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Text printing in SapScript

    Hi Abapers,
    I am chaniging an existing SapScript that was not working properly. Client wants to print "Item Text" in output which is of 3 to 4 page. where as there is only one line item in PO. Also there is "Header Text"  of 1 page. Client wants to display all line items then "Item Text" should displayed. and at last the "eader Text". The Format is Like as Follows:-
    PO No.                           12.12.2006
    Vendor Name
    Country
       S.No.     Mat. Desc.                          Qty. ...............and so on..........
       1            abc                                    11 .....................
    Item Text starts from here........................
    Problem is here
    This text is of 3 page (say).
    So text starts from here and est of text goes to next page.
    Only 4 Lines are printed properly and rest of lines are not printed.
    I also checked in debuging mode.
    so attachibng the code for reference kindly go through this.
    Header Text Starts from here
       Total amt.  in words......
    FORM READ_TEXTSLO1 TABLES IN_TAB200  STRUCTURE ITCSY
                           OUT_TAB200 STRUCTURE ITCSY.
      READ TABLE IN_TAB200 INDEX 1.
      EBELN1 = IN_TAB200-VALUE.
      READ TABLE IN_TAB200 INDEX 2.
      EBELP = IN_TAB200-VALUE.
      CONCATENATE EBELN1 EBELP INTO OBJNAME.
      CLEAR WRK_IT1.
      CLEAR WRK_IT2.
      CLEAR WRK_IT3.
      CLEAR WRK_IT4.
      CLEAR WRK_IT5.
      Repeated Code
      SELECT SINGLE TDNAME INTO WRK_TDNAME FROM STXH
        WHERE TDOBJECT = 'EKPO'
        AND TDNAME = OBJNAME
        AND TDID EQ 'F01'.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            CLIENT   = SY-MANDT
            ID       = 'F01'
            LANGUAGE = 'E'
            NAME     = OBJNAME
            OBJECT   = 'EKPO'
          TABLES
            LINES    = IT_LINE.
        IF SY-SUBRC = 0.
         delete it_line where tdline EQ ' '.
    BREAK ABAP7.
         DESCRIBE TABLE it_line LINES wrk_lines1.
          LOOP AT IT_LINE.
            CLEAR WRK_TABIX.
            WRK_TABIX = SY-TABIX.
            IF WRK_TDLINE EQ ' '.
              WRK_TDLINE = IT_LINE-TDLINE.
            ELSE.
              CONCATENATE  WRK_TDLINE IT_LINE-TDLINE INTO  WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
            Y = STRLEN( WRK_TDLINE ).
            CALL FUNCTION 'RKD_WORD_WRAP'
                   EXPORTING
                     TEXTLINE                  = WRK_TDLINE
                     DELIMITER                 = ' '
                     OUTPUTLEN                 = 100
                  IMPORTING
                    OUT_LINE1                 = OUT_LINE1
                    OUT_LINE2                 = OUT_LINE2
                    OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *break abap7.
            CASE WRK_TABIX.
              WHEN 1 .
                WRK_IT1 = OUT_LINE1.
              WHEN 2 .
                WRK_IT2 = OUT_LINE1.
              WHEN 3 .
                WRK_IT3 = OUT_LINE1.
              WHEN 4 .
                WRK_IT4 = OUT_LINE1.
            ENDCASE.
            IF OUT_LINE3 EQ ' '.
              WRK_TDLINE = OUT_LINE2.
            ELSE.
              CONCATENATE OUT_LINE2 OUT_LINE3 INTO WRK_TDLINE
              SEPARATED BY SPACE.
            ENDIF.
          ENDLOOP.
          IF WRK_IT4 NE ' '.
            Y = STRLEN( WRK_TDLINE ).
            IF Y GT 50.
              CALL FUNCTION 'RKD_WORD_WRAP'
                       EXPORTING
                         TEXTLINE                  = WRK_TDLINE
                         DELIMITER                 = ' '
                         OUTPUTLEN                 = 50
                      IMPORTING
                        OUT_LINE1                 = OUT_LINE1
                        OUT_LINE2                 = OUT_LINE2
                        OUT_LINE3                 = OUT_LINE3
              OUT_LINE3                 =
            TABLES
              OUT_LINES                 =
            EXCEPTIONS
              OUTPUTLEN_TOO_LARGE       = 1
              OTHERS                    = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
              wrk_it4 = out_line1.              " Change Uncommented"
              WRK_ITA = OUT_LINE1.
              WRK_ITA4 = OUT_LINE2.
            ELSE.
              WRK_ITA = WRK_TDLINE.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR WRK_TDLINE.
        CLEAR OUT_LINE1.
        CLEAR OUT_LINE2.
        CLEAR OUT_LINE3.
        OUT_TAB200-VALUE = WRK_IT1.
        MODIFY OUT_TAB200 INDEX 1 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT2.
        MODIFY OUT_TAB200 INDEX 2 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT3.
        MODIFY OUT_TAB200 INDEX 3 TRANSPORTING VALUE.
        OUT_TAB200-VALUE = WRK_IT4.
        MODIFY OUT_TAB200 INDEX 4 TRANSPORTING VALUE.
      ENDIF.
    *****************************************************************Repeated code
    Again the same code is repeated but now the TDID eq F02 in Select Query and also in READ_TEXT  Fun. Module. and now in the CASE statement next 4 lines coded as
    WHEN 1 .
                WRK_IT5 = OUT_LINE1.
              WHEN 2 .
                WRK_IT6 = OUT_LINE1.
              WHEN 3 .
                WRK_IT7 = OUT_LINE1.
              WHEN 4 .
                WRK_IT8 = OUT_LINE1.
    and also these 4 rows modified as follows
    OUT_TAB200-VALUE = WRK_IT5.
          MODIFY OUT_TAB200 INDEX 5 TRANSPORTING VALUE.
    Now each time 4 - 4 rows coded as like as above.
    upto TDID = F05
    So there are total of 20 lines.
    Now the text is of 4 to 5 page then its not printed. even 5th line is not printed. control not goes to 2nd Select Query cause the OBJECTNAME does not exist.
    <b>for more information write your Email ID . So that i can explain more.</b>
    So kindly review this and let me know what should i do ?
    Helpful answer rewarded.
    Regards
    Robin

    hi,
    <b>SAP SCRIPTS TUTORIALS</b>
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRRDI/BCSRVSCRRDI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCREDIT/BCSRVSCREDIT.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://www.esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    SAP Script From the Scratch
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html
    http://www.sap-img.com/sapscripts.htm
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    http://sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html
    http://www.esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://www.esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://www.esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://www.esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://www.esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf.
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    Rgds
    Anver
    <b><i>if hlped pls mark points</i></b>

  • Problem with Purchase Order Form - SAPscript

    I have a custom purchase order form (Z_MEDRUCK) created using SAPscript. The address paragraph looks like this:
    ADDRESS PARAGRAPH AS
       TITLE        &LFA1-ANRED&
       NAME         &LFA1-NAME1&, &LFA1-NAME2&
       STREET       &LFA1-STRAS&
       LOCATION     &STR_SUPPL1&
       POBOX        &LFA1-PFACH& CODE &LFA1-PSTL2&
       CITY         &LFA1-ORT01&, &LFA1-ORT02&
       POSTCODE     &LFA1-PSTLZ&
       COUNTRY      &LFA1-LAND1&
       REGION       &LFA1-REGIO&
       FROMCOUNTRY  &T001-LAND1&
    ENDADDRESS
    When the Purchase Order Form is printed, if a POBOX exists, it is used instead of the STREET.  I did not write the SAPscript or any code involved with it.  I would like the POBOX to only be used if a STREET does not exist. 
    Where would the logic to use POBOX exist?  I have stepped through ME_PRINT_PO and have found nothing. Any ideas?
    Thank You.

    After the word ADDRESS, add DELIVERY.  This should make a physical street address take priority.
    ADDRESS DELIVERY PARAGRAPH AS

Maybe you are looking for

  • Why no screen info in status??

    Hello everybody, I just ran a std program: balvex01 and the selection scree (no. 1000) came up. then I hit F8 (execute button) to see the alv. but why was I not able to see the screen no for this alv in the system->status menu? What is the screen whe

  • Click-Ads and MacKeeper invading all my browsing! I'm losing my mind

    Hi, I have a MacBook Air purchased last year and all has been fine but recently all my browsers have been under attack from ads. They open as new tabs when i click on anything on a page i'm browsing and the main culprit is something called MacKeeper.

  • Web Camera Model Number

    Hi, I lost my driver CD for Creative web Camera. I dont know how to get my model number. Can any one please help me get my web cam model number and also the driver. Warm Regards,Hari

  • HTMLDB Just 'disappeared' After Upgrade to 10gr2

    Our DBA upgraded the Oracle server and now the web pages give an error 'the page cannot be displayed'. It is still installed but I cannot get the web pages to come up. There is a new Oracle home and the installed programs and configuration files are

  • Airport Admin Utility cannot read configuration

    10.5.2 software German. airport extreme airport express 802.11n Admin Utility sees the AE Base, but fails to read its config, so I cannot change any settings. Reset to factory setting would be very ugly as a solution. It happens since I tried to add