Two Elements in Main Window

Hello,
I am working on sapscript. MAIN window has two elements ( Order Info, Carrier Info. ) First page display only 1 - 10 records for each element in Main Window.
( In my scenario, it's possbile the either one of the element may have more then 10 record but 11th record should print in that section of Next Page )
Next page should display starting with record 11 on subsequent elements. How can i accomplish this scenario.
I apperciate your help.
Thanks
Hitesh

Hi,
in driver program, count the sy-tabix if it reaches '11', then call the FM 'CONTROL_FORM' and in the command give 'NEW-PAGE' and then call the WRITE_FORM of 2nd element.
write code like below in ur driver program.
eg:
data : gv_tabix.
LOOP AT itab.
gv_tabix = sy-tabix.
  IF sy-tabix LE 10.
   call function 'WRITE_FORM'
    EXPORTING
      element = element1
    EXCEPTIONS
    ENDIF.
    IF gv_tabix GT 10.
       call function 'CONTROL_FORM'
         exporting
            command = 'NEW-PAGE'.
       clear gv_tabix.
    ENDIF.
    IF sy-tabix GT 10.
       call function 'WRITE_FORM'
    EXPORTING
      element = element2
    EXCEPTIONS
    ENDIF.
ENDLOOP.
dont forget to give NEXT PAGE for first page as 'FIRST PAGE' name.
Hope it resolves
Rgrds,
Pavan

Similar Messages

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

  • How to display standard text element of main window in next page

    hi all
    In scripts we have standard script medruck for purchase order.
    i want to pull text elements ( terms and payment terms ) in to main window of next page.
    i have included main window in page windows of next page ,but im unable to print text elements of terms and payment terms in next page...
    any one give your valuable inputs.
    Thanks
    deepika.

    Hi deepika,
    First copy standard MEDRUCK to ZMEDRUCK and do the necessary changes.
    Then check in driver program when exactly Terma and condition text element is called. Generaly its after printing all items but just check once to confirm.
    If TERMS and condition element is called ate end just put a NEW-PAGE  command at end of the text element which is called before terms.
    Hope this will help You.
    Thanks
    Dhiraj.

  • Text-element in main window

    Hello together,
    is it sorrect, that text-elements can only be used in the main window?
    Is there any chance to use text-elemnts in a new-created window?
    an example that does not work:
    new window: TABLE
    call in print-program:
    CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_GR'
              window  = 'TABLE'.
    Unfortunately i need a new window with a possibility to print several text-elements.
    Thanks a lot for help.

    Hi Marcel,
    In one of my developments, i've created text elements in the windows other than MAIN window. But it worked properly. I think there might be some other reasons for ur failure. Try to trace that.
    Or else u just try by changing the Window type as CONST.
    Try this out & let me know in case of any other concrens..
    Reward if useful.
    Pavan.

  • Can I to execute two times the MAIN window in the same page?

    Hello, friends:
    How I can to execute 2 times the MAIN window in the same page in SAPscript, this without modify the program link a SAPscript?
    I create in the same page two MAIN windows, but I can to print only one MAIN window, the second window is not appears.
    Thanks for advance,
    David

    You can't - only one MAIN window is allowed per page.

  • Short dump when trying to see the text elements of main window

    Hi ,
            The form is running properly in 4.7 c . But when the same is copied in ECC5.0 (unicode) , i 'm getting short dump while trying to see the TEXT ELEMENTS .
                    The message is like ' trying to create a field with zero length'.
    Regards,
    Jytoi.

    hi
    I've never worked on ECC 5.0 version..however, I can only tell u that this could be the issue that code written in 4.7 may not be supported in 5.0..so try to get a good idea of ECC 5.0 before u start coding in this..
    regards,
    shamim

  • SAP Script need to display main window two times on single page.

    Hello Guru's,
    So here is my requirement, we need to print check. We are using F110_PRENUM_CHCK and linked with driver prog RFFOUS_C. We have Letter size paper with three sections,
    1. Check
    2. Voucher Section (containing table of element 515, 525 and 530) 515: Heading, 525 : Regup-Belnr, Regup-XBLNR, Regud-Wrbtr.
                                                                                    530: Regup-SGTXT
    3. Voucher Section (As a receipt for bank itself) : contains same data as 2nd section.
    I tried several things reading all the previous post over here in SDN.
    1. Created Z form created two instances of main window it results just single display of table (voucher section) in section two and not in third.
    2. I also tried pasting two times same code in single main window which gives only last item line for the table.
    3. Created z driver program made changes in Write_form added control form for element 515 that does results in showing element 515 on both the location.
                CALL FUNCTION 'CONTROL_FORM'
                  EXPORTING
                    command   = 'NEW-WINDOW'
                  EXCEPTIONS
                    unopened  = 1
                    unstarted = 2
                    OTHERS    = 3.
                CALL FUNCTION 'WRITE_FORM'
                  EXPORTING
                    element = '515'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
    3. For Element 525 and element 530 is not acting same. In the prog 525 = hlp_ep_element. And there are many write_form for this. I tried pasting each and every place same kind of code. It doesnt work. what it do it gives me three pages of output repeating every thing twice and weirdly.
    I am need this to be done as I already took so much time solving nothing is working.
    Please give me the exact location where to paste this code so I can have two times data of main window.
    Or is there any other way to do this....Any way will be good for me as long as it shows two times data in the form.
    The data is table.

    Hi Manju,
    I create a new window (no main) but does not run, please can you tell me what should I do to make it work.
    Best regards.
    Robert.

  • Columns in sapscript form in main window

    Hi,
    In the script for packing list, i want to display columns for the item details for the item details in main window.
    can any budy tell regarding how to write the box statement for the itrem details.
    regards,
    vamsykrishna.
    reward point for good answers

    hi vamsy,
          try this:
    Goto the text elements of main window spcify the following command.
       /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    WIDTH
    Width of the box. Default: WIDTH value of the SIZE command.
    HEIGHT
    Height of the box. Default: HEIGHT value of the SIZE command.
    FRAME
    Thickness of frame. Default: 0 (no frame).
    INTENSITY
    Grayscale of box contents as %.
    Default: 100 (full black)
    EXAMPLE:
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    thanks,
    raji
    reward if helpful

  • Second page main window not triggered

    hi
    i have two pages, a main window in each page.
    the data in the main window of the first page is diaplaying.
    But the data in the main window of the second page is not displayed.
    However the other secondary windows of the second page is
    getting displayed.
    any reason y???????
    pls reply

    Generally if we copy the first page  as is to second page there wont be any problem.  U can just specify the next page as second page.  U can not  have two main windows in smart form.  It should be copied from the first page or the next page for page should be first page.
    If there is any other page u have, then u have to call it dynamically.
    Change your form like this, and it may solve ur problem
    Please check that.
    Venkat.

  • How to Print text in two main windows

    For printing label have created two main windows on a page. calling function write_form In ABAP Program under do loop for two times. 
    but program prints only one window. why is it so? how can i print text on two windows.
    do 2 times.
      COUNT = COUNT + 1.
    loop at itab WHERE DEPTT LT 200.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            ELEMENT  = 'TEST'
            FUNCTION = 'SET'
            TYPE     = 'BODY'
          WINDOW   = 'MAIN'
          EXCEPTIONS
           ELEMENT   = 1
           FUNCTION  = 2
           TYPE      = 3
           UNOPENED  = 4
           UNSTARTED = 5
           WINDOW    = 6
           OTHERS    = 7.
      endloop.
    enddo.
    Please guide.

    Since the information is variable and coming out of the print program, I can assume you want to print many labels but two to a page. Also, any page numbering, etc will need to be updated. This is easily accomplished with SAPScript but a feature people rarely use I believe. Here are the simple steps:
    1) On the Windows Screen: Creat a main window for the size of the label, etc knowing that you will be putting multiple windows on a page. For example, if page size is 8.5 x 11, maybe your window size is 6 X 4 or something similar. You only need one main window defined.
    2) Now go to Page Windows Screen. Add a window MAIN and down at the bottom where it says Window Type put in MAIN. Next to this field is a little field about two characters long. In here put in '01'.
    3) Now Add another window MAIN and down at the bottom put in '02'.
    Hopefully this gives you the idea. I've done this with up to 30 small windows in order to print variable window for labels on label stock such as Avery 8167, etc. 
    Good Luck!
    Tim Stadler
    Menasha Corporation

  • 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

  • Two different main windows in one form?

    Hello -
    I have a requirement to print a list at the end of an invoice printout.  The invoice can cover multiple pages, and the secondary list can also cover multiple pages, one page per material.  So essentially I need two different definitions of a main window.  I tried defining my form like this:
    Page...............Next Page.......Main Window
    FIRST..............FIRST.............MAIN
    LIST.................LIST...............MAIN_L
    The first part prints fine, but I can't get the second part to print.  I tried adding a command after the first main window to go to page 'LIST', but nothing in window MAIN_L will print.  All the secondary windows on page LIST print, but nothing from MAIN_L. 
    Then I tried changing MAIN_L to be a secondary window and I can see my data, but in this case it will not allow me to enter the command to start a new LIST page. 
    Help!  Is this even possible?
    Edited by: Susanna Kohlmyer on Aug 20, 2008 2:39 PM

    Try to create two Table Nodes in the Same Main window.
    Like:
    FIRST  ... next is FIRST
    .. MAIN
    .... TABLE1
    .......HEADER (table1)
    .......MAIN (table1)
    .......FOOTER (table1)
    .... TABLE2
    .......HEADER (table2)
    .......MAIN (table2)
    .......FOOTER (table2)
    Regards,
    Naimesh Patel

  • Smart forms--In different pages i require two different main windows

    In one smartform, I am having two pages. and two pages are having different formats
    First page will print repeatedly till the completion of main window1.
    Now i want to add another main window(2) to second page, it will also should print repeatedly till the completeion of main window(2).
    But in first page main window contains 5 coloumns with subtotal
    in second page main window contains 3 columns without subtotal
    Both main windows are using same internal table.
    can anybody help me in this issue.
    If i copy first page main window into second page as main window with diferrent name, then it is showing blank window with out any text why?
    pls hepl me
    Madhavi T

    Try to do it like this, separate the data in internal table to two different tables, since data should be printed on two different formats...
    Design two page in your smartform according to the requirment. now goto first page and set the next page as FIRST
    now goto second page that you have created and set the next page as SECOND.
    loop the first internal table in first page and once all the entries are finished, try to goto second page for doing this place command and tick the check box in command, goto next page and select the page as Second...
    I guess this will solve your issue.
    close the thread once your question is answered.
    Regards,
    SaiRam

  • The main window of third page will not display the text element

    Hey, smartform guru,
    I am working on the smartform to print PO data.
    The smartform has first page and next page as usual.
    I created a third page P_TERMS to print the terms and conditions for PO printout.
    I used commend node to assign the page P_TERMS as the "Go to new page" and it did go to the P_TERMS page but the text element will not print in the main window in P_TERMS page.
    The text element will print in the secondary window.Since the terams and conditions are 4 pages long, I expected it to print in the main window, so I do not have to define several extra pages to print them.
    Any idea?
    Thanks in advance!
    Fisher Li

    Hi Fisher,
    Unfortunately, In a smartform, only single main window is continued to all pages even though you can declare windows under each page as main window, but it actually acts as the same window for all pages. It just means that if text from 1st page is overflowed, it will continue to the next page with main window.
    Command line to go to next page will create an extra page but since text is not flowed in main window, it won't print the text element you have included in main window on third page.
    The solution to your problem as I see is that either you include your terms and conditions in the main window of your first page and just before your text element for T&Cs, use Command to go to third page.
    Hope it helps.
    Ravi

Maybe you are looking for

  • Info bar in 10.7

    There's alot about Lion I'm not used to. How can I get the info bar at the bottom of Finder windows back? Thanks

  • What is the field name for logo and site from but000 table

    when i enter the logo , i should get all the sites of that logo,can u plz help me

  • I am unable to change the  e-mail password on my ipad

    After changing my hotmail password on my laptop I tried to change it on my ipad but it would not open any field to aalow me to do this through the settings app. Has anyone else had this problem

  • Function Sequence Errors with WebToGo

    I'm trying to build an application using WebToGo, and I get Function Sequence errors whenever I try to access a ResultSet object on my JSP page. I'm trying to follow (and somewhat duplicate) the tutorial application included with the SDK. Here is the

  • Setting up Area Geography Dimension in DBI

    Hi I am currently implementing the HRMS DBI, As per the documentatiion given for setting up the Geography dimension, DBI administrator-->Sett up--> Global Menu-->can find the geography dimension But i am not able to find the menu, because of this ini