Problem in Printing Multiple Invoice data

Hi,
My re quirement goes like this...
My SMARTFORM receives 2 internal tables :
1. Header data for all Invoices
2.Item data for all invoices.
Now I need to print each invoice in a new Page.
I have done like this.
First I am reading the header table with Index. After that I am incrementing the Index number.
v_index = v_index + 1.
READ TABLE HEADER index v_index.
So, first time the fist invoice will be processed and Its item data will be printed in the main window.
In the MAIN WINDOW after Item Table, i kept one COMMAND as Go TO NEW PAGE.
So, that its starts processing the page again. and Next invoice will be read.
Its working fine and Printing all the header data and footer data respective to that Invoice.
But, its not displaying that data which is there in MAIN window. Its displaying MAIN window as EMPTY.
I have seen in the debugging, when the NEW PAGE command is triggered, its processing all the secondory windows and PROGRAM LINES under that. But, it is not going into MAIN window Program Lines.
Please let me know, how can I solve My problem.
Thanks,
Sandeep

HI,
You can give a page break after every new header invoice. using a command window just assign the first value of the table to a local variable when it is passing into the loop and whenever the value changes, GOTO newpage.
Check the wiki,
[Pagebreak in smartforms|https://wiki.sdn.sap.com/wiki/display/ABAP/PageBreakin+SMARTFORMS]
Regards
Sarves

Similar Messages

  • Problem with Printing the Billing date...

    Hi Experts...
    Here im facing the problem in printing the billing date.
    The scenario is as follows.
    The posting date of Billing is 10.10.2008
      The document date of Billing is also 10.10.2008.
    At the time of printing the Billing document it is taking another date otherthan 10.10.2008,where it should be 10.10.2008.
    What modifications should i do to rectify the problem.
    Please advice.
    Regards,
    Y P.

    Prasad,
    Ask your ABAPer do debug and find out what date (Table-Field) is used in the Invoice Output program. You will know the reason and if you think that the date being used is incorrect, you can ask your ABAPer to change it to VBRK-FKDAT which is the billing date.
    Chandan

  • Printing the invoice date in the outgoing payment.

    Hi Experts,
    Please help me with this scenario.
    I need to print the invoice date and the item description and also the due date of the invoice in an outgoing payment in PLD.
    I think this can be done through wring a query in UDF through the formatted search.
    Could anyone help me with an alternate solution or a step by step procedure for writing the query.
    Your help is highly appreciated.
    Thanks,
    Hari Dharen

    Hi,
    Are you really wanting to have invoice date, item description and invoice due date or it is also including payment date and payment means ?
    Here is the query:
    SELECT distinct T1.[DocDate], T2.[Dscription],
    T1.[DocDueDate] FROM VPM2 T0  INNER
    JOIN OPCH T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN PCH1 T2 ON
    T1.DocEntry = T2.DocEntry
    Let me know if you need to know other field.
    Rgds,

  • Problem in printing multiple line items

    Hi,
       i designed a SAPSCRIPT FORM.When i execute the t-code MB01 by giving PO which has multiple line items ,  output type is invisible.
    But when i iexecute the t-code MB01 by giving PO which has single item , output type is visible and form is printing.
    Do i need to copy the print program and make changes in there or if i change elements in the form will that helps in printing multiple line items.
    thanks.

    HI,
    wat i understand is u r trying to loop at a variable window .but tht is not suggestable.
    write a loop in program lines. read the values in to different variables and the try printing them as text elements that will solve the problem.
    or else in other way use a template and that can also solve the problem.

  • Printing multiple queries data

    I am calling a report A from report B. Report A has multiple queries that are not linked. When I run report A directly it prints the data from both the queries just fine. However, when I call it from report B, it is only printing data for the 2nd query. Any ideas why this is happening?
    thanks

    Check if this can help you:
    Enhance web printing: multiple data providers!?
    Regards

  • Problem in printing internal table data in Sapscript!

    Hi All,
    Am trying to print internal table data into main window of sapscript.
    This is what I have written.
    loop at it_final INTO wa_final.
                  CALL FUNCTION 'WRITE_FORM'
                   EXPORTING
                     window   = 'MAIN'
                     ELEMENT  = '670'
                     TYPE     = 'BODY'
                     FUNCTION = 'APPEND'
                   EXCEPTIONS
                     window  = 1
                     element = 2.
                 IF sy-subrc <> 0.
                 ENDIF.
    ENDLOOP.
    IN Sapscript :
    /E   670
    IT     &wa_final-vbeln&,,&wa_final-vbelv&,,&wa_final-payment&
    =      &wa_final-rundate&,,&wa_final-waers&,,&wa_final-creditcard&
    =      &wa_final-augru&,,&wa_final-dmbtr&
    Pls let me know if am missing anything.
    Thanks & Regards
    Himayat

    Check if your Programm is called at the Sapscript level.
    Are you calling the programm from the Sapscript using the PERFORM command? or are these Programm and Sapscript set in customizing?
    Using SE16 check the Message Type and see if Sapscript and the programm are connected at all.

  • Problem in printing multiple main window in smartforms

    Hi Experts,
    I have requirement form client to print PO which consists of 4 page.
    First page is cosists of header and some text.
    In second page different header and line item.
    Thirs page different header and line item.
    4th page different header and line item.
    I have printed tex in main window of first page and called command to trigger
    second page main window, but i am getting dump.
    How to print the line item in the multiple page of smartforms.
    Regards,
    Udupi

    Hello ,
    To print the text below are following steps which you can follow for your requirement :
    1. Create the Four pages having the Main Window, but take care that Logic should be in First Page Main window only , other pages main window will be blank.
    2. Create the Secondary Window in second, third & fourth page  which will be same size as the main window having the text which need to be print in respective pages.
    3. Logic Part - in the main window of first page fill all the data which you need to print in 1st to 4th page in different internal table. Now for example you need to print text in first page then in Main window create table having the data of 1st page.
              To print data in Second page create one more table having data of secondpage and put the Command there (follow the same for next pages,)
    I hope this will  help you
    Thanks
    Romit Raina

  • Problem with printing multiple Embedded PDF in HTML page

    I have a list of embedded pdf in a html page to be printed in particular order. Using following java script i am trying silently print the pdf one by one. <br /><br />var objectList=document.getElementsByTagName("object");<br /><br />for(i=0;i<objectList.length;i++){<br />   priobj=document.getElementById(objectList[i].id);<br />   priobj.printAll();<br />}<br /><br />Actually the order of call to the printAll methods works correctly.  But the printing of PDF are not is correct order of call. <br /><br />Any Inputs or directions or workarounds on this issue will be really appreciated.<br /><br />Thanks a lot<br /><br />Prem

    HI,
    wat i understand is u r trying to loop at a variable window .but tht is not suggestable.
    write a loop in program lines. read the values in to different variables and the try printing them as text elements that will solve the problem.
    or else in other way use a template and that can also solve the problem.

  • Problem in printing continuous invoices

    Hi,
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = TEXT-029.
    IF NOT S_VBELN-HIGH IS INITIAL.
       CONCATENATE S_VBELN-LOW TEXT-030 S_VBELN-HIGH
       INTO WA_LISTHEADER-INFO+24 SEPARATED BY ''.
    ELSE.
        WA_LISTHEADER-INFO = P_PLANT.
    ENDIF.
      APPEND WA_LISTHEADER TO INT_LISTHEADER.
      CLEAR WA_LISTHEADER.
    Text-029  = 'Tide Water Oil Company Ltd Location'.
    But the ALV output is not showing the Entire Text.It is showing Truncated Text as the variable 'Key' is of 20 characters only.How can i output the entire Text.Please help?
    Thanks
    K Srinivas

    Hi write this statement befor calling REUSE_ALV_GRID_DISPLAY.
      gs_layout-colwidth_optimize = 'X'. and pass it to is_layout parameter in the FM REUSE_ALV_GRID_DISPLAY.
    Thanks
    Nayan

  • Scroll Bar Problem after Printing a web page containing multiple page data

    Hi All,
    I have a web application which has two DIV, one is main and one is child. I am having problem in printing multiple pages. There is a lot of data in the child DIV and i am using JavaScript functions to control the print functionality. When i print using window.print(), only the data on the main page currently being showed is printed. I further researched and checked out the Style.Overflow property.
    Now i am using divMain.style.overflow = "visible"
    After this the complete print comes. But in Firefox, the scroll bar disappears and only single page is left with no scroll bar .
    Now if after print i give divMain.style.overflow = "Auto" OR divMain.style.overflow = "Scroll", still the scroll bar doesn't come and if it comes then its inactive. I am unable to see the complete data on the page after the print is taken.
    The problem is not coming in I.E and the full data with scroll bar is recovered in I.E.
    Please help me how to get the normal page with full data and scroll bar after printing in Firefox.
    Thanks,
    Manuj

    hi, i would update my reader first to the newest version.
    does the size of the textfield never change, independant how much text is in it?
    perhaps check your subforms, if they are type "position" size does not change in my opinion, except your parent subforms expand to fit....
    or use "flowed" subforms...and regard the parent subforms too!

  • Problem in Printing of mutiple form on single click

    Hi all
    I m wrking on AFS and i had created a page for printing multiple invoice print on single click.
    A range of invoice is given as input and get out in the form of print preivew or print wat v choose .
    I mean a print pop is open for multiple invoice in a single click.
    Problem in printing of multiple form is speed .its going to be slow when click for printing .OR
    v can say that creation of multiple page in printing gets more time .Is ther  any way to solve  this .
    Plz suggest me some solution for that .
    Regards,
    Ravi

    Hi
    Check if Note 353518 - Selection of outputs takes much time and Note 910976 - Selection of output from billing (VF31) are relevants.
    Other suggestion. Do a trace with ST05 and check if you have any bottleneck in the coding that you can have in your Smartform or in your SAPscript, so check in tcode V/40 what form you are using . Also see Note 185530 - Performance: Customer developments in SD.
    I hope this helps you
    Regards
    Eduardo

  • Printing previous Invoice

    I'm having problem in printing previous invoice not the current one this happens almost 4 times a day, printing around 10000 vouchers per day can anyone explain me why?
    First i update data by using ExecuteScalar and getting Auto-Gen Number from Database
    Then I'm Updating Invoice Number to another Table for Invoice numbering system
    TicketNumberUpdate()
    lbl_Status.Text = "Updating Ticket Number..."
    Application.DoEvents()
    System.Threading.Thread.Sleep(200)
    then i wait and filter according to my ticket number and populate data to richtextbox 
    PrintFunc(" WHERE dbo.tbl_Tickets.TicketNo='" & txtTicket.Text & "' AND dbo.tbl_Tickets.Ticket_Type='" & cboTicketType.Text.Trim & "'")
    lbl_Status.Text = "Loading Ticket ..."
    Application.DoEvents()
    System.Threading.Thread.Sleep(200)
    and save that html text to temporary html file 
    rtb_TicketFormat.Rtf = rtb_TicketFormat.Rtf.Replace("Duplicate.png", "Original.png")
    Dim myFileName As String = IO.Path.Combine(IO.Path.GetTempPath, "_.html")
    rtb_TicketFormat.SaveFile(myFileName, RichTextBoxStreamType.PlainText)
    lbl_Status.Text = "Printing Ticket ..."
    Application.DoEvents()
    System.Threading.Thread.Sleep(200)
    and wait for Save that Invoice in html format after that i call for PrintTktz for printing that file
    Private Sub PrintTktz()
    Dim webBrowserForPrinting As New WebBrowser()
    AddHandler webBrowserForPrinting.DocumentCompleted, New _
    WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocumentz)
    webBrowserForPrinting.Url = New Uri(IO.Path.GetTempPath & "_.html")
    End Sub
    Private Sub PrintDocumentz(ByVal sender As Object, _
    ByVal e As WebBrowserDocumentCompletedEventArgs)
    Dim webBrowserForPrinting As WebBrowser = CType(sender, WebBrowser)
    webBrowserForPrinting.ScriptErrorsSuppressed = True
    webBrowserForPrinting.Print()
    webBrowserForPrinting.Dispose()
    End Sub
    when testing this works fine do you guys think some time when printing if below code could not save the file it gives that error? 
    rtb_TicketFormat.SaveFile(myFileName, RichTextBoxStreamType.PlainText)
    Thank you every one for you kind help!...

    I'm not certain. However from the code you display you are constantly creating a WebBrowser object then never disposing of it when you are done with it. So I would imagine at some point your applications memory is getting really high as you seem to create
    10,000 of them a day or something. Which means 10,000 created objects doing nothing and never to be used again are sitting in your applications memory.
    The code is "Dim webBrowserForPrinting As New WebBrowser()".
    It's possible the code for the sub PrintTktz could be altered as below which should dispose of the WebBrowser object when the code is done with it. But you will need to test it obviously. There's two subs. One has a Using statement which may not work and
    the other has a loop that runs until the WebBrowser finishes. Both may not work really.
    If neither work the issue still needs to be corrected. Of course if the loop runs for a long time the UI could freeze. And if the end using statement occurs prior to the WebBrowser loading well that's not good either of course.
    WebBrowser.IsBusy
    Private Sub PrintTktz()
    Using webBrowserForPrinting As New WebBrowser()
    AddHandler webBrowserForPrinting.DocumentCompleted, New _
    WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocumentz)
    webBrowserForPrinting.Url = New Uri(IO.Path.GetTempPath & "_.html")
    End Using
    End Sub
    Private Sub PrintTktz()
    Dim webBrowserForPrinting As New WebBrowser()
    AddHandler webBrowserForPrinting.DocumentCompleted, New _
    WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocumentz)
    webBrowserForPrinting.Url = New Uri(IO.Path.GetTempPath & "_.html")
    Do Until WebBrowserForPrint.IsBusy = False
    Loop
    webBrowserForPrinting.Dispose()
    End Sub
    La vida loca

  • How can I print multiple images on one sheet:  PSE 10/Mac?

    When printing, I can have all of my images in the dialoug box - but cannot figure out how to get more than one image on a sheet!  For example, I am printing several photos a 2x2, and want to put as many as possilble on 1 sheet instead of using a seperate sheet for each image.  I am on a Mac.
    Any ideas??  I can't seem to find the answer.  Thanks!

    Barbara B.
    Thanks for the reply to wdwpartners question. 
    I am new to PSE 10 (on Windows 7) and having the same problem with printing multiple photos on one sheet.  With 14-20  images both contact sheet and picture package force you into 2x2 prints, not the image's original HxW ratio thus loosing some of the image on paper.  Am I missing something?
    My old version of PSE gave me an option to "print multiple photos" and custom select the image dimentions which was very useful to me.  Please let the powers that be know this user asked for that option back!!
    Thanks for a reply.

  • Printing multiple Appleworks files

    Hello everyone,
    I have a problem when printing multiple Appleworks (spreadsheet) files in Finder. All the files are in one folder. But when I select all the files and print them from Finder, all the row- and column heads from the files are printed too. When printing the files one by one in Appleworks, everything works fine.
    Any suggestions how to prevent that from happening?
    Thanks!
    Maarten

    How is the Finder to know you want one layout versus another for each file?  It probably is assuming you want the same layout for all.

  • Excise Invoice Print problem for multiple Invoices

    HI   All,
    I Have developed a Zprint prog and zsmartform and attached it to standard tcode J1IP .
    when we execute J1IP outputtype J1I10  we get multiple invoices . if we select one check box and execute and press print preview/ print we get the print correctly . But if we check multiple check boxes and press print/preview then we have to press print button multiple times/come  back for every invoice .
    My requirement  is when we execute J1iP for multiple invoices it should not come multiple times pop up window ..ie in one print request we need to send multiple invoices . How to achieve this functionality.

    Hi,
    use NO_OPEN and NO_CLOSE fields of CONTROL_PARAMETERS structure
    in Your call to smart form function module.
    Currently You print every invoice in separate spool request.
    You should print all invoices in one big spool requests.
    Set NO_CLOSE = X to all, except last one, and NO_OPEN = X to all, except first one.
    Regards,
    Przemysław

Maybe you are looking for

  • Is there a way to force href="mailto: to use the default email client

    I would like to use the href="mailto:" in my website to automatically open an email but the end user gets the message "There is no email program associated to perform the requested action..." Is there a way to force to the mailto to use the and user'

  • Install Adobe Photoshop CS4 on Mac

    I have been trying to install Adobe Photoshop CS4 onto my MacBook Pro (2009 version) and it doesn't automatically popup to install. So i transferred the files to my "Application" on my mac. When i try to click on "Setup" an unreadable script appears.

  • Foot notes and Anchored Objects...

    So from what I can tell, an anchored object set to the bottom of the page, column, margin etc will all sit nice and smugly over footnotes! ( I would have thought using the column for the y axis would not count the footnote portion) Anyhow, has anyone

  • Strange message: "Firefox can't find the file at /b" Please advise.

    When I open Firefox I get this message: "Firefox can't find the file at /b". As a browser Firefox is working for me but I have to click the google search button to connect to the internet. I have tried everything I can think of including uninstalling

  • BAPI_SALESORDER_CHANGE problem: change sold-to-party

    Hi guys, I am having a problem with my current dev. I am using BAPI_SALESORDER_CHANGE to change the sold-to of a sales order. However, I am getting error message: "You cannot change entry in partner function XX". Can anyone help me on this? Thanks! j