Table Printing in a Form

Hi All..
Can you plz explain me clearly..
How can i use WRITE_FOR ..
shell i write it in form or Print Program..
Clearly.. i want to print 5 columns like vbap-arktx, vbap-zmeng,vbap-zmeng,vbap-netpr, vbap-kzwi1..
with headings Service details,personnel,HR,Rate,Amount
AT last i want to print Total of all amounts..
Can u plz tell me the logic clearly. with code..
Thanks & Regards
Raj

Hi prasad,
       we have to write 'Write_form' FM in driver program itself. I am writing small example code below. if it is helpful plz give me points.
report  zsumascriptsv1_p                        .
data v1 type i value '888-'.
tables mara.
data it_vbap like mara occurs 0 with header line.
selection-screen begin of block b1.
  select-options: s_matnr for mara-matnr.
selection-screen end of block b1.
*-- Start of Selection
start-of-selection.
select *
  into table it_vbap
  from mara
  where matnr in s_matnr.
if sy-subrc = 0.
endif.
call function 'OPEN_FORM'
exporting
*   APPLICATION                       = 'TX'
*   ARCHIVE_INDEX                     =
*   ARCHIVE_PARAMS                    =
*   DEVICE                            = 'PRINTER'
*   DIALOG                            = 'X'
   form                              = <b>'script_form_name'</b>
*   LANGUAGE                          = SY-LANGU
*   OPTIONS                           =
*   MAIL_SENDER                       =
*   MAIL_RECIPIENT                    =
*   MAIL_APPL_OBJECT                  =
*   RAW_DATA_INTERFACE                = '*'
*   SPONUMIV                          =
* 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
*   CODEPAGE                          = 11
*   OTHERS                            = 12
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at it_vbap.
call function 'WRITE_FORM'
exporting
element                        = 'HEADER'
   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
   codepage                       = 9
   others                         = 10
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
call function 'CLOSE_FORM'
* IMPORTING
*   RESULT                         =
*   RDI_RESULT                     =
* TABLES
*   OTFDATA                        =
exceptions
   unopened                       = 1
   bad_pageformat_for_print       = 2
   send_error                     = 3
   spool_error                    = 4
   codepage                       = 5
   others                         = 6
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
          if it is helpful plz reward points.
Thanks,
suma.

Similar Messages

  • How to print out the Forms and Table fields relationship, data mapping?

    I create a forms and tables relationship inside the Form Developer 11g, once I created the Data relationships between the form data field and the Table column name. I don't have any command to print it out, such as Layout Wizard.
    Are there any programs on Windows platform can print it out?

    hi all,
    i have try to do this
    public static void Readbinary() throws Exception
              String file = "D:\\05-09.190501+0800";
              DataInputStream dis = new DataInputStream(new FileInputStream(file));
              //but then how to read the content ??????can you give me more hint ?????
    i have find the netflow v5 structure by C
    struct NFHeaderV5{
    uint16_t version; // flow-export version number
    uint16_t count; // number of flow entries
    uint32_t sysUptime;
    uint32_t unix_secs;
    uint32_t unix_nsecs;
    uint32_t flow_sequence; // sequence number
    uint8_t engine_type; // no VIP = 0, VIP2 = 1
    uint8_t engine_id; // VIP2 slot number
    uint16_t reserved; // reserved1,2
    struct NFV5{ 
    ipv4addr_t srcaddr; // source IP address
    ipv4addr_t dstaddr; // destination IP address
    ipv4addr_t nexthop; // next hop router's IP address
    uint16_t input; // input interface index
    uint16_t output; // output interface index
    uint32_t pkts; // packets sent in duration
    uint32_t bytes; // octets sent in duration
    uint32_t first; // SysUptime at start of flow
    uint32_t last; // and of last packet of flow
    uint16_t srcport; // TCP/UDP source port number or equivalent
    uint16_t dstport; // TCP/UDP destination port number or equivalent
    uint8_t pad;
    uint8_t tcp_flags; // bitwise OR of all TCP flags in flow; 0x10
    // for non-TCP flows
    uint8_t prot; // IP protocol, e.g., 6=TCP, 17=UDP, ...
    uint8_t tos; // IP Type-of-Service
    uint16_t src_as; // originating AS of source address
    uint16_t dst_as; // originating AS of destination address
    uint8_t src_mask; // source address prefix mask bits
    uint8_t dst_mask; // destination address prefix mask bits
    uint16_t reserved;
    but how to translate the structure to java,then get the data from the file ?
    Edited by: 903893 on Dec 21, 2011 10:52 PM

  • How to print " Duplicate " in FORM ( either Sap Script or Smart Forms )

    hi,
       How to print  " Duplicate " in FORM ( either Sap Script or Smart Forms ) if trying to take second Print Out and the FORM is already Printed.
    Please let me know the condition that we should go for.If possible let me know the SAMPLE code since this will be used in most of the FORMS.
    Regards
    Avi

    Hi
    It depends on which print you're working.
    If it's a print of standard document you can check the NAST (VSTAT field) table in order to know if the document was printed.
    If a message is created you can find the hit in NAST table:
    VSTAT = 0, document not printed;
    VSTAT = 1, documment printed
    VSTAT = 2, print is failed
    If you mean a custom print I believe you need to create a log like NAST table.
    Max

  • Multiple print for pdf form retains the value from previous!

    Hello All,
    We have developed Adobe Print Forms for our business requirements.
    When we try to print these forms from the direct transaction, it prints fine. But when we try to select multiple forms to be printed with one transaction, the pdf form generated has data from all the selection!
    Eg: Form printed properly for Delivery Note through transaction VL02N.
    The same form when we try to print for multiple deliveries from transaction VL71, i retains the data and prints one huge form having all delivery data!!
    Please help us out in this issue and let us know what is tha we are missing in this process!
    Thanks a lot for your time and help.
    Gaurav

    Hi ,
    i think that the problems comes form the data you give to the form, do you make a refresh of internal table before populated them ...
    regards

  • How to Print directly from forms...please help me...

    Hi
    I have a base table block in a form (forms 5.0).
    and this form we use for entering transactions.
    Once transaction is entered and saved. To print this transaction I call a report (report writer 3.0). Here to print this transaction we have two steps entering in a form and then call a report after report generation printing..
    Instead of this I want to give a Print button in the form itself and when I click the print button it should directly goto printer dialogbox.
    How do I do this?
    Thanks

    Hi,
    Open a text file in Read mode and write all ur transactions into it.
    After that,u can use host like(In W-B-P trigger)
    host('type textname > prn)
    Hope this helps..
    Prashanth Deshmukh

  • How find print program and form name from the spool list

    Hi,
          I have a requirement to find print program and form name from the spool list.
    I got the list of programs and forms from TNAPR table, I also want to find out any custom program sending the form directly to the spool.
    Cheers
    Sam

    Hi
    Try TSP01-Suffix2
    Regards
    Raj

  • Change table header in adobe form

    Hi experts,
    I have to print a table in a printable form.
    for that i have defined the table structure in the element on both, the interface and the form context. the thing is that the form shows the field value in the HEADING property of the data type definition.
    is there any way to change it to any other string without modifying the HEADING property?
    In advance, thanks a lot.

    solved

  • Hi, everyone, I met a smartform question about print preview the form

    when I print preview the form there is an error message that WA_DOC_ITEM-TARIFNR doesn't exist in form, can anyone tell me how to solve this? and why? thank you in advance and merry christmas to you all.

    well it must be getting used some where check carefully,
    In main window if u r using a table element then goto data tab and see what internal table and work area u r looping at.
    кu03B1ятu03B9к

  • Table length  in Smart forms

    Hi,
    i have small doubt in table creation of Smart Forms.
    If the no of records in Table are less than the page size.
    how to increase the table view till end of the page or till footer?
    the table shoould be displayed till fully not truncated upto the no of records
    Thanks
    Shiva

    shiva we can do this as follows
    If we know the max number of line we can print in a puricular page.. then ex.
    example maximum 40 lines we can print in a page.. then take thin inot a variable calle <b>v_max_line = 40</b>.
    Find the number of record in Internal talbe example  <b>v_tabl_line = 10</b>.
    v_emtty = v_max_line - v__tabl_line .
    now v_empty is 30.
    now create a "LOOP" in the "footer" part of the TABALE.
    in this loop insert a table line .
    take one temparary variable.. increase the value of the "v_temp" veriable "calculation" part ofth "LOOP".
    In conditions of the LOOP  : give that.. v_temp < v_EMPTY.
    Note: dont forget to insert a text elemetn in the line type of the footer "LOOP". in the Text elemtn write &space&.
    so that all the blank lines will be printed after the end of the table.

  • What does mean You can include static and dynamic tables into a Smart Form?

    Hi guys,
    If you check the official documentation for Smart forms in the Internet you will read that the initial pharagraphs of the text tell you "Tables - You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed". The link is the following: http://help.sap.com/saphelp_nw04/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    I was wondering if this means that I can use field symbols with dynamical number of columns to print a smart form. Because it would be great since the customer wanted a dynamical report depending on the week day it was (If Monday, there was only 12 columns, but if Friday, it will be 52 columns (1 column more for every day elapsed in the current week)). I had to create 5 different forms, but I think using field symbols I had spent less effort. Do you know if it is really possible? If not, then what does mean "You can include static and dynamic tables into a Smart Form"?
    Thank you in advance

    Hi ,
    The concept of static and dynamic tables in smartforms, means you can use template- ( static table as no of rows and columns is fixed). Also you can use table- dynamic as the no of rows will depend on your line items.
    Hope this will help you to close this thread.
    Also, try to find this answer in posted forums. Creating a new forum everytime just increases the network traffic. So please try to avoid it.
    Regards,
    Vinit

  • Can we enter data in any standard table directly through custom form??

    Dear All,
    Can we enter data in any standard table directly through custom form??
    I have create custom form in R.12. I want to insert data in quality standard table directly through custom form. Need experts guideline.
    Awaiting regards,

    Hi,
    Can we enter data in any standard table directly through custom form??
    I have create custom form in R.12. I want to insert data in quality standard table directly through custom form. Need experts guideline.
    Awaiting regards,
    I would not recommend touching the standard tables at all unless you are being guided by the SR. For a record to be in the standard table it should go through series of validations based on the what operation you are performing and some times datas are dependent upon the other tables, and also some times the same records are hit to so many other tables simultaneously.
    Therefore I would not recommend this brother.
    Thanks &
    Best Regards,

  • Print 2 different forms to 2 different printers 1 ABAP program

    Is it possible to print 2 different forms to 2 different printers from one program?
    Example: a Shipping invoice and a Shipping Label (mailing sticky label)
    Could they be a combination for form types? SAP Script and SMARTFORMS, SAP Script and PDF, SMARTFORMS and PDF
    I have a need to print a Shipping Invoice and Label from a single program. I need to beable to print multiple copies of the label at the same time for multiple shipping packages. i.e. 1 of 4, 2 of 4 etc.
    The users want to select print a single invoice and the neccessary labels from a single transaction request.
    Ken

    Hi,
    Could you please see the program RLVSDR40.
    Thanks,
    Abhijit

  • How do I print a interactive form out? It allows printing and filling.

    Hi, I'm trying to print out an interactive form that I filled out and then saved on my hard drive. The author allows printing and filling out of the PDF when it was created. I'm running Windows 7 64-bit and have Adobe Reader XI (11.0.06) installed along with the current drivers for my compatible printer. Within the same PDF the first sheet "instruction sheed" is an all text flat form, which prints just fine. The problem lies when I try to print other sections of the PDF, When I try to print it all I get is the header and a footer that the author created, but all the spaces where questions/ text and my fill in answers don't show up on the print preview image or when the printed sheet comes out of my printer.
         I have tried to print as an image without success. I don't think its an author issuse because it was released out of a California Department for several houndred/thousands of others. Please if you have any ideas or questions i look forward to any advice.

    Sorry I forgot to add that the PDF is devided by a "Chapter" style cover face that devided multiple sets of forms in to categories. At the bottome of these categories is a "Print whole document" which can only be clicked once the whole thing has been filled out. Do to some information over lap some dates don't follow the (time line order) it requirest to fill in the data so two of the categories show up as incomplete. Take a look at the document yourself, maybe I NEED to rewrite the information and see if that works.
    *Edit* Looks like I CAN print a blank form at the begining when it asked me if i want a blank form, will try to rearange dates so it will show as all COMPLET.
    PDF file can be found at the California government website:
    http://www.chp.ca.gov/recruiting/pdf/Chp446.pdf
    http://www.chp.ca.gov/recruiting/pdf/Chp446.pdf

  • How to create a Printer List in Forms 4.5

    How can I create a Printer list on Forms 4.5 to show all
    available printers?
    Thanks.
    null

    I fear there is no direct solution.
    May be this is a work-around:
    1. Apply the older built-in: Display_item. You can't disable the item with display_item, but you can change the visual attribute and show the user that this item should not be checked.
    2. To be shure that the user doesn't ignore this "disable", you need a trigger, which resets the item to the proper value after an illegal change.

  • Is it possible to update multiple tables with a dynamic form?

    I have columns from two tables populating a dynamic form. I am trying to have the form update both tables on submit. I have tried both a linked transaction and a custom transaction but I am not making progress. Only the master table is being updated. Is it possible with ADDT to update two tables with a dynamic form?

    I meant
    SXMSMSTAT
    SXMSSYERR
    Thanks.

Maybe you are looking for

  • Payment for Absence Days in Off Cycle

    Hi, If an employee is to be absent during future payroll periods, for example, because of leave, you can pay the employee in advance for the period of the absence. The remuneration is calculated using Absence Valuation in Off Cycle Payroll. I facing

  • Power point import problem...help!!!

    when i import a power point presentation, it shrinks and i can't see it to edit it.  Why???  Can anyone help?

  • When to use Nested Class/Inner Classes ?

    I am not very clear, when to use nested/inner classes.. The scenario is :- class ABC //ABC need to store multiple instance of class XYZ class XYZ int member1; int member2; One approach is class ABC class XYZ //vector of class XYZ instances is stored

  • HOw to compare column with column using JCheckBox

    i have declare 4 JCheckBox which is a,b,c,d How to compare this value with the one in the database?

  • Problems setting "table reference" for TopLink relationships

    I'm trying to use TopLink to create Java objects over two tables that are linked in a many-to-many relationship. I followed the instructions on the 10g tutorial page (drag all three tables into a database diagram), then created a new field (of type C