How to print a window (ex:total)only after end of main window in SAP Script

How to print a window(ex: total) only after end of main window in SAP Script
Thank you.

Create a total window and place it after your main window, get the number of lines in your main window and place counter
Ex,&SAPSCRIPT-COUNTER_1(+)&,
IF SAPSCRIPT-COUNTER_1& EQ <number of lines in main window>
**print total
ENDIF.
Regards,
Sairam

Similar Messages

  • How to show a window at end of main window in smartforms

    Hi guys,
    I want my window in smartform to show only after end of showing the main window,,,
    When i tick only after main window in condition tab of window, it shows on the uppermost portion of the output and not below the main window... Do I need to input the upper margin for this?
    How am i going to do it?
    Thanks a lot!

    Thanks guys,,,
    But still not working...
    Do I need to fill the upper margin of the final window?
    Since the height of my main window is dynamic, Im not sure what to fill up on the upper margin...

  • HT1923 how do you get the dvd drive back after installing itunes to windows 7

    How do you get the dvd drive back after installing itunes to windows 7??

    Safari/Preferences/General and set a new default.

  • HT5085 i have photo stream window  which i can not closo on main window of my I pad

    i have photo stream window  which i can not closo on main window of my I pad

    iCloud.com does not have a photos tab.  You would access these pictures on your computer via iPhoto, or on another iOS device.

  • I have apps loaded on my iPad. they show in the main screen are not available to load documents to in the window list which should appear below the main window. the same apps do appear in the sub window on my other iPad. any ideas?

    i have apps loaded on my iPad. they show in the main screen are not available to load documents to in the window list which should appear below the main window. the same apps do appear in the sub window on my other iPad. any ideas?

    From what I can see, unless you're doing things with old versions of Xcode on a Mac (in which case, the solution seems to be to upgrade to the latest version), this seems to e an iTunes issue.
    Accepting that it works fine with another iPad, I suggest trying the following:
    1. Restart the non-working iPad
    2. If that doesn't work, reinstall iTunes. If you're on a Windows PC, I suggest using Control Panel to uninstall all the Apple apps, restarting the PC, and doing a fresh install. If you're using a Mac, a repair permissions might help too.
    iTunes 10.3 is now available, and that may make a difference.

  • How to print grandtotal in table footer only in the last page in SMARTFORMS

    Hello Experts,
    How do I print the GRANDTOTAL in the table footer only on the LAST PAGE in SMARTFORMS.
    What I have done is in the text element of CELL1 of the table footer i wrote the folowing logic but not working.
    /: IF &SFSY-PAGE& EQ &SFSY-FORMPAGES&.
    * V_SUM.
    /: ENDIF.
    I even tried this.
    /: IF &NEXT-PAGE& EQ 0.
    * V_SUM.
    /: ENDIF.
    but still it displays the grand total on all pages at table footer.
    How do i go for this experts.
    Regards,
    Ranjith N

    HI Nambiar,
    To print the grand total only on the last page then create the secondary window --> create the text node for the grand total -->In the condition tab check only after the end of the main window.
    This grand total will be displayed after all the items and end of the main window.
    Footer in the table displays as the subtotals i.e on every page total is displayed..
    Regards,
    Sravanthi

  • How to print the report directly without previewing (report viewer) using c# windows application

    Hi,
    Currently, we are using crystal report to all of our reporting applications, but since I/users have encountered some issues about CR's speed to load only a simple report, maybe it is now time for us to adopt a new reporting environment in which I think SSRS
    can fill this problem.
    To start with, I have here a sample code, that uses the crystal report to print the report directly without previewing:
    csCashInvoiceCal csCashCal; --Crystal report name .rpt
    dsCsReceipt dsCs; --created dataset
    DataTable u;
    DataRow s;
    private System.Drawing.Printing.PrintDocument printDocument1;
    private System.Windows.Forms.PrintDialog printDialog1;
    ParameterValues paramValue;
    ParameterDiscreteValue discreteValue;
    ParameterFieldDefinition fieldDefinition;
    private void btnPrint_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt2();
    print2();
    csCashCal.Close();
    this.Cursor = Cursors.Default;
    private void loadReceipt2()
    dsCs = new dsCsReceipt(); --created dataset
    u = dsCs.Tables.Add("DtCsReceipt");
    u.Columns.Add("Qty", Type.GetType("System.String"));
    u.Columns.Add("UOM", Type.GetType("System.String"));
    u.Columns.Add("Description", Type.GetType("System.String"));
    u.Columns.Add("UnitPrice", Type.GetType("System.String"));
    u.Columns.Add("Discount", Type.GetType("System.String"));
    u.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    s = u.NewRow(); double.TryParse(dgvDesc.Rows[i].Cells[Discount2.Name].Value.ToString(), out discount);
    s["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    s["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    s["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    s["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    s["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    s["Discount"] = "";
    s["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    u.Rows.Add(s);
    catch (Exception) { }
    csCashCal = new csCashInvoiceCal();
    csCashCal.SetDataSource(dsCs.Tables[1]);
    //csCashCal.Refresh();
    loadParameter2();
    private void loadParameter2()
    ParameterFieldDefinitions paramFieldDefinitions;
    paramValue = new ParameterValues();
    discreteValue = new ParameterDiscreteValue();
    paramFieldDefinitions = csCashCal.DataDefinition.ParameterFields;
    discreteValue.Value = date;
    fieldDefinition = paramFieldDefinitions["Date"];
    commonParam();
    discreteValue.Value = txtcsno.Text;
    fieldDefinition = paramFieldDefinitions["InvoiceNo"];
    commonParam();
    discreteValue.Value = txtNameTo.Text;
    fieldDefinition = paramFieldDefinitions["CustomerName"];
    commonParam();
    discreteValue.Value = txtAdd.Text;
    fieldDefinition = paramFieldDefinitions["CustomerAddress"];
    commonParam();
    ------other parameters----
    private void commonParam()
    paramValue.Clear();
    paramValue.Add(discreteValue);
    fieldDefinition.ApplyCurrentValues(paramValue);
    private void print2()
    using (printDocument1 = new System.Drawing.Printing.PrintDocument())
    using (this.printDialog1 = new PrintDialog())
    //this.printDialog1.UseEXDialog = true;
    this.printDialog1.Document = this.printDocument1;
    DialogResult dr = this.printDialog1.ShowDialog();
    if (dr == DialogResult.OK)
    int nCopy = this.printDocument1.PrinterSettings.Copies;
    int sPage = this.printDocument1.PrinterSettings.FromPage;
    int ePage = this.printDocument1.PrinterSettings.ToPage;
    string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
    try
    csCashCal.PrintOptions.PrinterName = PrinterName;
    csCashCal.PrintToPrinter(nCopy, false, sPage, ePage);
    printcount++;
    //saveCountPrint();
    catch (Exception err)
    MessageBox.Show(err.ToString());
    This is only a simple sales receipt application that uses dgv and textboxes to push its data to dataset to the crystal report, a simple one but there are instances that it is very slow.
    But I'm having trouble implementing this using SSRS, since I'm only new to this one, wherein I created the report using report wizard, with two button options inside the form for print preview or direct print selection. Actually, it is very easy to implement
    with print preview because it uses reportviewer. My problem is that how can I print the report directly without using a reportviewer?
    So here is my code so far which I don't know what's next:
    private void button2_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt3();
    //print3();
    this.Cursor = Cursors.Default;
    ReportParameter[] parameter = new ReportParameter[11];
    private void loadParameter3()
    parameter[0] = new ReportParameter("InvoiceNo", txtcsno.Text);
    parameter[1] = new ReportParameter("Date", date);
    parameter[2] = new ReportParameter("CustomerTin", txtTin.Text);
    parameter[3] = new ReportParameter("CustomerName", txtNameTo.Text);
    parameter[4] = new ReportParameter("CustomerAddress", txtAdd.Text);
    parameter[5] = new ReportParameter("Agent", agent);
    parameter[6] = new ReportParameter("Discount", "Discount: ");
    parameter[7] = new ReportParameter("TotalDiscount", lblDiscount.Text + "%");
    parameter[8] = new ReportParameter("TotalSales", rdtotal);
    parameter[9] = new ReportParameter("Tax", rdtax);
    parameter[10] = new ReportParameter("TotalAmount", rdnet);
    private void loadReceipt3()
    DataSet dsrs = new DataSet();
    DataTable dtrs = new DataTable();
    DataRow drs;
    dtrs.Columns.Add("Qty", Type.GetType("System.String"));
    dtrs.Columns.Add("UOM", Type.GetType("System.String"));
    dtrs.Columns.Add("Description", Type.GetType("System.String"));
    dtrs.Columns.Add("UnitPrice", Type.GetType("System.String"));
    dtrs.Columns.Add("Discount", Type.GetType("System.String"));
    dtrs.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    drs = dtrs.NewRow();
    drs["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    drs["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    drs["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    drs["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    drs["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    drs["Discount"] = "";
    drs["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    dtrs.Rows.Add(s);
    catch (Exception) { }
    int addtlRow = 7;
    if (addtlRow > (count - 1))
    addtlRow = addtlRow - (count - 1);
    for (int i = 0; i < addtlRow; i++)
    dtrs.Rows.Add();
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    localreport.Refresh();
    //what's next....
    So what's next after local..refresh()? Actually, I have googled a lot but I didn't found the exact solution that I'm looking for which confuses me a lot.
    Anyway I'm using VS 2010 with sql server 2012 express.
    You're help will be greatly appreciated.
    Thank you,
    Hardz

    After some further studies with ReportViewer controls and with the use of this tutorial @ : http://msdn.microsoft.com/en-us/library/ms252091.aspx, which helps me a lot on how to print a report without using a report viewer, I found out what is missing
    with my code above and helps solve my question.
    Here's the continuation of the code above:
    private void loadReceipt3()
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.ReportPath = @"..\..\SsrsCashReceipt.rdlc";
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    Export(localreport);
    print4();
    private IList<Stream> m_streams;
    private int m_currentPageIndex;
    private void Export(LocalReport report)
    string deviceInfo =
    @"<DeviceInfo>
    <OutputFormat>EMF</OutputFormat>
    <PageWidth>8.5in</PageWidth>
    <PageHeight>11in</PageHeight>
    <MarginTop>0.25in</MarginTop>
    <MarginLeft>0.25in</MarginLeft>
    <MarginRight>0.25in</MarginRight>
    <MarginBottom>0.25in</MarginBottom>
    </DeviceInfo>";
    Warning[] warnings;
    m_streams = new List<Stream>();
    report.Render("Image", deviceInfo, CreateStream,
    out warnings);
    foreach (Stream stream in m_streams)
    stream.Position = 0;
    private void print4()
    if (m_streams == null || m_streams.Count == 0)
    throw new Exception("Error: no stream to print.");
    PrintDocument printDoc = new PrintDocument();
    PrintDialog printDlg = new PrintDialog();
    printDlg.Document = printDoc;
    DialogResult dr = printDlg.ShowDialog();
    if (dr == DialogResult.OK)
    if (!printDoc.PrinterSettings.IsValid)
    throw new Exception("Error: cannot find the default printer.");
    else
    printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
    m_currentPageIndex = 0;
    printDoc.Print();
    Dispose();
    public void Dispose()
    if (m_streams != null)
    foreach (Stream stream in m_streams)
    stream.Close();
    m_streams = null;
    private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
    Stream stream = new FileStream(name + "." + fileNameExtension,
    FileMode.Create);
    m_streams.Add(stream);
    return stream;
    private void PrintPage(object sender, PrintPageEventArgs ev)
    Metafile pageImage = new
    Metafile(m_streams[m_currentPageIndex]);
    // Adjust rectangular area with printer margins.
    Rectangle adjustedRect = new Rectangle(
    ev.PageBounds.Left - (int)ev.PageSettings.HardMarginX,
    ev.PageBounds.Top - (int)ev.PageSettings.HardMarginY,
    ev.PageBounds.Width,
    ev.PageBounds.Height);
    // Draw a white background for the report
    ev.Graphics.FillRectangle(Brushes.White, adjustedRect);
    // Draw the report content
    ev.Graphics.DrawImage(pageImage, adjustedRect);
    // Prepare for the next page. Make sure we haven't hit the end.
    m_currentPageIndex++;
    ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
    Thank you very much for this wonderful tutorial. :)

  • How to print in black and white only?

    Hello,
    I have HP Color Laserjet cp1515n. I downloaded and installed "HP_CP1510_series_full_solution_EMEA3-v4.0" from HP's website for the driver. 
    When printing (in the properties for the printer) there is no option whether to print in black and white only or not. Please help me get that option. And please tell me how I can save toner.
    Thank You
    I have windows xp 

    Hello!
    You can get this accomplished within most word/printing applications or preferences by selecting 'Greyscale' printing or black and white only.
    You can find an article related to this function with more details here:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01514143&tmp_task=useCategory&cc=us&dlc=en&lang...
    Hope this helps!
    Help the community by marking this post as a solution if it solved your issue!.
    If my post helped you in any way, please click the blue KUDOS star under my name! It would mean a great deal.

  • SAPSCript how to print  a comment at the end of main window on first page?

    In SAP Scripts, How do I print a comment at the end of the first page (I have several pages of data) in the main window?
    - Ven

    hi
    good
    yes we can put condition.....to display the footer window get printed after all data in main window gets over.........................assingn u r footer window to next page [ i.e u r second page] ...and write the condition
    In such senario no need to use a window for footer.
    In the Script form:
    -> In the Main Window itself after all the main data create an Element.
    -> Use BOTTOM and END-BOTTOM; write your footer information between them.
    In your Driver Program:
    -> After printing all the data (means after passing to form and before closing the form) call one WRITE-FORM with the footer element.
    I'm sure it will work.
    f u r not interested to change the print program. Then simply insert simple code in the footer wondow.
    now insert this code in ur footer window
    IF &TTXSY-PAGE& = &SAPSCRIPT-FORMPAGES&.
    *all code in footer goes here.
    ENDIF.
    &TTXSY-PAGE& holds the page number of current page.
    &SAPSCRIPT-FORMPAGES& holds total form pages.
    This will work.
    write this code then the footer will be printed in last page itself
    /: IF &NEXTPAGE& EQ 0
    whatever footer you want.
    /: ENDIF
    You need to create an element in the MAIN window. You can do it in two ways:
    1. In SE71, you can create:
    /:E FOOTER
    /:BOTTOM
    Text
    /:ENDBOTTOM
    In the print program, just call this element.
    2. In you print program, populate parameter type = BOTTOM in FM, WRITE_FORM.
    Ex.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'FOOTER'
    type = 'MAIN'
    window = 'BOTTOM'
    EXCEPTIONS....
    However, if you issue new page having new header data. Thus, new item data. And if it will exceed more than 1 page, the footer will still appear. To solve this, you need to create a new element in MAIN. Ex. INIT_FOOTER. It just contains the following:
    /:E INIT_FOOTER
    /:BOTTOM
    /:ENDBOTTOM
    Call this after passing all item data.
    reward point if helpful.
    thanks
    mrutyun^

  • How to print in black and white only on hp photosmart 6520

    Cannot find a place to select print in black and white only on my HP Photosmart 6520 printer.
    It prints color just fine, but sometimes I do not want to use my color cartridges. I selected B&W instead of gray scale, but cannot stop the color printing.
    Thanks

    Hi,
    Please try (for Windows):
    Double click printer icon on desktop,
    Clich Set Preferences
    Click Advanced
    Under Grayscale, select Black ink only
    Click Ok/Apply ..
    Please note: the printer still need color inks during warming up process.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to print multiple ALV Grids with only one print dialog?

    Hi,
    I have a report that has multiple ALV grids in splitter containers. The users want to be able to print those ALVs by pushing only one print button. I got it to work (parameter IS_PRINT and method SET_FRONTEND_PRINT before calling SET_TABLE_FOR_FIRST_DISPLAY) but I can't find a way to avoid that the printer dialog pops up for every grid I print.
    I tried to use the function module approach with REUSE_ALV_LIST_DISPLAY but have the same issue. Any thoughts?
    Thanks,
    Guenther

    Hi Peluka,
    Well, that's exactly what I am doing. Putting one central button in the app is not the problem; the issue is that the print dialog (to select the printer) pops up for every  individual ALV grid. E.g. if I place 4 ALV grids on my screen and trigger their print from a central button, I am getting 4 print dialogs.
    Cheers,
    Guenther

  • Need to print horizontal line at the end of main window in each page.

    Hi,
    I am printing a smartform with main window having 10 lines in footer. The problem I am facing is when the content extends upto two or more pages, I am not getting the horizontal line at the base of main window. For last page it is fine as it contains footer.
    Please suggest how to proceed.
    Thanks,
    RKU

    Hi,
    If you don't have any frame set on your main window:
    Go to output options and mark frames, and then go to details and uncheck checkboxes for above, laft and right, leving only below marked.
    This will give you a line in the bottom of you main window.
    If you dont' want to do this on the main window, can you create a new window placed at the bottom of the page and use this framing technic on that window. But in that case don't forget to mark the "always draw box and shading" checkbox. as this window contains no values, the will not get printed unless  you mark this checkbox.
    Regards
    Åsa Thenstedt

  • How to make firefox to display page only after that page is fully loaded?

    I'm using some kind of simple monitoring tool, wich refreshes page every 10 seconds. And i see, how page loads: first text, then graphs. Is there any way to make firefox display page only after that page fully loaded to make such slideshow more smooth?

    Try to increase the pref nglayout.initialpaint.delay to a very large value
    *http://kb.mozillazine.org/Nglayout.initialpaint.delay

  • AMD/ATI fglrx and 3d, only after booting first into windows

    I have a x1600pro agp and I can only get 3d acceleration to work if I first boot into windows. Every time after i turn off my PC, i first have to boot into windows or 3d wont work. It also happened with a 9600xt agp card.
    I'm wondering if it has happened to somebody else, and if it is because they are agp cards?
    It happens connecting with the vga or the dvi outputs of the cards.
    Is there a way around this? It gets really annoying having to boot first into windows.
    I also think many people having trouble getting they're 3d to work is because of this.
    Last edited by tacita (2007-11-07 18:05:45)

    tacita wrote:MrWeatherbee: thank you for the link, i have searched high and low (maybe in the wrong places) and didnt find anything before.
    Cerebral: yes, but then i guess it is a nice excuse to upgrade. And stay away from the Nforce3.
    I congratulate you for making the connection between Windows and 3D functionality in your Linux installation. That's the hardest part to figure out. Loss of hair can result wondering why 3D comes and goes without any apparent reason. However, once you know the secret, the behavior is 100% consistent. I rarely notice it because I rarely turn off the PC in question, and once the correct settings are locked-in by a single boot to Windows, 3D acceleration in your Linux distros will remain through any number of reboots. The only thing that requires a repeat of the Windows touch-n-go is when you power-off.

  • Using mail on Ipad only a blanc window will be displayed. after 10 sec this window disapears and the windows with appicons are displayd. redirecting from  safari to other mail adress works witout problems. Known Problem?

    Using mail on Ipad only a blanc window will be displayed. After 10 sec the window is automatically closed and the app icon will be displayed.
    Redirecting from  safari to other mail adress works witout problems. Known Problem?

    Try to force quit your mail app. Double tap the home button. You'll see the app icons and previews on the screen. Scroll sideways if needed to bring the mail app up on the screen. Flick the preview up and off the screen to close the app. Tap on the home screen preview to exit the mode.
    Try to open your mail again and see if it works.

Maybe you are looking for

  • Best way to extract lines from a log file in Linux

    My query is that I have a log file which is around 7 GB and I want to extract lines between a certain time range which should total up to half of the size to 3.5 GB. The lines start with a time range like                        "2014-03-11 17:35:00".

  • Pages, Numbers and Keynote will not update via app store

    App Store tells me there are updates for Pages (5.2.2), Numbers (3.2.2) and Keynote (6.2.2) but when I click on the Update button there is a little swirly in the top left hand corner near the maximise/minimise buttons but then nothing happens. I succ

  • Switching my ipod from windows to mac

    I am going to be buying the mac mini duo and i currently have an ipod+hp. Now my question is will i be able to still use the ipod i have now when i get my mac or will i have to buy a new ipod? Also what would i have to make my ipod for disk use and t

  • Where is the Crop tool in CS6?

    I used to use the Rectangular Marquee to crop an image, but that is no longer an option.  Where is the Crop tool?  I tried to use instructions at Photoshop Help | Adjusting crop, rotation, and canvas but that did not help.  It never did tell you how

  • LossLess Compatibility/Work-Arounds

    I'm using iTunes for Windows. I'd like to rip my music into a lossless format that would be compatible with iTunes and any other music players that I may need to use in the future. Apple Lossless works with iTunes and the format will work with my iPo