How to print multiple items in SAPScripts

Hi gurus,
I have a list of items to print out in SAPScript but I can implement it. I've searched this forum for over a day and I can't find the correct answer. I post my code here. Hope you can help me. Thanks in advance.
__P/S:__ I found that someone here solved this by using index. Can you tell me how to implement it?
DATA: BEGIN OF ITAB OCCURS 0,
       Elements here
      END OF ITAB.
DATA: BEGIN OF XTAB OCCURS 0,
       Elements here
      END OF XTAB.
DATA: WA_XTAB LIKE XTAB.
DATA: ZOPTIONS LIKE ITCPO OCCURS 0 WITH HEADER LINE.
DATA: ZPAGE TYPE I.
START-OF-SELECTION.
  PERFORM PREPARE.
  PERFORM FORM_OPEN.
  PERFORM FORM_WRITE.
  PERFORM FORM_CLOSE.
FORM PREPARE.
Add data to itab & xtab.
ENDFORM.
FORM FORM_OPEN.
  CLEAR : ZOPTIONS.
  ZOPTIONS-TDDEST    = 'LOCLSVC'.
ST_OPTIONS-TDPRINTER =
  ZOPTIONS-TDPREVIEW = 'X'.
  ZOPTIONS-TDIMMED   = 'X'.
  ZOPTIONS-TDDELETE  = 'X'.
  ZOPTIONS-TDPROGRAM = SY-REPID.
  ZOPTIONS-TDTELELAND = 'VN'.
  CALL FUNCTION 'OPEN_FORM'
       EXPORTING
            DEVICE   = 'PRINTER'
            FORM     = 'ZF_CC_CI'
            LANGUAGE = SY-LANGU
            OPTIONS  = ZOPTIONS
       EXCEPTIONS
            CANCELED = 1
            DEVICE   = 2
            FORM     = 3
            OPTIONS  = 4
            UNCLOSED = 5.
  IF SY-SUBRC <> 0.
    MESSAGE E001 WITH 'Output was cancelled'
                      'by the user.'.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " FORM_OPEN
FORM FORM_WRITE.
  CLEAR ZPAGE.
  LOOP AT ITAB.
    ZPAGE = ZPAGE + 1.
    PERFORM FORM_START.
    PERFORM WRITE_TITLE.
    PERFORM END_FORM.
  ENDLOOP.
ENDFORM.
FORM FORM_START.
  CALL FUNCTION 'START_FORM'
       EXPORTING
            FORM     = 'ZF_CC_CI'
            LANGUAGE = SY-LANGU
           PROGRAM  = SY-REPID
       EXCEPTIONS
            FORM     = 1
            FORMAT   = 2
            UNENDED  = 3
            UNOPENED = 4
            UNUSED   = 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.
ENDFORM.
FORM WRITE_TITLE.
DATA: NCOUNT TYPE I,
      NI TYPE I.
    NI = 1.
    DESCRIBE TABLE XTAB LINES NCOUNT.
    DO NCOUNT TIMES.
      CLEAR WA_XTAB.
      READ TABLE XTAB INTO WA_XTAB INDEX NI .
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
            ELEMENT = 'ITEM'
            TYPE    = 'BODY'
            WINDOW  = 'ITEM'.
      NI = NI + 1.
    ENDDO.
ENDFORM.                    " WRITE_TITLE
FORM END_FORM.
  CALL FUNCTION 'END_FORM'
       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.
ENDFORM.                    " END_FORM
FORM FORM_CLOSE.
  CALL FUNCTION 'CLOSE_FORM'
       EXCEPTIONS
            UNOPENED                 = 1
            BAD_PAGEFORMAT_FOR_PRINT = 2
            SEND_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.
ENDFORM.                    " FORM_CLOSE

Hi Le Khanh Vinh ...
In Script have You declare Two pages... Let say there is Two pages with names like ..FIRST and Second.
In Standard Attributes of First Page give Next Page as Second.
and for Second Page Standard Attributes give Next Page as Second only.. This will resolve for more Line Items thats it..
Any Info need plz do reply ..
Regards,
Sg

Similar Messages

  • How to Print Multiple Languages in SAPScript ?

    Hi all,
             I want to print English and Chineese in the Same form (in SAPScript ). Please throw some light on this. Any reply is appreciable and rewarded.
    Thanks in Advance
    Jai

    Hi Jai,
    so even if you login in EN you want to display the name in ZH Chinese and EN as well.
    so in that case you wud have to make use of PERFORM command in Script in which you will retrieve the name based on the language(provided its maintained for both the languages in the Standard Table where you are fetching it from because its not the case of Translation).
    Perform get_name in program <xyz>
    using &kna1-kunnr&
    changing &name_zh&
    changing &name_en&
    Program <xyz>
    form get_name.
    "Here comes the code to read the using parameters in the perform command in script, KNA!-KUNNR
      select single name1
                 into wa_name_en   "Pass this to name_en
    from kna1
    where kunnr = = <kna1-kunnr>
    and    spras = 'EN'.
    select single name1
                 into wa_name_zh   "Pass this to name_en
    from kna1
    where kunnr = = <kna1-kunnr>
    and    spras = 'ZH'.
    Here comes the code to pass the changing parameters to script
    endform.

  • How do I print multiple items of a specific size on one sheet of A4 using photoshop elements 12?

    HI
    I have a small sublimation business whereby I print photo's onto small personalised gifts such as mugs, phone covers fridge magnets. I print out the images to fit the size of the gift i.e. a phone cover or mug the images are a specific size.
    Often I want to print multiple items onto one page each with a customised size as the paper is expensive and I need to make the most of every sheet. I can't figure out how to do this in photoshop elements 12  can anyone help / advise?I am using windows XP
    Thanks Lynsey

    You have a much better chance to get a useful reply if you ask in the Photoshop Elements forum.

  • How to print multiple footers for each page in RTF template xml report.

    Hi,
    How to print multiple footers for each page in RTF template xml report.
    i am able to print ( two sets ) ...
    up to last page ( one template ) and for last page ( another template).
    i want to change the footer information based on the group value printed in the report ( it might be 5 to 6) In every report run.. can you please check and let me know do we have any feasibility to achieve this.
    Thanks in advance.
    Regards,
    KAP.

    You can remove all other logic, like last page only contents (start@last-page:body), etc and section breaks if any you have inserted manually.
    Just have for-each@section logic.
    It would be difficult for me to guess what you have done without looking at your RTF or describing here.

  • How to print multiple copies on one page ?

    How to print multiple copies of one document on one page ?
    in coreldraw I used to make the document -for example a business card 5x9 - and when sending to print it automatically placed the number of cards that would fit in my A4 sheet.
    how do I make the same operation in Indesign.
    thanks

    Hi, Peter S.
    >I can see that as a shortcut to printing a page of different cards for multiple people, but to do a simple n-up of a single card it seems overly complex to me. What am I missing?
    * It's just an alternative to copy/paste and step/repeat.
    * For a one-time only use, perhaps it's a little more complex than necessary. But for any future needs, only the content of the data file needs to be changed, either by editing, or by pointing to a new data file. If different cards for multiple people becomes necessary, it's ready to go.
    Regards,
    Peter Gold
    KnowHow ProServices

  • HT1349 how to delete multiple items in itunes

    how to delete multiple items in itunes

    I inported my music files and see that I have multiple copies on my files so now I have multiple copies in iTunes.
    Some are multiples, some are duplicates, some are from different dates and some do not work and have the symbol for this.
    Thus, I must be picky about which ones I delete.
    Looks like I will have to continue deleting manually.

  • How to print table items in column in smartform in 4.6c version.

    Hi Experts,
    I want to print the items i have in columns (like name invoice number) in smartforms but when i create table in main window there no options for header footer and main area, i have created the template for header and footer but how i print the items in columns. Pls reply ASAP.
    Thanks in advance,
    Abhishek Pandey.

    Hi
    create a table under main window
    Under the Header create a Row or Line
    Under the Row create a Cell and Under that Cell create a text field
    In that text you can write what ever field name u want to write
    Reward if it is helpful to you
    Thanks
    Krushna

  • How to select Multiple items in the dvt:pivotfilterbar?

    How to select Multiple items in the filters in the dvt:pivotfilterbar?

    To select multiple media and other files, it's not possible. You can do so in messages as directed.
    To select multiple files, connect to your PC and select them.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to select multiple items in ListView?

    Is it possible to select multiple items (rows) in ListView? I'm able
    to select only one item at a time.
    I'm running Forte 30F2 on Windows NT 4.0.
    Thanks in advance,
    Ramarao
    Get Your Private, Free Email at http://www.hotmail.com

    Ramarao,
    I talked to Forte support about this recently and they had nothing but
    bad news.
    They said that you cannot select multiple rows in a listview, and that
    this is a
    feature that will be in the next release ( release 4 ).
    I then asked if it was possible for me to highlight a row manually ( and
    do the multiple
    select myself ), and they said that also wasn't possible. This is due
    to the fact that
    there are no displaynode properties that effect display attributes (
    like font or color ).
    They suggested that I try changing the smallicon to show rows that have
    been 'selected'.
    In other words, when you ctrl-click on any particular row, you could put
    an icon at the
    beginning of a row that shows that this row has been clicked on.
    I'm still working on this myself, so I will keep you posted.
    Jeff Pickett
    From: Ramarao P[SMTP:[email protected]]
    Reply To: Ramarao P
    Sent: Tuesday, March 24, 1998 6:22 PM
    To: [email protected]
    Subject: How to select multiple items in ListView?
    Is it possible to select multiple items (rows) in ListView? I'm able
    to select only one item at a time.
    I'm running Forte 30F2 on Windows NT 4.0.
    Thanks in advance,
    Ramarao
    Get Your Private, Free Email at http://www.hotmail.com

  • Can anybody explain how to print multiple copies of different documents at the same time as at the moment I have to open each individually and press print

    Can anybody explain how to print multiple copies of different documents at the same time as at the moment I have to open each individually and press print

    is this a windows in bootcamp question ?

  • How to Print Multiple line items(only the one's that are selected in va22)

    Hello All ,
    My smartform should print the multiple selected line items that i as a user should be able to see as the output .
    In my case i dont have any program that calls the transaction va22
    directly from the transaction VA22 i give the ISSUE OUTPUT TO .
    The Driver program that calls my smartforms fetches the data from table VBAP .
    Two cases that i get because of this fetching logic .
    1. When i try to fetch the data based on only VBELN in the output i get all the items that are in the particular Quotation .
    2 . When i try to fetch data based on VBELN and POSNR in the ouptut when i select multiple items and give print the first item that i i selected is displayed .
    Now what i need is to print only those data that i select in VA22 .
    say if there are items A, B , C, D ,E  in the Quotation .
    and before printing i select A , C , D then only those items should be printed .
    I hope any one  of the Experts  can solve my problem .
    Thanks & Regards
    Faran

    Hi
    I think you will need to do some enhancemwnt for this. What you can do select the lines in table comtrol and before issuing output you need to find a suitable wnhancement place where you can export the selected lines and make the corresponding change in logic for the same?.
    Secondly uou can make a custom report also where user will select lines of po and print..but in this way you will need to many calculations
    Nabheet

  • How to print multiple emails on one page

    How do I print multiple emails on a single page?

    Thanks, but fumbling around I think I found a better solution.
    All of the incoming e-mails have a see more from...." line in blue type at the bottom. When I click on the"See more from…"  line it opens up the entire chain of discussion which can then be printed on a single page. Exactly what I've been searching to do.

  • How to print multiple copies of same image (with specific fixed dimensions) on single page

    I am using Photoshop Elements 10 on Win 7 PC.  I am trying to print multiple copies of one image on a single 8.5x11 sheet of paper? The images are artwork for buttons (to be used in button-making machine) so the dimensions must be exact on the duplicated images.  When I select Picture Package, the images are resized to fit the dimensions in the picture package. When I select Contact Sheet, the images are resized to fit the number of columns I selected.  Neither is acceptable.  How can I repeat the same image on a single piece of paper without having the system re-size the image?  I know that I can manually create a new PSE file and manually insert the images into this file.  This is what I have been doing as a work-around.   But I would hope there is a better/faster way.
    Thank-you!

    A variation of hatstead's method where the pictures are precisely aligned:
    1. Add the picture to the blank file as hatstead described. Use the Move tool to position the picture in the upper left corner.
    2. Duplicate the layer. Use the arrow keys (NOT the mouse) to move the new layer to the right.
    3. Repeat step 2 until the row is filled:
    4. Merge Down the 3 layers into one. Alternatively, link the 3 layers and do a Merge Linked as in this example. The end result is the pictures in the row are on one layer:
    5. Duplicate the layer and use the arrow keys to move this down to the 2nd row.
    6. Repeat step 5 to create additional rows.
    7. Finally, to center the whole thing on the sheet, link all the row layers and position with the arrow keys.
    Note that you can also custom-make your own Picture Package. Instructions for this should be somewhere in Help.

  • How to print multiple mail forms in a single run?

    How can multiple, personalized letters be printed out from SAP CRM 7.0?
    Business requirement:
    When for example entrance tickets for a trade fair are sent to a group
    of customers, the accompanying letters are to be printed out of the CRM
    system.
    In SAP CRM 5.0 this was done by creating a marketing campaign, linking
    a target group & assigning a mail form to it.
    By selecting the communication medium "Printer" it was possible to
    print multiple letters in one run and send these documents by mail (not e-mail).
    The quantities of letters that have to be sent are too small to
    outsource the job to an external service provider (e.g. a printing house).
    In the latest version of SAP CRM the communication medium "Printer" is
    however no longer available in marketing campaigns.
    Does anyone know how this requirement can be met in SAP CRM 7.0?
    Thanks in advance for your reply,

    Thanks for your reaction.
    We considered working this way, but the idea was dropped because the quantities of letters that have to be sent are too large (several hundreds) & also because no follow-up of these activities is needed.

  • How to print currency symbol in SAPScript

    Hi,
    How to print different currency symbol in SAP?
    The requirement is that the SAPScript should print the currency symbol along with the currency code.
    i.e. USD ($)
    The currency can be any foreign currency.
    Is there any table where i can get currency symbol or is there any way i can print this. I am working in 4.6C.
    Please help.
    Thanks,
    Pratik

    Hii
    When the user has to insert a particular symbol, from menu:
    Insert->Character->Displayble Characters:
    Here in the input field insert <156> and then press enter

Maybe you are looking for

  • Computer Won't Detect iPhone5?

    Hey, I recently bought an iPhone5 and downloaded and installed iTunes etc. I installed all required updates. Problem is, my computer won't detect the iPhone at all. I've tested my old phone and my computer picks that up just fine, but with the iPhone

  • "invite to video chat" is inactive

    Hello I can't have video chat with my ichat6.0.1 in macbookPro with OS X10.7.3. The most of my icones in buddies is inactive.

  • IPhoto 6 not recongizing my camera? Help please!

    Hi, I've been using IPhoto very successfully with my Canon Rebel all along. I just hooked it up to my computer and nothing. I tried the Canon software and nothing there either. I checked in the profiler and image capture. The computer is just not see

  • Settings changs not saving

    I enable cookies, press ok and the settings window closes when i again open it the change i made is undone

  • Need an opinion on RAM

    Hey everyone. With Leopard coming out I have finally decided to buy 1Gb of Ram to up my computer to 1.5Gb of Ram total. I was wondering if anyone thought this (http://eshop.macsales.com/item/Other%20World%20Computing/4200DDR2S1GB/) was a safe bet. I'