Main window- urgent

hi,
i have a zsapscript copy of standard and driver program is standard program. i shud not change driver program.
now, after printing all line items i need to add standard text in main window. i cant chnage the driver program.
like...
Main Window
            Header
lineitem1
lineitem2
standard text
end of main window.
help me out guys,
Regards

Hi
You can load the table T_MATNR as the driver program loads the items to be printed.
I don't know what you're printing but for example if it was purchase order:
DATA: BEGIN OF T_MATNR OCCURS 0,
        MATERIAL TYPE MATNR,
      END OF T_MATNR.
DATA: COUNTER TYPE I.
DATA: N TYPE I.
FORM TEST TABLES IN_PAR STRUCTURE ITCSY
                 OUT_PAR STRUCTURE ITCSY.
DATA: _EBELN TYPE EBELN.
READ TABLE IN_PAR WITH KEY 'EKPO-EBELN'.
CHECK SY-SUBRC = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT = _EBELN
  IMPORTING
    INPUT = _EBELN.
SELECT MATNR FROM EKPO INTO TABLE T_MATNR
WHERE EBELN = _EBELN.
DESCRIBE TABLE T_MATNR LINES N.
COUNTER = COUNTER + 1.
IF COUNTER = N.
*----> It's the last material code
READ TABLE OUT_PAR WITH KEY 'VAR'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = 'L'.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDIF.
Max

Similar Messages

  • [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.

  • Problem in sapscript Main Window Box command - Urgent

    Dear friends,
    Problem while showing boxes in multiple pages in sapscript. Box command is defined begining of the main window. But while printing showing in first page only not in other pages.
    Regards,
    Praveen Lobo

    This could be your problem why box command is not getting displayed in all pages, you might be using the box command in the element that is only called once and that to in the first page... so try to check your form and place you box command under element that is getting called in each and every page, it will solve your poblem.
    Note: for testing you can place your box command under element "/E" where you are displaying your line items... even though it is called multiple number of times it gets overlapped.
    close the thread once your question is answered.
    Regards,
    SaiRam

  • Urgent : SAPScript: Main Window

    HI Gurus,
    Can two Main windows be created in a single sapscript with the same text inputs.?
    If yes, how can we do so?
    Useful response will be surely rewarded.
    Thansk in advance

    Hi Himayan
    you can do tht.....
    as you have on main window.......
    u want to have one more main wondow in ur page..if i m rit...then
    u can do so..
    goto  'page window' >Edit>Create Element-->then select then main window....it ll be sub main window as '01'...and u have to write  text in main '00'...only
    it will come in main '01' automatically...
    u can place this window any where in the page...may have different dimensions....
    It will work man i did it...
    Thnx
    Rohit

  • Issue with printing of multiple text elements in main window

    Hi experts,
    I have developed a sales order form in SAP script.
    I hv got two text elements in the main window. n i m calling these two text elements by using two write form functions in d print program.
    The first text element is gettin called n d relevant fields in dat particular text element is being displyed. (Window - Main)
    My problem is dat the second text element for the same main window is not gettin called n its relevant fields r not gettin displayed.
    Plz help me to solve the querry.
    Its urgent.
    Thanks n Regards,
    Purva

    Hi,
    Are you testing that from in same client where you developed, else make sure that after each change you need to transport the form to testing client.
    second thing is check with code did you mention the same text element in window editor and in the program.
    Reward if useful,
    Thanks,
    Sreeram.

  • Main window of different pages in script

    how to put different data in main window of two different pages?
    please reply quickly,its urgent.
    thanks in advance.

    Hi,
    you can try using 'IF' conditions by checking the &PAGE& variable or check if next page is getting triggered using sap counters available in teh table called SAPSCRIPT or call any particular text element from teh print program if there is a page break etc
    Regards,
    Simmi

  • How to skip secondary window below main window  to next page.

    hi friends,
                          this is tax retail invoice in which main window contain a table where the items are listed
    as the items increses. the remaining items get listed on 2nd page thats ok..but the calculation part as total get
    calculated on both page in secondary window
    below main window
    tried with command with go to next page
    plse suggest.soon...urgent.
    thnx in advance.

    Put a condition on this secondary window for totals. Flag the checkbox 'Only after end of main window'.
    Cheers,
    Edwin.

  • How to make text elements flow to next page depending on the table above it in main window (smart forms)

    Hi all,
    In my main window i have a table that contains line item data.
    Just below that i need to display text elemet (some text and terms & conditions).
    as below
    Based on the items in table, it should flow to next page. But it is not happening. rather the data which do not fit into first page gets deleted.
    Please help to solve this. Its urgent.
    Thanks in advance

    Hi Rashmi,
    please drop these texts from your table footer (i hope you have put into footer of your table), just create a template after your table and  put your all these data within this template and make sure that your this
    template should be called after your tables data get displayed.
    Or you can create a text , after your table where you put your data, and it should get displayed when the line items ends for your table.

  • To display vline if main window flows to next page in SAPScript.

    Hello,
    We are facing issue that we have to put vertical line at the end of page , if main window flows to next page.
    In our case, we have payment done for different currencies as well, so that means if for first currency USD we have 20 records then after 16 records page gets break then we want sy-vline to print there and next 4 records in next page, similarily for next currency EUR, then if we have 4 records it gets displayed on one page only, so no vline is required then.
    So like this if we have 3 pages to be displayed then on first page it should displayed vline as records gets overflowed.
    May be in Script we can have more than 3 pages as well, so at different currency when we have more records then only it should show vline, otherwise not.
    Also we have signature window inside main window, so on next page it should not display line after signature.
    So please help us for finding the solution to this issue as its really urgent.
    Thanks.

    Hi friend,
    So as of now you know that the line count for a page is 16.
    So after displaying records in main window just check the sy-index or keep a variable incremental for the loop.
    Check whether the variable count is 16 and put a sy-vline. So if we have less number of records or if we have a signature window the vline wont be executed.
    This will only be executed when there are 16 records for a page. So for better handling you can use the number of lines per page dynamically. Ie to know the size of lines in the page dynamically.
    Else use of end of page command to draw lines at the end of page. But the end of page command should be used inside an if else command.
    See the link below for more options in Scripts Link : [Editing Format Actions|http://help.sap.com/saphelp_nw70/helpdata/en/ce/6f0f82ea6311d18e2f0000e83dd9fc/content.htm]
    I think this solves your issue. Please revert back to me if you face any issues. I will help you.
    Thanks,
    Sri Hari
    Edited by: srihari.kumar on Jan 31, 2012 4:27 PM

  • TABLE IN MAIN WINDOW APPEARS ONLY IN 1 PAGE NOT OTHER!!

    FRIENDS I HAVE MODIFIED PM_COMMON STANDARD PROGRAM INTO ZPM_COMMON...TCODE IW3D.THE LAYOUT WHICH I HAVE CREATED IS TOTALLY DIFFERENT FROM PM_COMMON..I HAVE COMMENTED ALL THE CODING IN MAIN.EXCEPT FOR OPERATION NO AND DESCRIPTION...WHICH I WANT TO INSERT IN THE TABLE.NOW PROBLEM IS THAT I HAVE CREATED A TABLE.BUT THE TABLE IS ONLY SEEN IN 1 PAGE WHEN I PRESS PAGE DOWN THE TABLE DOESNT APPEAR....WHT DO I DO ...SO AS 2 I CAN VIEW THE TABLE ON ALL THE PAGES....BY PRESSING THE DOWN PAGE...
    PLEASE HELP URGENT.....
    REGARDS ESSAM([email protected])

    Hello,
    Include the Text ELEMENT U have used to draw the table in the loop of the main window.
    Vasanth

  • 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.

  • I have used Lr many years without problems. Now it is inpossible to edit . Can not see the editing in main window only in the small thumbnail. Suddenly it is not possible to import  raw-files from my Linux camera ( it worked earlier)

    Editing mode does not work. I can not follow de editing in the main window. I cah see it in the thumbnail.

    From your description of the problem, I suspect that you have a standalone license but have downloaded and installed the CC update. Or, it's the other way around. In either case, you need to install the right version.

  • Page break for Smartform with multiple main window on pages

    Hi Experts,
    I have a requirement for printing 3 pages. The difference among the 3 pages is the main window part.
    The main window contains not only internal table, also complicated texts like payment instructions etc.
    The requirement is in each page, the data in internal table should be changed, also payment instruction should be changed accordingly.
    e.g:
    Main Window of Page 1
    Part 1 for Internal table
    VAT on ITEM ------- 4O-------60,00------0.00%-------EUR
    Part 2 for Payment Instructions
    Texts for Page 1
    Main Window of Page 2
    Part 1 for Internal table
    VAT on ITEM ------- 5O-------60,00------0.00%-------EUR
    Part 2 for Payment Instructions
    Texts for Page 2
    Main Window of Page 3
    Part 1 for Internal table
    VAT on ITEM ------- 6O-------60,00------0.00%-------EUR
    Part 2 for Payment Instructions
    Texts for Page 3
    At first, I was using only one page 'Page1' with a variable page_no = 1 as default value, and use program line page_no = page_no + 1 as counter. when page_no = 2, use command for force page break to 'Page1', then under the command, change the internal table and payment instruction texts. when page_no = 3, ...
    But I encountered an error saying:
    Runtime Errors         GEN_BRANCHOFFSET_LIMIT_REACHED
    Short text
         Jump distance is too large and cannot be generated.
    So I created 3 pages, with different main window M_window1, M_window2, M_window3 for each page. In page1, after printing the M_window1, page_no = 2, use command to go to page2, but page2 is never printed. I think this is because only one main window can exist in a smartform? but why smartform allows creating individual main window for different pages? what's the use of such main window?
    By the way, what's the use of command for force page break? only work for one main window in a smartform?
    Getting back to my requirement, I think I should still use one page and command for page break. I am trying to solve this.
    Thanks.
    Li Jun Da.

    Now I am using 3 pages: Page 1, Page 2, Page 3.
    Page 2, Page 3 are copies of Page 1 with main window renamed as second window: mw 2, mw 3.
    I also created 2 command nodes in main window of page 1: cmd 2, cmd 3.
    cmd 2 is for page break to Page 2, cmd 3 is for page break to Page 3.
    The second window mw 2, mw 3 in Page 2, Page 3 can be displayed.
    Even though, I still can't understand how main window of pages (not 1st page) can work.

  • Two main windows in smartform or two loops in one main window?

    Hello All,
    I have requirement in smartform where i want to print two diffrent data header and item data in the same page.
    and in between these two data i want one template to be printed for item data .
    Smartform is giving me error if i use two main windows
    if i use two loop nodes in the main window thn how to restrict the data getting over flowed to template(item data)
    scenario is
    header data****
    **item header**
    item data****
    Pls comment....
    Regards,
    Sunny

    As main window can only be one, so try it this way:
    Under main window create a TEXT1 for header text( first header) than a LOOP1 for looping the header table, under that first create a TEXT2 for header data, than below it create another TEXT3 for header text ( Second header), than below it add a LOOP2 for looping item table and in that add a where condition than under it a TEXT4 for item data .
    MAIN_WINDOW
        TEXT1                                     " first header
        LOOP1                                    " header table
            TEXT2                                 " header data
            TEXT3                                  " Second header
            LOOP2                                " item table with where condition
                TEXT4                             " item data
    With luck,
    Pritam.

  • How to use Two main windows with in a page in script ?

    Hi any body explain me...
    How to use Two main windows with in a page in script ?
    with  header data in one main window,
    & Item data in other main window.

    HI..,
    u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
    Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
    Here is the procedure !!
    -->Create a page window and assign it to a page.
    Choose <b>Edit --> Main windows</b>.
    A dialog box appears.
    -->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
    -->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
    Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
    -->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
    <b>
    Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
    In label printing, the field Upper margin also varies from main window to main window:
    <b>
      Upper margin of current main window +  Window height + Vertical spacing = Upper margin of next main window</b>
    -->Enter a value in the field Start position.
    This is a counter. Enter a starting value which is equal to or greater than 1.
    -->The main windows are added to the list.
    -->Save your form.
    reward if it helps u...
    sai ramesh

Maybe you are looking for