First Record is repeated twice in main window of script

Dear All,
I am developing a Script form, which contains 3 windows Header,Main and Footer. My Problem is that in Main window
the first record is repeated twice and the remaining all records
are ok. I am unable to solve this issue of stopping the duplicate
first record. Your response might be helpfull to me.
Regards,

I came across this prob today too.
I did some digging, maybe it is something with the window type, this prob only occurs when the type of the window is continuious, and it is only possible for the main window to be set to the continuious type.
The only way, as far as I know, is that you can put those your wanna print in a text element. And by doing so, the prob is gone. But, do pay attention to those are not continuious type windows, and remember that they are variable. The content of the windows like those, are only kept until the next write_form is called to repaint the window content and any content of the ex-window would vanish without a trace. And if you also put the content of the variable windows in a text element, there will be some format confusion getting in the way.
That is all I got, But I still have no idea about the course.

Similar Messages

  • Maintianing multiple line items in main window  in scripts

    Hi folks,
      i want to print multiple line items in main window of script for eg 50 line items then my main window should continue in second page also. how to maintain this.
    can u provide me sample code for this..
    Thx in advance,
    Neelima.N

    You have an internal table with 50 lines, is it correct?
    Let's say, there's a MATNR field in your internal table.
    First do, what I wrote in my previous comment.
    The create an element in yout main window, like this:
    /E LINE_ITEMS
    /  &GS_MAIN-MATNR&
    In your printer program you have to code the following:
    LOOP AT gt_main INTO gs_main.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    WINDOW = 'MAIN'
    ELEMENT = 'LINE_ITEMS'.
    ENDLOOP.
    This code will loop all 50 of your table entries.
    In the MAIN window will fit 30 entries.
    When the LOOP is reaching the 30th entry, SAP will automatically create a new page (because of the NEXT PAGE statement you set in the page settings in the SAPScript) and will continue the printing.
    Regards
    Tamá

  • How to create an Area and place main windows in scripts

    How to create an Area and place main windows in scripts ?

    hi prasad,
    jst create a page first and define page windows.
    here u can specicify whether the window is main or secondary.
    to adjust the window goto form  painter  do the adjustment.

  • Box in main  window of script is not printing

    Helllo Friends
    Box in main window of script is not printing but the same is available in print preview. I have use the following commands.
    Please help me.
    /:           BOX WIDTH '23.40' CM FRAME 20 TW
    /:           BOX XPOS '0.00' CM YPOS '1.40' CM WIDTH '23.40' CM FRAME 25 TW
    /:           BOX XPOS '0.00' CM YPOS '8.10' CM WIDTH '23.40' CM FRAME 25 TW
    /:           BOX XPOS '0.00' CM YPOS '9.00' CM WIDTH '23.40' CM FRAME 25 TW
    /:           SIZE  WIDTH '0.00' CM HEIGHT '8.10' CM
    /:           BOX XPOS '0.00' CM  FRAME 25 TW
    /:           BOX XPOS '0.50' CM  FRAME 10 TW
    Thanks In Advance
    Regards
    SUNITHA

    Try changing X postion to not equal to zero something else for example.
    /:           POSITION WINDOW
    /:           POSITION XORIGIN '-0.1' CH YORIGIN '+0.4' LN
    /:           SIZE WIDTH +0.7 CH HEIGHT +5.0 LN
    /:           BOX FRAME 7 TW
    /:           BOX HEIGHT '1.1' LN INTENSITY 15
    Nabheet

  • What is the use of MAIN WINDOW in SCRIPTS

    what is the use of MAIN WINDOW in SCRIPTS, y we con't create a script w/o main window.
    Title was edited by:
            Alvaro Tejada Galindo

    Hi
    See this
    What are the different types of windows in SAP Scripts?
    Windows are defined in the Layout sets which define the position and the text to displayed.
    The different types of windows are:
    MAIN - Main Window
    The main window is a continous window which can extend over several pages. If the text in the main window fills up a page, a new page is created.
    Only one main window can be defined in the SAP Script whereas upto 100 instances of main window can be created in a page.
    VAR - Variable Window
    This window can have the variable contents displayed on them. The contents of the window cannot exceed the window size. The content can be formatted for each page.
    CONST - Constant Window
    The constant window can have a fixed content and is formatted only once.
    Main Windows (MAIN)
    Each form must have one window of type MAIN. Such a window is called the main window of the form. For SAPscript forms, the main window has a central meaning:
    • It controls the page break.
    • It contains the text body that may cover several pages.
    • It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form. The SAPscript composer thus avoids reformatting of the text after each page break.
    Variable Windows (VAR)
    The contents of variable windows is processed again for each page, on which the window appears. The system outputs only as much text as fits into the window. Text exceeding the window size is truncated; the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR. Therefore, if you create a new window, always use type VAR.
    <b><REMOVED BY MODERATOR></b>
    Anji
    Message was edited by:
            Alvaro Tejada Galindo

  • Printing dynamic box in main window in scripts

    hi ,
    I want to print the dynamic box in main window of my script.
    Ex. Suppose the content of the main window is 5 lines so it should print box for 5 those lines only.

    Hi,
    Create a Main window with only 2 lines, Give a BOX command it will give u Border for entire Main window.
    /:BOX FRAME 10 TW
    For giving vertical lines Syntax is
    /:BOX XPOS 16 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME 10 TW
    It gives u a vertical line at 16 character. so for ur requirment add another command at another XPOS.
    Try this below just below ur ITEM ELEMENT which has the display fields.
    Main Window
    /E ITEM_A
    A,,,,&ITAB-ABC&,,&ITAB-XXX&,,&ITAB-CDE&,,&ITAB-GEF&
    /:BOX FRAME 10 TW
    /:BOX XPOS 16 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME 10 TW
    /:BOX XPOS 26 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME 10 TW
    /:BOX XPOS 36 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME 10 TW
    /:BOX XPOS 46 CH YPOS 0 LN WIDTH '0' CM HEIGHT 2 LN FRAME 10 TW
    Change XPOS according to ur requirement.
    Now add another main window to the same page with changing UPPER margin, U can add upto 99 Main windows in one page.
    So add upto ur Page is full.
    For headings
    Create a Variable window same as Main window, in place of fields, give descriptions.
    Make sure that u give BOX command below the field declaration, if u give above, for last record it will not print box.
    Regards
    Bala Krishna

  • Unable to print BSEG-SGTXT in Main window - SAP Script

    Hi
    I have an issue in Scripts.
    I want to print BSEG-SGTXT in my Main Window and below is my code but i am unable to print the text. while debugging, i am getting value in zsgtxt field, but i am unable to get/print in script.
    can any one help me why it's not printing? and plese suggest where it's wrong.
    In Main window:
    /:   PERFORM TEXT IN PROGRAM ZFIGS_CHECK_PRINTING     
    /:   USING &REGUP-BELNR&                              
    /:   CHANGING &ZSGTXT&                                
    /:   ENDPERFORM                                       
    CH   &ZSGTXT&           
    In Subroutine pool:
    FORM text TABLES intab STRUCTURE itcsy
                             outtab STRUCTURE itcsy.
      DATA: zbelnr(10),
            zsgtxt LIKE bseg-sgtxt.
      READ TABLE intab WITH KEY name = 'REGUP-BELNR' .
      IF sy-subrc = 0.
        MOVE intab-value TO zbelnr.
        SELECT SINGLE sgtxt INTO zsgtxt FROM bseg
              WHERE bukrs = '8140' AND
                    belnr = zbelnr.
        IF sy-subrc = 0.
          MOVE zsgtxt TO outtab-value.
          MODIFY outtab INDEX sy-tabix.
        ENDIF.
      ENDIF.
    ENDFORM.
    Thanks,
    Siva

    Hi,
    Can any one tell how to write loop statement in Main window to display BSEG-SGTXT. As i am getting text (BSEG-SGTXT) from subroutine pool and calling into Main window using Perform statement and printing duplicate text in multiple times insted of different text.
    Thanks,
    Siva

  • How to determine Last Lite Item of a Main Window in SCRIPTS

    Hi All,
    I have a requirement <b>to print a value after all the Line Items have been printed in a main window.</b>
    The question is <b>how do I determine the end of Line Items</b>?
    Also, this needs to be done without a change in the print program.
    Please suggest your valuable opinions.
    Thanks & Regards,
    Arun

    Hi yerram,
    1. There is no direct way,
       to know which is the last line time getting printed,
       (from inside the sapscript)
    2. Bcos, the sequence is controlled by the driver program.
    3. What u can do is check the driver program and the layout,
       to detect,
       some ELEMENT
       which must be getting printed, after all the line items are printed.
      (inside that element, u can write your own
       text to get printed)
    regards,
    amit m.

  • Possible to print Int.Tab data in a window other than MAIN window in Script

    Hi,
      Can we print a internal table data in a window which is a VARIABLE Window in SAP Script? my requirement is not to print in MAIN Window.
    Thanks in Advance,
    Jakeer.

    Hi,
    You can do that.But main window is must.
    Create a text element and please check it maynot overflow if so data will be truncated.
    For not printing main window :
    Do one thing set the main window margint to the botom of the form.
    Then create a text element in main element
    NEW             
    NEW-PAGE        
    NEXT            
    NEW-PAGE = 'NEXT'

  • SAPscript layout -Repeating Main window in same page

    Hi,
    I have a requirement in sapscript layout to duplicate content within a page in two sections, of which the content can span across multiple pages.
    Can anyone give an idea how this can be achieved.
    This particular layout has 3 sections:
    1st window (Top window): invoice Details (multiple items)
    2nd window (Middle window): Check Details single item
    3rd window (Bottom window): invoice Details (multiple items) {same content of the 1st window}
    The invoice details can span across multiple pages.
    Main window alone works perfect with the requirement.
    I have attempted with a copy of a Main window for the 3rd window, and as it's specified it can only continue from the 1st main Window and i couldn't find a way to control it's value passing from the calling program.
    I have also tried using a dynamic window for the 3rd window, but haven't worked  to get the desired values shown across multiple pages. When it cross to a new page it repeats its last value across all pages.
    Please help me with this. Thanks in Advance.
    Regards,
    Viraj.

    The Standard layout only prints the invoice details once.
    If your existing layout prints invoice repeated, which means that already a customization is in place which repeats the invoice breakdown.
    If the items are being repeated in the main window, it could be that the repetition customization is done on the calling program, then a solution could be to remove/comment that call  in the calling program by searching text element name.
    If the items are being repeated from a non-main window, then a solution could be to remove/comment the entire element in the non-main window.
    hope this helps
    Best Regards,
    Viraj.

  • 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

  • How to do SUBTOTAL AND TOTAL in Main Window of SAPSCRIPT.

    Hello Friends,
    I am modifying standard SAPSCRIPT of packing slip. My client wants a subtotal and total in Main Window of Script for Eg. (They want Material Number wise Subtotal and finally Grandtotal at bottom in Main Window)
    Now i got stucked up here how to do it ?
    here is my sample code.
    LOOP AT XVBPLP WHERE VENUM = SHENR.
    IF XVBPLP-POSNR IS INITIAL.
        Versandelement
          PERFORM PACKING_TREE USING XVBPLP-UNVEL.
        ELSE.
        Lieferposition (Anteil)
          VBPLP = XVBPLP.
      CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            ELEMENT = 'DELPOS'.                     "Main Window call
    clear vbplp.
    ENDLOOP.
    Pls guide me for the same.

    HI,
    For the Line items, put a ELEMENT in the Smartform, and you will call this with in the LOOP and ENDLOOP, so here with in the LOOP count the TOTAL value.
    then create new element after the Line item Element, and call this Element after the Line items prints,
    /E  LINE_ITEM
      &1& &2 & &3&     " This will be in the loop and you need to caliculate the totla here
    /E SUB_TOTAL.
    &SUb_TOTAL&  " After all the line items pritns then call this Element
    Regards
    Sudheer

  • Dispalying total below the main window.

    Dear All,
    I have one main window in script and there I am disploaying few line items.
    Just below the main window I have created another window for displaying total of the line item.
    How I will adjust the window that TOTAL should comes exactly below the line items.
    Please guide.
    Thanks & Regards,
    Abhay.

    Hi ,
    If it is a Script ,
    Please dont create another window:
    keep the totals in the main window only
    this gets displayed after the total
    Reward if Use full
    Karthick

  • How to output particular text in main window only in first page

    Hi experts how to ouput particular text in main window only in first page after that actual transaction data will be continued.....any ideas....Answers will be rewarded.....

    Hi,
    Try this.
    /: IF &PAGE& = '1'
    /: ENDIF
    Thanks,
    Naren

  • Jumped to next page eventhough first page's main window not full

    Dear All expert,
    I meet a problem that my script form sheet jumped into next page even though the first page is not full.
    I checked in script there is not any new-page command.
    Do you have any suggestion?
    appriciate your help.

    Hi,
    There could be many reason for this.
    Please check the followings.
    1. Page protection command is not used.
    2. size of main window
    try to debug the script and find the exact reason.
    Hope this will help you.
    Regards,
    Raj Gupta

Maybe you are looking for

  • Status 51 Error in ALE IDOC

    Hi, Iam trying to send a MATMAS Idoc from one client to another client , which is in the same R/3. The outbound staus is 03 and the inbound is 51. I just created a material  (Material details are attached below for reference) and send tht material to

  • How to drag and drop an Image between two JPanels inside a Split Pane

    I'm tring to do that, and my actual problem is as follows: I drag the Image from the bottomPanel but I can't drop it in the topPanel, I'm using this classes: import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import

  • Animations (swfs) not opening in CP5

    I have converted my CP4 programs to CP5 to run on a CD. The Flash animations I converted to SWFs in CP3 as a Menubuilder SWF to be able to open up the animation when clicked in a pop-up window (the pop-up blocker is off when viewing in HTM) - these M

  • Informatica and DAC questions

    I understand that ODI is the tool of choice for the Analytics apps, but Informatica was still supported. Informatica is our standard integration tool, so we would like to upgrade ahead of Informatica version retirement. 1) Is Informatica 8.x supporte

  • Third party posting Run

    Working on ECC 6.00 on Third party posting using the U500 schmea. When we run the Report RPURMP00 and able to create a Posting Run.  But when i go and see the document in PCP0, the documents either incorrect /no documents. When i go and see the incro