SAP SCript top - endtop

Hi all,
I am working on a script.I have two pages designed.The windows on first page are header,footer,main and logo.The windows on page 2 are main and footer. This is the code in the editor of main window for top an endtop.
/: TOP
/: POSITION XORIGIN '0' CM YORIGIN '0' CM WINDOW MAIN
/: BOX FRAME 10 TW
/: BOX XPOS '0' CM YPOS '1' CM HEIGHT '0' CM FRAME 10 TW
p1 Carrid                Connid                  Fldate
/: ENDTOP
I expect a box for the whole window . In the box I have list headings Carrid,Connid,Fldate.And then an underline (box) .I want the same in every subsequent page. but it is not displayed. Can anyone please explain me what is wrong in the code.I want the top-endtop to be triggered for every page.
Regards,
Varun

Hi Varun,
  Create another small window just for header for you Carrid Connid Fldate & place it just above the main window,so that the header will fire for all the pages.
:/ BOX FRAME 10 TW
p1 Carrid Connid Fldate
Then create you main window & write
:/ BOX FRAME 10 TW
Message was edited by: Phani Kiran Nudurupati
Message was edited by: Phani Kiran Nudurupati

Similar Messages

  • Putting cross line under top left corner in a cheque through SAP SCRIPT.

    Hi,
    How to put cross line over top left corner in cheque   (cross cheque) while doing it through  SAP SCRIPT.
    Thanks.

    Hi,
    i can give you two solutions. try the thing which looks fine for you.
    1.  say this is line editor of the script.
    you have to design like this manually(its a bit time consuming for alignments and all - both should align side by side using '/')
    so try the second way.
    2.  make this 'corss' as an image and simply pass as a text on to the window on which you needs this.
    it will be simple and an easy way.
    Thanks & regards,
    Sasi Kanth.

  • Colum headers  in SAP script

    Hi All,
         i have a requirement like this. in a SAP Script. i have a Column(Table) headers in one Text element. now it is displaying in first page. the requirement is the column header has to be  displayed on top of the subsequent pages also. The print program has not be modified. it has to be solved in form it self only.
    Thanks and Regards
    D.Ramesh

    just use SYSTEM Variable to check its not equal to 1.
    /: TOP
    <b>/: IF &PAGE& <> '1'
    your headingds
    /:     ENDIF</b>
    /: ENDTOP
    this way we are not printing heading in first page.
    below is the logic to print headings ONLY on First page.
    and also write the same headings just after you are printing your text.
    <b>/: IF &PAGE& = '1'</b>
    H1          ,,LINIT,,  BIN,,PICK QTY,,UoM,,BATCH,,DESC.,,PRODUCT,,IC
    =          ,,TO.,,PRODUCT DESC.,,INV QTY,,CLS,,WT
    H1          ,,,,,,,,,,,,,,  ID,,,,LN#
    H1          &ULINE(130)&
    /:          ENDIF
    this <b>/: IF &PAGE& = '1'</b> is to check its not printing for all the pages.just for 1st page,where after printing some text,this heading will appear.
    regards
    srikanth
    Message was edited by: Srikanth Kidambi
    Message was edited by: Srikanth Kidambi
    Message was edited by: Srikanth Kidambi

  • SAP Script .........Need Example

    Hii Guyz..
    Can anybody tell me how to print line items one by one from internal table into SAP script....
    eg.
    No. name  quant..
    1    xyz      5
    2    sdf       7
    etc.

    /E ITEM     -
    Start of Text Element                                                              
    /: TOP                                                                      
    /: POSITION WINDOW                                                          
    /: BOX  WIDTH '185' MM HEIGHT '10' MM FRAME 10 TW                           
    P3 ,,Qty,,Description/Invoice for Customs,,Product Ref/Serial No.,,Unit     
        Price,,Net Amount,,Vat Rate                                              
    /: IF &PAGE& = '1'                                                          
    /: BOX YPOS '10' MM WIDTH '185' MM HEIGHT '97' MM FRAME 10 TW               
    /: ELSE                                                                     
    /: BOX YPOS '10' MM WIDTH '185' MM HEIGHT '220' MM FRAME 10 TW              
    /: ENDIF                                                                    
    /: ENDTOP                                                                   
    /: BOTTOM                                                                   
    /* IF &W_FLAG8& = ''                                                        
    P7 ,,,,,,,,,,,,,,,,,,,,,,,,Transactions continue on Page &NEXTPAGE&         
    /* ENDIF                                                                    
    /: ENDBOTTOM                                                                
    /: PROTECT                                                                  
    M1 ,,&w_vbrp-fkimg1&,,&w_vbrp-arktx&,,&w_vbrp-matnr&,,&W_VBRp-KZWI2&,,
    the above logic has to be written in a SAPSCRIPT Form and below u have to write in the calling program
    LOOP...
    CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'ITEM'
            window  = 'MAIN'.
    ENDLOOP.
    Make sure u use Main Window for printing it.
    Message was edited by:
            Utsah Garg

  • Problem in displaying the data of columns into rows in sap script

    hi,
    i am working on a sap script and i have to display the dat which is displayed in column into rows but it is not displaying it properly.
    eg, C
        12.1
        Si
        5.5
    it is displaying the data right now like this but i want to display the  data like this:-
    eg, C      Si
        12.1   5.5
    plzzprovide me guidelines how to solve this problem.

    hi,
    i am using this code to display the data:-
    plzz provide me guidelines where i am getting wrong?
    TOPparCOMPONENT DESP,,,,,, INS. LOT #, , , , , , MIC,,,,,,,,,, MIC VALUEparENDTOPparFINAL
    PROTECT
    IF &I_FINAL-PRUEFLOS& NE '000000000000'
    &I_FINAL-MAKTX(23)&&i_final-prueflos(12Z)&
    &I_FINAL-kurztext(25)&
    &I_FINAL-original_input(8)&
    ELSE
    &I_FINAL-MAKTX(23)&     
    &I_FINAL-kurztext(25)&
    &I_FINAL-original_input(8)&
    ENDIF
    ENDPROTECT
    ITEMHEAD
    POSITION WINDOW
    SIZE WIDTH +0 . 4 CH HEIGHT +1 LN
    BOX FRAME 10 TW
    BOX HEIGHT '1.35' LN INTENSITY 20
    IF &PAGE& = '1'
    BOX XPOS '0' CH YPOS '0' CM WIDTH '0' CM HEIGHT '43' LN FRAME '10' TW
    For horizontal line at top
    BOX XPOS '0' CH YPOS '0' CM WIDTH '75' CH HEIGHT '0' LN FRAME '10' TW
    COLUMN LINES...
    END OF COLUMN LINES...
    BOX XPOS '0' CH YPOS '43' LN WIDTH '75' CH HEIGHT '0' LN FRAME '10'TW
    BOX XPOS '75' CH YPOS '0' LN WIDTH '0' CH HEIGHT '43' LN FRAME '10'TW
    ELSE
    COLUMN LINES...
    END OF COLUMN LINES...
    BOX XPOS '0' CH YPOS '0' CM WIDTH '0' CM HEIGHT '47' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '0' CM WIDTH '75' CH HEIGHT '0' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '0' CM WIDTH '45' CM HEIGHT '0' LN FRAME '10' TW
    BOX XPOS '20' CH YPOS '0' CM WIDTH '0' CM HEIGHT '47' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '47' LN WIDTH '75' CH HEIGHT '0' LN FRAME '10'TW
    BOX XPOS '75' CH YPOS '0' LN WIDTH '0' CH HEIGHT '47' LN FRAME '10'TW
    ENDIF
    LINEFEED
    NEWPAGE
    NEW-PAGE
    provide me guidelines to solve this problem.
    Edited by: ricx .s on Mar 13, 2009 5:58 AM

  • 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

  • Text getting overwritten in first page of SAP Script

    Hi All,
    My Requirement:
    1. I have a SAP Script which has a main window which prints the internal table data
    2. I have created a instance of Mainwindow to display watermark.
    3. Now, everything seems to be fine while displaying the watermark/foreground text.
    Problem is:
    4. If the data exceeds 15 records(i.e, end of the main page), 16th record starts printing from the top of the main window again.
    5. This continues till the end of the 30th record(i.e., it is Overwriting all the first 15 records) and the 31st records is getting printed in the 2nd page.
    6. FYI, I have maintained the header in such a way that 2nd Page should be triggered after the first.
    7. Also, I have called the windows in the correct order
    What could be the problem? Is it because, I have created an instance of main window to display the text. If that is the case, how to resolve this ??? Any thoughts on this would be highly appreciated

    Hello Richa,
    I tried creating a variable window and inserted a Watermark on it.The thing is, Watermark is not getting displayed.I tried both the ways calling the watermark before displaying the text and after displaying the text.
    Hello Ravi,
    See to display the watermark, I created an instance of mainwindow by using
    So, this main window which is an instance of the actual main window will have the same co-ordinates.
    I think, this has got nothing to do with that. But, there is something that is missing out here.
    Hello Rajani,
    I tried using Protect and End Protect. But, it didnot work
    Hello Sarves,
    I tried creating a variable window exactly the size of the main window and then placed the variable window back of the main window. But, I am not able to see the watermark in the preview.
    If I am missing something, please let me know.
    Thanks in advance........

  • Vertical line issue in SAP Script main window

    Hi All,
    I want to draw a vertical line in my main window in SAP Script output.
    But problem is in main window i am printing some texts at the beggining then i am printing line items.
    So this is not fixed line (box). It may increase/decrease based on text available before line items.
    How can i manage this prining vertival line as i don't know height, top of this line!
    Thanks in advance.
    Thanks,
    Deep.

    Hai Deep,
    Use Elements as suggested by Kodarapu.
    Now goto Paragraph Formats create a format for Item lines.
    ex.
    Name Paragraph Format as 'IL' Now click on the Push Button "Tabs" on bottom Right.
    now in "Tab Position" enter the spacing that you need for your item dispaly
    ex.
    Number     Tab position       Alignment
    1               6.00   CH          LEFT
    2               25.00  CH         LEFT
    3               54.00  CH         LEFT
    The above example is for 3 items
    Now in your Script Windows-> Main
    do the following.
    /E           ITEM_LINE_A
    IL           &EKPO-EBELP&,,&EKPO-EMATN&,,,,&EKPO-TXZ01&
    Hope it SOlves your Issue.
    Cheers,
    Suvendu

  • Sap script '' how to create table frame in sap script"""

    i have some problem in sap script''  how to create table frame in sap script"""

    Hi,
    you can use 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 both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
    1. 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
    2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
    3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
    4. FRAME: Thickness of frame.
    Default: 0 (no frame).
    5. INTENSITY: Grayscale of box contents as % .
    Default: 100 (full black)
    Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used 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 layout set header
    • 1 LN = height of a line relative to the LPI specification in the layout set 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 shadowing 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.
    check the fallowing link also
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803293454211d189710000e8322d00/content.htm
    Mark the points if u find it useful...
    Regards,
    Omkar.

  • Link SAP Script with IC WinClient

    Hey Guys
    I have created a SAP script, but I am having hard time linking it with the Interaction Center Winclient. What I mean is that,  when the call is received, how the agent will read the script.
    Any help would be really appreciated.
    Regards
    SAP CRM

    Hi,
    You will have to congure in the SAPscript name and the driver program against the desired output type 
    In the transaction NACE - > select the application type - > out put type button on top - > Select the output type from the list and then click on the Processing routines from the tree on right . Now maintain the Program name, SAPscript name , etc here.
    Regards,
    Mansi.

  • Where do we find a box command in sap script

    Hai,
    where do we find a box command in sap script, how to create box command ,
    its urgent help out

    Hi
    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
    Regards
    anji

  • SAP script and External docs - print in PDF

    Hello,
    We are printing maintanence orders (SAP script) through IW32 and recently we have added custom logic to print the external docs(word or excel) attached to the maintanence orders. So if we print a maintanence order with two attachments, we would get Order, Attach_1 and Attach_2 printouts. This functionality is working fine but when we print several orders at the same time all prints are getting mixed up. I was wondering if somthing like this would be possible.... Let's say we have a order of one page with two attachments, Attach_1 & Attach_2, of one page each and we create one single PDF document with these three pages in the print program and print this PDF at the end of the print program so that all the prints associated with one order come out as a single doc.
    Any ideas / sample code is appreciated. Thanks.

    Hi Raju,
    You are in double-trouble   ... another moderator rejected your other post while I was locking this one here. But I did read your comment in it.
    Please resist the temptation to cross-post. It messes up the forums and is unfair on those who take the time to answer your questions.
    I'll make a deal with you: If you go back and close all your 115 unresolved questions which can be closed (or no longer need to be open) and assign ponits accordingly (note: you do not need to post anything to close it, the "post comment" field is not mandatory ) then I will unlock this thread for you and we can carry on.
    It will take you an hour or two, but people will respect you for it.
    Let me know (I will be watching your resolved posts number).
    Cheers,
    Julius
    PS: Top right hand corner => "Your Questions"...
    Edited by: Julius Bussche on Sep 15, 2008 10:45 PM

  • 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

  • Problem in Sap script for Check printing

    Hi all,
      I have problem in Check printing for FI Module. In Tcode f-58 i am taking the printout of checks. For my user they want to move the main window in upwards, but the sap script <b>F110_PRENUM_CHCK</b> not allowing to move upwards. how to do this, its urgent. plz
    point wil be sure.
    Gowri

    Hi
    Copy the script F110_prenum_chek to some ZCHECK and do the changes.
    Why you can't change the MAIN window towards up?
    You can changes ths ize of it by adjusting the setting of it .
    generally we use some pre printed stationary for this in which all the line item data with doc numbers is printed on top and the check will be in bottom
    and in check we just print the few fields in the right positions.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Link between pe51 and SAP script

    I have a requirement for check printing along with remuneration statement.
    I have copied the standard sap script f110_prenum_chck into z110_prenum_chck
    I am using the standard driver program RFFOUS_C.
    My requirement is: Remuneration statement from PE51 should be printed in the top portion of the page and check should be printed in the middle portion. For Remuneration part, I have kept Main Window in position in the script with the element 525-HR as the only active element.
    For check portion, everything is working fine as i have customized it accordingly. For remuneration statement Funct. ppl have copied some standard version in PE51 to Z say ZXXX.
    but remuneration statement is not getting printed.
    How do i trigger ZXXX into z110_prenum_chck without changing the standard program??

    Hi Babu,
    I never came across this senerio so i have no idea but as per your req i think abaper may help you so kindly contact abap consultant.
    Thanks

Maybe you are looking for