[Urgent] How to Print Main Window Twice ??

Hi Everyone,
I am making a Prenum Check which has
1 Main Win 00 : Invoiced Item Lines for the Check Payment
2 Check Window: A Check to be printed
3 Main Win 01 : Copy of Main Win 00
The Main Window has Line Items of the Payment Invoices for Vendor, which can flow across multiple pages.So I cannot use NEW-WINDOW. I cannot make the changes in SAP Program. Please help me sorting out this issue with some small PERFORM Code which will copy contents of current main window and print it back in new window on the same page.
Please Help me....
Thanks in Advance.
Regards,
Abhsihek B.

HII
HAVE ALOOK AT THE CODE
TABLES : KNA1 , T005T.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
DATA : BEGIN OF ITAB OCCURS 0,
       KUNNR LIKE KNA1-KUNNR,
       NAME1 LIKE KNA1-NAME1,
       LAND1 LIKE KNA1-LAND1,
       LANDX LIKE T005T-LANDX,
       END OF ITAB.
DATA : V_LANDX TYPE T005T-LANDX.
DATA : IT_STEXT TYPE TLINE OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
  SELECT KUNNR NAME1 LAND1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE
ITAB WHERE KUNNR IN
S_KUNNR.
  LOOP AT ITAB.
SELECT SINGLE LANDX FROM T005T INTO (V_LANDX) WHERE LAND1 = ITAB-LAND1.
    ITAB-LANDX = V_LANDX.
    MODIFY ITAB INDEX SY-TABIX.
  ENDLOOP.
    CALL FUNCTION 'OPEN_FORM'
     EXPORTING
     APPLICATION                       = 'TX'
     ARCHIVE_INDEX                     =
     ARCHIVE_PARAMS                    =
     DEVICE                            = 'PRINTER'
     DIALOG                            = 'X'
       FORM                              = 'Z50653_PAGE1'
       LANGUAGE                          = 'E'
     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.
    CALL FUNCTION 'START_FORM'
     EXPORTING
       ARCHIVE_INDEX          =
       FORM                   = 'Z50653_PAGE1'
       LANGUAGE               = 'E'
       STARTPAGE              = 'PAGE1'
       PROGRAM                = ' '
       MAIL_APPL_OBJECT       =
     IMPORTING
       LANGUAGE               =
     EXCEPTIONS
       FORM                   = 1
       FORMAT                 = 2
       UNENDED                = 3
       UNOPENED               = 4
       UNUSED                 = 5
       SPOOL_ERROR            = 6
       CODEPAGE               = 7
       OTHERS                 = 8
    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 ITAB.
      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
         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.

Similar Messages

  • [Urgent] How to print Line items Twice in Check Printing ??

    Hi <b>Experts</b>,
    We have got a requirement of printing the vendor invoice info(Line Items) above and below the actual check.
    Eg.
    Page 1
    1-8 Line Items
    Voided Check
    <b>1-8 Line Items</b>
    Page 2
    9-16 Line Items
    Voided Check
    <b>9-16 Line Items</b>
    Page 3 ..... (last Page)
    17-20 Line Items
    Actual Check
    <b>17-20 Line Items</b>
    Now, All the things are printing fine except dual printing of the Line items at the below of Check.
    Please help me..... i am using Check print program <b>RFFOUS_C</b>.
    If anyone can has done something like this before than please send me the code for it.
    If someone requires more clarification, please ask me.
    Regards,
    <b>Abhishek</b>

    Hi Abhishek,
    we have done check printing here. but can u pl tell me why is the line item required to be printed below the check also??
    u must have observed that in the check sapscript ( F110_PRENUM_CHCK), the main window is situated above the check window.. n the line items are coming within the main window...since the line items are dynamic data( not fixed), u have to create a window below the check n that has to be a MAIN window again for it to display multiple data.. so wen ur last page is getting called ( u need to find that out that wen is the last page getting called ), u can insert a write_form for this new main window along with the other write_form( for the earlier main window).
    it can get very complex though as i dont know if this will certainly work...
    is the requirement reaaly to print the line items below the check or anything else will do?? as it wud greatly reduce ur headache...

  • How to print main window data in second page without header

    hi friends.,,,,,,,,,,,,,,,,,,,,
    I am printing billing docu details in main window ,the data is coming in two pages but there is problem in printing as the tables is continuing in second page the line is not coming for the table for first row,space is also coming for second page for header .
    my issue is to remove space before printing table and line should come for the table for 1st row in second page.
    please help .
    thanks in  advance.

    Hi Raghukumar,
    1. For the line not coming on the top row of the second page, check if the rowtype u have used in the table has been given a border on the upper side.
    2.For the space issue in the second page, I assume you might have used only a single Page in your smartform and the same page is called again.Hence as per the main window size and length data will be displayed in all pages of the smartform.
    You may need to create a second page with the Main window length occupying the compete page so that data display starts from the top of the page. next Page attributes of the smartforms should be entered accordingly.
    Please try to elaborate your query to help us understand your issue.
    Regards,
    Rijuraj

  • Main window twice

    Hi.
    I have requirement to print main window twice. Please help me out.
    1) In my script i make two main windows like MAIN 00, MAIN 01.
    2) In MAIN 00 i have ELEMENT 525 and 525-n( i am created). This two available in MAIN 02 also.
    3) In my Driver Program, I have two WRITE_FORMS for each ELEMENT.
    But i didnt get data twice.
    Regards.
    Sreenu Valeti

    Hi Sreenu ,
       Since you want 2 main windows you have selected Main 00 and Main 01 .
    1 . Now in script Align the 2 windows properly i.e see that they do not over lap on each other .
    2 . Use the Statement NEW-WINDOW to trigger a new Main Window .
    3 . Now call the elements of the other Main Window .
    Hereu2019s a sample(in Script) ,
    Element-525
    Element-525n
    NEW-WINDOW
    Hope it helps !
    Regards ,
    Amuktha .

  • 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

  • Smart forms- when i print a report it print main window data on same page

    hi,
    when i print a report it print main window data on same page .
    i.e. if data is more then one page then it shows data page wise on computer screen but when i print it print all data on same only one page by over wrriting .
    pl. help why it is happening
    i create page in page i set next page and in second page give first page.
    mukesh

    mukesh,
    what happened to this: smart form
    close that please.
    by the way,did you tried with what i suggested?
    lets say mainwindow in 1st page.
    copy the first page to second page.
    now.
    for 1st page: next page is : page2
    for page2: next page is also : page2

  • How to change main window title of oracle ebs

    Hi all,
    Kindly tell me how can we change the main title of oracle ebs 11i.
    Thanks

    Hello Gloscott,
    Welcome to the Aperture discussion forum. Congratulations. You just hijacked a thread. That's bad form for 2 reasons. First, you added a message to a thread called "How to change main window view" which makes it look like you had information to add that thread, and you did not. Second, people who can help you are more likely to read a message that has your problem in the subject than they are to read this message. I.e., you won't get what you want if you ask for something else.
    That being said, when you repost your query in a new thread, you'll have to be more specific. A "Frame" is not in the regular Aperture terminology.
    nathan
    Message was edited by: Mr Endo

  • How to hide main window in JavaFX 2.0

    I want to hide application window in JavaFX 2.0, calling hide() on Stage object terminate application. How to hide main window and left application running?
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class SysTray extends Application {
         public static void main(String[] args) {
              Application.launch(SysTray.class, args);
         @Override
         public void start(final Stage s) throws Exception {
              Group rootGroup=new Group();
              Scene scene=new Scene(rootGroup, 800, 600);
              s.setScene(scene);
              Button hide=new Button("hide");
              hide.setOnAction(new EventHandler<ActionEvent>() {
                   @Override
                   public void handle(ActionEvent paramT) {
                        s.hide();
              BorderPane mainPane=new BorderPane();
              mainPane.setCenter(hide);
              scene.setRoot(mainPane);
              s.setVisible(true);
    }

    That's interesting. I just checked and it looks like http://download.oracle.com/javafx/2.0/api/javafx/stage/Stage.html#close%28%29 is also an alias for setVisible(false);
    A little weird that they would have two aliases for such a thing. I'm guessing that setVisible isn't supposed to end the application, but what with JavaFX still being in Beta, the given functionality is acting as a placeholder. Maybe you should check [url http://javafx-jira.kenai.com/]Jira to see if this is already an issue. If not, you should probably file it to make sure.

  • Problem in printing main window

    Hi all
    i have to print  first four coloums with multiple records and fifth coloumn with data shown below ,how can i print this
    i have to display like this(ABCDE are my five coloumns)under coloumn E , i have to display text and values like shown,and first four coloumns are like shown.and heading for coloumn e is not required.i have to print this in main window.
    A-B-C--D----E
    1-1-11----point of departure = india
    2-22-2----
    point of arrival-US
    3-3-3--3--
    truck number=3442
    4-444---
    5---55-5----
    6--6-6-6---

    Hi gopaludu,
    Create the table in that draw the cells for the 5 columns.
    In table --> Header area : Declare the fields for all 5 fields.
                     Main area : In the 5th columns drag and drop the   
                                      fields required.
    Regards,
    Sravamthi

  • How to increase main window size dynamically in sapscript

    Hi,
    I have to print all records which are available in internal table in a main window.The main window is in between two variable windows.And below two other varaible windows are there.
    I want main window size to be increased as per no. of records available(max 12 records) in internal table.
    If the specified size is insufficient then the variable window which is below the main window should move below to accommodate the records available in internal table.
    This is very urgent requirement.
    Please help me.
    Regards,
    Vidya

    Hi Vidya,
    Main Window size cannot be changed dynamically.
    They are static values.
    However,  i hate to say this again but
    if you use a table with a footer the footer of the table will move up if the number
    of records are less. Sorry for not having a more positive reply.

  • How to print from windows 7 pc on time capsule network?

    I added a new pc with windows 7 on my time capsule network.  Existing network includes 2 macbook pros and 1 mac mini with boot camp and windows xp.  I have been using the windows xp with bootcamp on the mac mini and printing from it for a couple years.  We don't share files between the notebooks and mac mini, just internet access and printing.  My bootcamp side got too full which is why I added the new windows pc (yuk) for my windows programs but I cannot figure out how to get the windows pc to recognize my printer connected to airport time capsule.  I installed the printer software and drivers and connected it with usb and printed but when I connect the printer back to time capsule the pc doesn't see it.  Also, I downloaded bonjour from apple site but still no go.  Any help is appreciated.  As you can probably tell, I only know enough to be dangerous.  That's why I love my Macs, they just work!

    The problem is you loaded the printer directly and now do not have it plugged in.. so delete the printer in the control panel.. then setup the printer again.. this time connect to it as network printer. The bonjour should make it available as a network resource..
    Tell me if you still run into trouble doing that. You may need to load the IP of the TC manually..
    Window7 has higher security level than xp.. and that can sometimes also cause issues.
    Are you using SMB compliant names for the TC, wireless and printer??
    Can the windows 7 computer get internet via the TC? Can you ping it?
    Look up how to reduce the security level in windows to match xp.. I don't remember the details but you have to do some nifty footwork.

  • Urgent How to print 4 times?

    I one page having 2 labels on it. One main window and and 2 secondary windows. In secondary windows there is template which forms label. If I have 5 item qun. I have to display 5 labels. Applied loop to secondary window but its not happening. How to display label for no. of items times?

    Hi,
    To display the labels based on number of items create only a single main window and call the script in the loop (based on number of items).

  • Unable to print main window and associated secondary windows in next page

    Hi All,
    iam print line items values in first page by using main window (table) and associated  terms &condition in second window(template).
    But i want terms & condition to printed in other page.I tried to create COMMAND to manually trigger second page but it doest work.
    Kindly suggest.
    Attached is snap shot of current output(Shaded region are space of dat window).Also attached is overlapping of main and secondary windows.
    Since i need to increase the above template sizes i shifted main window and other 2 secondary window downwards so i wanted them to print in next page.

    Hi abhijeet,
    Add Programming lines before Command before loop statement,
    In that Count the itab using describe table.
    Add condition if count EQ Sy-tabix.
    pass to command line.
    Try this,
    Regards,
    Venkat.

  • How to inactive main window?

    Dear friends,
    I have created a progress window using the below code.
    public class ProgressDialogBox {
         private static final long serialVersionUID = 4999455972206841456L;
         private static JDialog dialog = null;
         JLabel label;
         JProgressBar progress;
         JPanel content;
         public JDialog getDialogBox(CSMainView csMainView) {
              JLabel label = null;
              JProgressBar progressBar = null;
              JPanel content = null;
              if(dialog == null) {
                   dialog = new JDialog();
                   dialog.setTitle("Progress Bar");
                   dialog.setAlwaysOnTop(true);
                   label = new JLabel("Please wait...");
                   label.setFont(new Font("Tahoma", Font.PLAIN, 13));
                   label.setBackground(Color.RED);
                   label.setForeground(Color.DARK_GRAY);
                   progressBar = new JProgressBar();
                   progressBar.setIndeterminate(true);
                   progressBar.setOpaque(false);
                   content=new JPanel(new GridLayout(2, 1, -15, 5));
                   content.add(progressBar);
                   content.add(label);
                   content.setBorder(BorderFactory.createEmptyBorder(30, 20, 30, 20));
                   dialog.add(content);
                   dialog.pack();
                   dialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              dialog.setLocationRelativeTo(csMainView.getMainFrame());
              dialog.setVisible(true);
              return dialog;
    }code to call the progress bar is
    ProgressDialogBox dialogBox = new ProgressDialogBox();
    JDialog dialog = dialogBox.getDialogBox(csMainView);The progress bar has to be displayed when i click START button.
    The problem is when i click start button, the progress window is displyed. but at the same time i can able to click start button again.
    My question is, the main window should not be active till the progress bar window is closed.
    Could anyone please tell me how to do this?
    Thanks in advance,
    Sathish

    Hi friends,
    my code is to display the ProgressBar is,
    public class ProgressDialogBox {
         private static final long serialVersionUID = 4999455972206841456L;
         private static JDialog dialog = null;
         JLabel label;
         JProgressBar progress;
         JPanel content;
         public JDialog getDialogBox(CSMainView csMainView) {
              JLabel label = null;
              JProgressBar progressBar = null;
              JPanel content = null;
              if(dialog == null) {
                   dialog = new JDialog();
                   dialog.setTitle("Progress Bar");
                   //dialog.setAlwaysOnTop(true);
                   label = new JLabel("Please wait...");
                   label.setFont(new Font("Tahoma", Font.PLAIN, 13));
                   label.setBackground(Color.RED);
                   label.setForeground(Color.DARK_GRAY);
                   progressBar = new JProgressBar();
                   progressBar.setIndeterminate(true);
                   progressBar.setOpaque(false);
                   content=new JPanel(new GridLayout(2, 1, -15, 5));
                   content.add(progressBar);
                   content.add(label);
                   content.setBorder(BorderFactory.createEmptyBorder(30, 20, 30, 20));
                   dialog.add(content);
                   dialog.pack();
                   dialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              dialog.setModal(true);
              dialog.setLocationRelativeTo(csMainView.getMainFrame());
              dialog.setVisible(true);
              return dialog;
    }calling is,
    ProgressDialogBox dialogBox = new ProgressDialogBox();
    JDialog dialog = dialogBox.getDialogBox(csMainView);  //Creating instance and calling ProgressBar dialog box
    isStarted = cmdExecution.startApplication();   //This is the application to start, this takes several minutes to start, till that time ProgressBar has to be displayed.
    dialog.setVisible(false);   //Disposing ProgressBar once the application started.
    dialog.dispose();If i give,
    dialog.setModal(true); then i can unable to dispose the ProgressDialogBox.
    Could anyone please tell me how to dispose this?
    Sathish

  • How to close main window on click of a button on popup window

    Hi All,
    I have created a web page which on certain condition display a popup window to to provide information. Wht i want is that when i click on close button on my popup window, my main window should also close.
    Can anyone please help with this requierment!!!
    Regards,
    tushar

    Hi All,
    Could anyone of you please help me by answering the thread
    WDDOEXIT method not called when the application is closed from the portal
    Thanks,
    Subash M

Maybe you are looking for