SAP Script: Lines is not included in printing

Hi gurus,
I created a program for A/P Voucher using SAP Script. I could see the horizontal lines in Print Preview. But when I print the form using a long bond paper, lines weren't there. except the lines I place underneath the amount.
              <i> The Company
               A/P Voucher
Pay to: Vendor A
Address: ABC Blg.
Payment for the ff:               Amount
Cement                           xx,xxx.xx
Net of VAT                  xx,xxx.xx
Input VAT                    x,xxx.xx
total amount                      xx,xxx.xx
Payed:</i> <b>$<u>xx,xxx.xx</u></b> <i>in full payment of above account
sign over printed name
</i>
Message was edited by:
        maui bayog

Hi
How youhave declared in your coding for lines???????
Regards
Pavan

Similar Messages

  • Csutom SAP Script in ME23N not displaying data in Form

    Hi Experts,
    I have created custom driver program for PO printing using Form entry_neu, which is printing a SAP script,
    but the problem is when the form is displayed, data is not populated in the form.
    While debugging in driver program the data is being filled in structures but when I debugg the SAP form the structures are empty.
    When I am running the same program from SE38 then it is perfectly calling the form with data.
    Could some let me know the possible cause of error.
    Thanks n Regards
    Rohit

    Hi rohit,
    Check in NACE transaction whether ur form name and print program (custom) is configured with routene ENTRY_NEU. And also cross check whether this routene entry_neu is also configured for other forms?
    Because entry_neu routene is standard one , so it might be configured for other forms also.
    So it is better to write ur driver program with different routene name like entry.
    Form entry.
    Endform.
    And this routene entry need to configure in nace for ur custom program and ur form with output type.
    Regards,
    Vineel.

  • Deleted line  item not display in Print preview

    Dear All ,
                                    Pl guide that when i delete the line item from a P.O then this deleted item is not visible in Print Preview .pl help what are the exact setting due to which i can know why this del item is not coming in Print Preview.
    Rgds ,
    Rajeev
    Edited by: sap11 on Feb 11, 2009 10:37 AM

    HI,
    Using the standard programm and print form the system works as follows:
    When you will create a new Purchase order with two line item. System
    will create new message record with  Change message flag (NAST-AENDE) as
    space and processing status (NAST-VSTAT) as  0 "not processed".
    After this if you will output the message using ME9F then system will
    update the message processing status NAST-VSTAT as 1 "Successfully
    processed".
    When you will delete line item 10, at that time system will create
    one more message record with indicator Change message flag
    (NAST-AENDE = X ) and processing status 0 "not processed".
    Now system contains two message records in table NAST, one for which
    processing has been done and one change message record for which
    processing has not been done.
    If you will run ME9F with processing status 0 then this means you
    wants to output the change message record means you wants to inform
    your vendor that item 10 has been deleted. That's why system show
    line item 10 but you can notice in print preview, system mentions that
    item 10 has been cancelled.
    If you will run the message with processing status as 1 then this is
    not change message output means system will show you latest print
    of purchasing document and thus will not show line item 10.
    Please take the print out of both message record and you can see the
    difference.
    I hope this information helps!
    Best Regards,
    Arminda Jack

  • SAP SCRIPT: Header text not printing - Custom Purchase Order.

    Hello Experts,
    I have used the standard MEDRUCK and copied to ZMEDRUCK. I want the PO header text to print in my form.
    I have used subroutine-pool and called it in the form.
    Here is my subroutine
    FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
      TABLES EKKO.
      DATA: BEGIN OF header OCCURS 0,
              ld_txt1(163),
              ld_txt2(163),
              ld_txt3(163),
            END OF header.
      DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
            ID like THEAD-TDID,
            TNAME LIKE THEAD-TDNAME,
            TDOBJECT like THEAD-TDOBJECT.
      DATA  HTEXT LIKE EKKO-EBELN.
    *  HTEXT = EKKO-EBELN.
      READ TABLE in_tab WITH KEY EKKO-EBELN.
      if sy-subrc = 0.
      TNAME = in_tab-value.
      ENDIF.
    TNAME = EKKO-EBELN.
    *CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
    *MOVE v_head_text to HNAME.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        id                            = 'F01'
        language                      = 'E'
        name                          = TNAME
        object                        = 'EKKO'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        = TNAME
      tables
        lines                         = li_lines
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
    *   WRONG_ACCESS_TO_ARCHIVE       = 7
    *   OTHERS                        = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR out_tab.
    out_tab-VALUE = TNAME.
    CONDENSE out_tab-VALUE.
    MODIFY out_tab TRANSPORTING VALUE WHERE NAME = 'TNAME'.
    ENDFORM.
    And my script in the form is
    PERFORM FETCH_TABLE_DATA IN PROGRAM ZMEDRUCK_SUBP2
    USING &EKKO-EBELN&
    CHANGING &TNAME&
    ENDPERFORMpar RECEIVED FROM M/S     &TNAME&
    The header text is still not flowing in my form.
    What mistake i'm I doing here ?
    How can I resolve this ?
    Pls help !

    Hi,
    Data is li_lines internal table. 1st you have to read the text form the internal table line by sy-tabix.
    At last you have to concatenate these variable into the out tab value.
    you can use the following code
    ORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
      TABLES EKKO.
      DATA: BEGIN OF header OCCURS 0,
              ld_txt1(163),
              ld_txt2(163),
              ld_txt3(163),
            END OF header.
      DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
            ID like THEAD-TDID,
            TNAME LIKE THEAD-TDNAME,
            TDOBJECT like THEAD-TDOBJECT.
      DATA  HTEXT LIKE EKKO-EBELN.
    READ TABLE in_tab WITH KEY EKKO-EBELN.
      if sy-subrc = 0.
      TNAME = in_tab-value.
      ENDIF.
    ALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            = 'F01'
        language                      = 'E'
        name                          = TNAME
        object                        = 'EKKO'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         = li_lines
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    data : f_lines TYPE i,
    DESCRIBE TABLE li_lines LINES f_lines.
    data: lstr type String,
          lstr1 type string,
          lstr2 type string,
          lstr3 type string,
          lstr4 type string.
    read table li_lines index 1.
    lstr = li_lines
    condense lstr.
    clear li_lines
    read table li_lines index 2.
    lstr1 = li_lines
    condense lstr.
    clear li_lines
    read table li_lines index 3.
    lstr2 = li_lines
    condense lstr.
    clear li_lines
    if f_lines GT 3.
    ead table li_lines index 4.
    lstr3 = li_lines
    condense lstr.
    clear li_lines
    ead table li_lines index 5.
    lstr4 = li_lines
    condense lstr.
    clear li_lines
    endif.
    data : v_text type text.
    concatenate  lstr1 lstr2 lstr3 lstr4 into v_text separate by ' '.
    CLEAR out_tab.
    READ TABLE out_tab WITH KEY name = 'TNAME'.
    out_tab-value = v_text
    MODIFY out_tab INDEX sy-tabix.
    Regards
    Nayan Kumar

  • SAP Script LVSTALISTE not printing VEKP fields

    Hi all,
    The SAP script LVSTALISTE does not print out any field in the packaging section. All the fields in this section come from the table VEKP.
    Is there some special config that needs to be done to activate the printing of the fields from this section? Because as it is now all the data from the VEKP table is not printed in the form.
    Any suggestions would be greatly appreciated.

    Hi,
    Check the CONFIG
    You can trigger Picking list print automatically based on Config settings(SPRO) for movements .
    Logistics Execution->Warehouse Management->Tools->Develop Forms->Assign Forms->Assign Forms for Stock Movements
    Or you can use LX21 along with print idicators for printing picking list seperately.
    Logistics Execution->Warehouse Management->Tools->Develop Forms->Assign Forms->Assign Forms for Print Indicators
    or else debug the the SCRIPT and check if the values are populated inside.

  • Sap script text printing issue..

    Hi,
    I have a SAP script with a text symbol say &abc& defined in the SAP script main window.
    From the print program I want to pass some text to this text symbol.
    In the print program I have an internal table with lines of text, sometime it can have just one line of
    text CHAR512 length or it can have multiple lines of char512 length text.
    Now how do I pass these lines to the text symbol &abc& ?
    I tried to do the following, but it does not help...
    DATA l_data TYPE STRING.
    loop thru the internal table
    concatenate l_data with text got from internal table
    endloop
    CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
        EXPORTING
          name   = '&abc&'
          value  = l_data
        EXCEPTIONS
          OTHERS = 0.
    I debugged and saw that l_data has most of the text (not all) but the sap script's printed output
    has only few text.
    what should I do to get all the text displayed on the printed output ?
    thnks

    Hi Vivek,
        Including two work area next to each other should not be a problem because i am doing the same thing. Check whether the length of field of work area one is over lapping the field of other work area.
    Note: Reward points if helpful.
    Cheers,
    Shafiq

  • Issue in alignment of PE51 data when printing it in SAP Script

    Hi Experts
    I have a SAP Script which is used to print Check at the top and Re-numeration Statement at the second half via RFFOUS_C program. The re-numeration statement is designed in PE51. The Check is designed in SAP Script and the PE51 form is printing inside the script using Main window/ Text Element : 525-HR.
    The FM RP_IMPORT_PAY_STATEMENT is used inside the RFFOUS_C program which returns the table PFORM and the contents of  the PFORM is exactly the re-numeration statement data and are getting  printed one by one in the script using the variable REGUD-TXTHR. My object is fine with all the above said things. Only issue is with the alignment which is weird in SAP Script for the re-numeration part. But when I look into PC00_M10_CEDT (TCODE to view re-numeration statement) the output of designed PE51 form is good with proper alignment.When it is printed via script the alignment is not good at all.
    There is some differences in the formats of printing between PE51 and SE71. Do not know what exactly it is. How I can resolve this issue?
    Thanks
    Siva
    Message:Siva

    Hi Madhu,
    Sorry for the delayed response.See the below screen shot.This is how it prints now.The amounts are not aligned.Increasing the line spacing will increase only the space between the lines and i am using same character format for the variable REGUD-TXTHR.I would like to align them.
    Thanks
    Siva

  • Sap Script printing issue

    Hi Gurus,
    I am working on a SAP script... when I am printing the SAP script the last few lines of my text is missing... I got to know that there might be a problem in the page setting... i.e. the page may be set as a A4 and i am printing on letter... so can you please tell me how can I check what the page setting that my sap script is using.
    Thanks,
    Rajaeev Gupta

    Hi,
    Issue of 'part of the Text missing' is happening during Print Preview or when taking a print out?
    I guess, the problem is due to height of the window, the height of the window where u printing this text is not able to accomodate the entire text. just increase the height of the window & try. 
    To know the page format that ur script is using, just follow the below steps:
    Txn SE71--> give the Script form name > click on change/Display button> click on Header button (red hat symbol) in app tool bar or press F5 button --> now click on Basic Settings button. Here u see the Page Format in 'Set up Page' block...
    Hope it helps!!
    Rgds,
    Pavan

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • Question on Printing SAP Script

    Hi Group,
    I have an urgency in printing a SAPScript. I would like to know how to change the printer settings to hold the page of a particular size for printing.
    Please let me know the procedure to achieve this and also the transaction(s) relating to this configuration.
    My requirement:
    I want to create some settings to a SAP Script page and I want to use the same configuration (of the page) while running the driver program.
    My Issue is:
    I have a page(SAP Script) in which I want to print exactly 3 cheques for the page.
    But, currently, I am able to get only one cheque getting printed and remaining 2/3 of the page is getting wasted. So I want to do the configuration accordingly to achieve my task.
    Please let me know your valuable inputs.
    Thanks & Regards,
    Vishnu.

    We don't include the audit trail content in the specification print out.   I recommend using a BI Publisher contextual report that you can launch from the specification.  You can learn more about custom reporting in the extensibility pack reporting guide.

  • Printer Control Language 5 Sap Script

    Hello,
    Does anybody have a sample SAP script which gives command to NRG printer. It uses a PCL 5 driver so wanted a sample eg. of the same.
    Regards,
    SHekhar Kulkarni

    Hi Shekhar,
    Print commands are controlled by the device type you have set up for your printer.  These are administered via the transaction SPAD (for spool administration).
    The SAPScript itself does not issue these commands (as far as I'm aware).
    You may have to handle special print control from your SAPScript by the use of fonts.  Again, these are administered from the transaction SPAD.
    Hope that helps.
    Cheers,
    Brad

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • How to print BARCODE in DATAMAX Printer using SAP Script?

    Hi,
    Can anybody guide me how to print BARCODE using DATAMAX Printer?
    I need to develop a SAP Script, through which i need to print the BARCODE.
    Pls. let me know the parameters for Script and how to print using print program.....
    Regards,
    Hemant

    make one form in sapscript with one main window: like this
    /E           ETIKETT
    /*           Format = '57x19', Printer = 'Bradyprinter Model 1344'
    /           ~f350
    /           ~n
    /           ~M0500
    /           ~O0220
    /           ~SG
    /           ~s
    /           ~c0000
    /           ~e
    /           ^D
    /           ~L
    /           D11
    /           H20
    /           PC
    /           pC
    /           SC
    /           A2
    /           1911A1200400005&knmt-kdmat&
    /           1911A0800300005&knmt-postx&
    /           1911A0800100005VS-Nr   :         &KNMT-MATNR&
    /           1911A0800000005Datum   :         &date&
    /           Q0001
    /           E
    in this script   &mseg-matnr&    and    &mseg-charg&    are 2D Barcodes
    /E           ETIKETT
    /*           Format = '57x19', Printer = 'Bradyprinter Model 1344'
    /           ~f350
    /           ~n
    /           ~M0500
    /           ~O0220
    /           ~SG
    /           ~s
    /           ~c0000
    /           ~e
    /           ^D
    /           ~L
    /           D11
    /           H20
    /           PC
    /           pC
    /           SC
    /           A2
    /           1Wc99000001400082000012012&mseg-matnr&
    /           ySPM
    /           1911A1000380055&mseg-matnr&
    /           1Wc99000001501702000012012&mseg-charg&
    /           1911A0800260055&mkpf-budat&
    /           1911A0800140055&mseg-mblnr&
    /           1911A0600020008&makt-maktx&
    /           Q0001
    /           E
    then you need your own printprogram and everything is fine. with open_form ;  start_form ; write_form;  end_form
    you can communicate direct with the Datamax Programming Language  from SAPScript to the Barcode printer.
    i also have the datamax programmers manual as pdf if you want i could send it to you. let me know by PM.
    also have look into HW 490295  the bartender Solution works fine for me to create the SO10 text's
    greetz
    tony
    Edited by: Tony Wienhold on Jul 17, 2009 4:37 PM

  • Missing fields in the output while using SAP SCRIPT

    Hi,
    I am working on an issue where we are using F110 to print some checks, and for this we have created a custom sap script and we are using a std driver program RFFOUS_C, we have also maintianed a custom subroutine pool ZRFFOUS which will retrieve the missing data for the sap script which was not there in the std. program. Now we have applied a SP to our system and since then we are having a problem...when we are printing the chechks its missing some fields.
    Surpisingly, it is happening for all scripts like Dunning, invoice......
    These scripts are working good in production which is not applied patches.
    I have tried in all ways, did debug, data is there in tables and scripts are exactly same as in production.
    Could you please share any ideas regarding this? What would be the effect of patches?
    Thanks
    Sha

    Hi ,
    I think u r printing the Check through the Tr Code F110.
    In that program u r using the Standard Driver Program RFFOUS_C and u create a New Sap script.
    and also u also mantained the custom subroutine pool ZRFFOUS .  when ru giving printing u are  not able to print some  field.
    In this case  when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran  * RFFORI01---- check  , 
    in this program it is calling the Standard Form (F110PRENUM_CHCK) i--e t042e-zforn .as shown in the below and it is calling the function module 'OPEN_FORM'._
    Please copy  the form  asZF110_PRENUM_CHCK and  and do the changes in that form . and we need to maintained the Form as Company code level  -- and it will shown this Table T042E (Company Code-Specific Specifications for Payment Methods)
    Please go to Transaction Code FBZP  and U can maitained the  New Sap Script Form Company Code Level.
    one thing while u calling your new subroutine pool ZRFFOUS  Please call  this subroutine in  your Sap Script form then only u can see all values in your Check.  and Actvate the Sap script .
    Like U can call your new  subroutine ZRFFOUS  in your New Sap script Program.
    /E   CHECK
    /:   PERFORM XXXXXXX IN PROGRAM XXXXXX''                  
    /:   PERFORM CHECK_NAME IN PROGRAM  ZRFFOUS
    /:   USING &XXXXXXX&                      
    /:   CHANGING &XXXXXX&                   
    /:   ENDPERFORM                              
    In the subroutine pool ZRFFOUS   u have to call  as
    FORM CHECK_NAME TABLES t_data_in  STRUCTURE itcsy
                                                   t_data_out STRUCTURE itcsy.
    xxxxx
    xxxxx
    xxxxx
    ENDFORM.
    In this case  when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran  * RFFORI01---- check  , 
    in this program it is calling the Standard Form (F110_PRENUM_CHCK) i--e t042e-zforn .
        open check form
          CALL FUNCTION 'OPEN_FORM'
               EXPORTING
                    form     =  t042e-zforn
                    device   = 'PRINTER'
                    language = t001-spras
                    options  = itcpo
                    dialog   = space
               EXCEPTIONS
                    form     = 1.
          IF sy-subrc EQ 1.                "abend:
            IF sy-batch EQ space.          "form is not active
              MESSAGE a069 WITH t042e-zforn.
            ELSE.
              MESSAGE s069 WITH t042e-zforn.
              MESSAGE s094.
              STOP.
            ENDIF.
          ENDIF.
    I thing it will help u to solve this issue.
    Thanks.
    Gagan

  • Help regarding SAP SCRIPT

    Hi!
      can any one help me regarding SAP SCRIPT. i unable to write a print program for sap script . can any one can send me sample code using ITCSY structure.
    Thanks in advance.
    Thanks & Regads,
    DurgaPrasad.k

    Hi,
    refer this to write print program:
    <b>The Print Program</b>
    Structure of a print program
    OPEN_FORM function
    CLOSE_FORM function
    WRITE_FORM
    START_FORM function
    END_FORM function
    CONTROL_FORM function
    The print program is used to print forms. The program retieves the necesary data from datbase
    tables, defines the order of in which text elements are printed, chooses a form for printing and
    selects an output device and print options.
    <b>Function modules in a printprogram:</b>
    When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine
    forms into a single spool request use START_FORM and END_FORM.
    To print textelements in a form use WRITE_FORM. The order in which the textelements are printed,
    is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you
    can also use the WRITE_FORM_LINES function module.
    To transfer control command to a form use CONTROL_FORM.
    <b>Structure of a print program</b>
    Read data
    Tables: xxx.
    SELECT *
    FROM xxx.
    Open form printing - Must be called before working with any of the other form function modules.
    Must be ended with function module CLOSE FORM
    call function 'OPEN_FORM'.....
    To begin several indentical forms containing different data within a single spool request, begin each
    form using START_FORM, and end it using END_FORM
    call funtion 'START_FORM'.....
    Write text elements to a window of the form
    call function 'WRITE_FORM'.....
    Ends spool request started with START_FORM
    call funtion 'END_FORM'.....
    Closes form printing
    call function 'CLOSE_FORM'...
    OPEN_FORM function
    Syntax:
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      DIALOG                            = 'X'
      FORM                              = ' '
      LANGUAGE                          = SY-LANGU
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
      CANCELED                          = 1
      DEVICE                            = 2
      FORM                              = 3
      OPTIONS                           = 4
      UNCLOSED                          = 5
      MAIL_OPTIONS                      = 6
      ARCHIVE_ERROR                     = 7
      INVALID_FAX_NUMBER                = 8
      MORE_PARAMS_NEEDED_IN_BATCH       = 9
      SPOOL_ERROR                       = 10
      OTHERS                            = 11
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>Some important parameters:</b>
    FORM Name of the form
    DEVICE PRINTER : Print output using spool
    TELEFAX: Fax output
    SCREEN: Output to screen
    OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....
    The input for the parameter is structure ITCPO.
    CLOSE_FORM function
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SEND_ERROR                     = 3
      SPOOL_ERROR                    = 4
      OTHERS                         = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Paramerters:
    RESULT Returns status information and print/fax parameters after the form has been printed.
    RESULT is of structure ITCPP.
    WRITE_FORM function
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT                        = ' '
      FUNCTION                       = 'SET'
      TYPE                           = 'BODY'
      WINDOW                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      OTHERS                         = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Some important parameters:
    ELEMENT Specifies which textelement is printed
    WINDOW Specifies which window is printed
    TYPE Specifies the output area of the main window. This can be:
    TOP - Used for headers
    BODY
    BOTTOM - Used for footers
    FUNCTION Specifies whether text is to be appended, replaced or added
    Example of how to use the WRITE_FORM function module together with a script.
    Form layout of the MAIN window
    /E INTRODUCTION
    Dear Customer
    /E ITEM_HEADER
    IH Carrier, Departure
    /E ITEM_LINE
    IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
    /E CLOSING_REMARK
    <b>The print program</b>
    Writing INTRODUCTION
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT                  = 'INTRODUCTION'
    FUNCTION                 = 'SET'
    TYPE                     = 'BODY'
    WINDOW                   = 'MAIN'
    EXCEPTIONS
    OTHERS                   = 8
    Writing ITEM_HEADER
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT                  = 'ITEM_HEADER'
    FUNCTION                 = 'SET'
    TYPE                     = 'BODY'
    WINDOW                   = 'MAIN'
    EXCEPTIONS
    OTHERS                   = 8
    Set ITEM_HEADER into TOP area of main window for subsequent pages
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT                  = 'ITEM_HEADER'
    FUNCTION                 = 'SET'
    TYPE                     = 'TOP'
    WINDOW                   = 'MAIN'
    EXCEPTIONS
    OTHERS                   = 8
    Write ITEM_LINE
    LOOP AT .....
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT               = 'ITEM_LINE'
    FUNCTION              = 'SET'
    TYPE                  = 'BODY'
    WINDOW                = 'MAIN'
    EXCEPTIONS
    OTHERS                 = 8.
    ENDLOOP.
    Delete ITEM_HEADER from TOP area of main window
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT                  = 'ITEM_HEADER'
    FUNCTION                 = 'DELETE'
    TYPE                     = 'TOP'
    WINDOW                   = 'MAIN'
    EXCEPTIONS
    OTHERS                    = 8
    Print CLOSING_REMARK
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT                  = 'CLOSING_REMARK'
    FUNCTION                 = 'SET'
    TYPE                          = 'BODY'
    WINDOW                   = 'MAIN'
    EXCEPTIONS
    OTHERS                    = 8
    START_FORM function
    CALL FUNCTION 'START_FORM'
    EXPORTING
      ARCHIVE_INDEX          =
      FORM                   = ' '
      LANGUAGE               = ' '
      STARTPAGE              = ' '
      PROGRAM                = ' '
      MAIL_APPL_OBJECT       =
    IMPORTING
      LANGUAGE               =
    EXCEPTIONS
      FORM                   = 1
      FORMAT                 = 2
      UNENDED                = 3
      UNOPENED               = 4
      UNUSED                 = 5
      SPOOL_ERROR            = 6
      OTHERS                 = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    END_FORM function
    CALL FUNCTION 'END_FORM'
      RESULT                         =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SPOOL_ERROR                    = 3
      OTHERS                         = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CONTROL_FORM function
    The CONTROL_FORM function module alows you to create SapScript control statements from within
    an APAB program.
    Syntax:
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    command         =
    EXCEPTIONS
      UNOPENED        = 1
      UNSTARTED       = 2
      OTHERS          = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example:
    Protecting the text element ITEM_LINE
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'PROTECT'.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    TEXELEMENT = 'ITEM_LINE'.
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'ENDPROTECT'.
    rgds,
    latheesh
    Message was edited by: Latheesh Kaduthara

Maybe you are looking for

  • Multiple tables in GUI_DOWNLOAD in same text file

    Hi, Can anybody tell me how to pass multiple internal tables for download in same text file. And also each table output should start with NEW LINE. Please help me in executing this functionality. Thanks, Amol

  • Error While Executing CTC templates   taking wrong host(pwdf3102)

    Hi i am execting CTC templates for DI. i am getting error for creating the software comonents.. nay suggestions please <b>17 Create SoftwareComponent Import not successful</b> <b>Element 'SAPConfigLib.J2E.Unclassified.pingSld':!   okerImport.import_o

  • Stop Bridge CS3 Auto Processing my files....

    Apologies if this question goes over some old ground....I've had a good look around regarding the problems people are facing with Bridge's auto processing feature, but I haven't yet found an outright answer. So I will pose the question in my own way,

  • SQL Agent and SAP Agent

    hello gurus,      I am in need of technical details of SQL agent and SAP agent of Symantec database backup server for SQL server/ windows.     Can anybody please help me in this?? Thanks and Regards, Rahul

  • Premiere Pro CS2 upgraded to Premiere Pro CS3

    Hi all, I currently have Adobe Production Studio Suite(CS2) installed on my PC. We have purchased Premiere Pro CS3 (with Encore CS3 & OnLocation) do I just install PP CS3 etc which will obviously just be installed alongside Adobe Production Studio Su