Printing of Boxes dynamically in main window

Is it possible to provide some conditions in SAPScript (form) to add boxes depending on the presence of different number of document numbers?i.e if there are 10 document numbers 10 boxes to be provided.Can this be handled in Main window of the script?

Hi,
You can hnadle this,
You need to write a perform in the Script. and get the No of records which are printed in the main window according to that maintain 2 variables in that whcih we use the window size in the layout.
in the Main windoe element, write as
BOX WIDTH '1.2' CM HEIGHT <b>&HEIGHT&</b> CM FRAME 10 TW
BOX WIDTH '9.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '11.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '13.5' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '15.9' CM HEIGHT &HEIGHT& CM FRAME 10 TW
BOX WIDTH '19.1' CM HEIGHT &HEIGHT& CM FRAME 10 TW
Height field should be in the TOP of the Driver program , i mean it should be a global field. and maintain this Height according to your requirment.

Similar Messages

  • Box in a main window  with a header text in it

    Hi Abapers,
    I am new to sapscripts and have got an issue where a box  in the main window of the first page is not getting printed in the next page when the data is flowing to the next page .
    below is the code in the main window.
    BOX FRAME 10 TW HEIGHT 7 MM
    BOX YPOS 142 MM FRAME 10 TW HEIGHT 0 MM
    *BOX YPOS 26 MM FRAME 10 TW HEIGHT 10 MM
    *HEADING_TEXT
        Description                                              Value in &bkpf-waers&
    i have the same code in the main  window of the next page also
    what may be the problem here ?
    Thanks in advance .

    Hi Sai Ram,
    There is no condition palced before the box statement.
    The next page also has a main window designed similar to the first page and an additional address window and a footer .
    This page is printed as the last page and contains the page  as required , the problem is that all the other  pages which contain the data flowing from the first page donot contain the box header as desired .
    Please let me know if the requirement is not clear ,  i will try and put it in a better way .

  • Print Invoice Header Text In Main Window of Smartforms

    Helo Gurus !!!
    I want to print Invoice header text in main window of smartform.
    There are total 5 columns.
    Item    Quantity          Description          UnitPrice       Amount
    Now what I want is to print header text below Description column, there is a loop on the table in main window.
    This header text will be printed only once. This is a standard header text
    How to get this?
    Points are assured !!!

    Hi Anay Kulkarni,
           I understood that u need to print this header text
    Item Quantity Description UnitPrice Amount
    So please use TABLE instead of LOOP  in the table we can prin header, main area, footer.
    place the header text in header area in table...  i am sure this can resolve it.....
    feel free to contact me if issue is not resolved/.....
    dont forget to reward points....
    all the best...
    Regards,
    Sreeniasa Sarma K.

  • How to print text into different boxes in a main window

    Hi,
         I divided the main window into 5 windows using boxes.
         Now how can I print different data into each of these boxes.
         The data comes from a print program .
      Please suggest.

    Hi
    In smartforms you can create a template object or a table object and set the boxes.
    after you'll create the text object into the templeate and set on which box the data will write.
    best regards
    Marco

  • How to print horizantal lines in smartforms main window  table

    hi ABAP gurus,
           i am faceing the problem in smartforms main window, i created the table, in that header, main area, footer is coming and i am created the line type in that five culamns, i am specifing the header and main area data, after the printing the header information, in main area 5 record or more than 5 records,each record after one harizantel line,  it will be print a table maner i.e 5 culamns and more than 5 rows in a table.
    thanks,
    raj.

    Hi,
    Double click on the table.
    Click on Select pattern icon>Display framed Pattern>Select the Second one (1 row 2nd column)
    Regards
    Sandipan

  • Problem with printing the pages due to main window

    hi experts ,
       in my requirement i have 4 pages in smart form.It takes quotation number as input and dispaly all the contracts.
    1 potrait
    2 potrait
    3 landscape
    4 landscape
    i have used a main window in the second page contains 2 windows for printing address then
    one main window for printing contracts, and systems info in two tables .
    i have used a main window in the 4 th page too for printing some item details equipment list.
    both main windows having same width.
    i am getting  1 st & 2nd pages only as o/p if i mention 2nd page in the next page field of first page .
    i am getting 1 st  3 rd , 4th , 5th ........pages if i mention 3 rd page in the next page fileld of first page .
    i didn't use any extra page to populate if  2nd page is filled completely    .
    please guide me  .
    Thanks & regards.
    Srikanth

    Hi Srikanth,
    In the second page you can insert a command to set it to goto page 3,and an additional event in the command (only after the end of main window).
    As soon as the main window ends in the second page...u will get the third and rest of the pages.
    Keep the goto next page in PAge 1 as Page2
    and in Page 2 as Page 2.

  • Box in a main window in sapscript

    Hello Forum!
    In my sapscript there's a window MAIN with BOX FRAME. This window is in a first and next page, but the box only appears in the first page, not in the others.
    Anybody knows what I shound be change? I need the box always appears (in all pages).
    Thanks in advance!!!
    Edited by: Pablo Ariel Vicente on Feb 14, 2008 3:57 PM

    Hi!
    Try specifying all the parameters (XPOS, YPOS, HEIGHT, WIDTH) in the BOX command. This may resolve the problem.
    Cheers!

  • Drawing Boxes in Script - main window

    hi,
    In script, in main window <u>after table line item datas</u>, i want to draw a box in which i will place some text. On drawing box, it appears on top of that window which i dont want, since it should be placed after item details.
    kapil.

    I do not know this is still relevant for You or not but here is the solution what I did:
    First of all I have to mention this requires SAP standard object modification. !!!
    1.Start SE80 and get into STXC function group.
    2.Select COP_RELATIVE_NUMBER subroutines and double click on that.
    3.Click on Edit button and Get SSCR  Object number from SAP.
    4.Change interface of the COP_RELATIVE_NUMBER subroutines extending it with TYPE parameters
    5.Change the first if Statement.
    6.Extend the Relative case section with a new WHEN '#'.
    7. Cange All COP_RELATIVE_NUMBER calls with new input parameter in CO_BOX, In CO_POSITION, In CO_SIZE.
    From now in Your SAP script You can call BOX statement like this:
    BOX XPOS ‘#10’ TW YPOS ‘#10’ TW  …..
    Will start drowing BOX from cursor current position plus 10 twip.
    Numbers after the # sign are optional.
    Solution works only with TW.
    form co_box.
    data: begin of bx,
            x    type i,
            y    type i,
            w    type i,
            h    type i,
            f    type i,
            i(3) type n,
          end of bx,
          next(10),
          xpos         type i,
          ypos         type i,
          is_relative like boolean.
      bx-x = ft-wpx.
      bx-y = ft-wpy.
      bx-w = ft-wpw.
      bx-h = ft-wph.
      while co-endline = false.
        perform cop_next using next 10.
        case next.
          when 'XPOS'.
    *{   REPLACE        ED1K902054                                        1
    *        perform cop_relative_number using is_relative xpos.
            perform cop_relative_number using is_relative xpos 'X'.
    *}   REPLACE
            add xpos to bx-x.
          when 'YPOS'.
    *{   REPLACE        ED1K902054                                        2
    *        perform cop_relative_number using is_relative ypos.
            perform cop_relative_number using is_relative ypos 'Y'.
    *}   REPLACE
            add ypos to bx-y.
          when 'WIDTH'.
            perform cop_number_value using bx-w.
          when 'HEIGHT'.
            perform cop_number_value using bx-h.
          when 'FRAME'.
            perform cop_number_value using bx-f.
          when 'INTENSITY'.
            perform cop_next using next 3.
            bx-i = next.
          when space. exit.
          when '.'.   exit.
          when others.
            perform cop_warning using subrc_param_unknown next.
        endcase.
      endwhile.
      perform cop_end.
      check co-error = false.
      perform pc_box using bx-x bx-y bx-w bx-h bx-f bx-i.
    endform.
    form co_position.
    data: begin of pos,
            x type i,
            y type i,
          end of pos,
          next(10),
          relative like boolean,
          xpos     type i,
          ypos     type i.
      pos-x = ft-wpx.
      pos-y = ft-wpy.
      while co-endline = false.
        perform cop_next using next 10.
        case next.
          when 'XORIGIN'.
    *{   REPLACE        ED1K902054                                        1
    *        perform cop_relative_number using relative xpos.
            perform cop_relative_number using relative xpos 'X'.
    *}   REPLACE
            if relative = true.
              add xpos to pos-x.
            else.
              pos-x = xpos.
            endif.
          when 'YORIGIN'.
    *{   REPLACE        ED1K902054                                        2
    *        perform cop_relative_number using relative ypos.
            perform cop_relative_number using relative ypos 'Y'.
    *}   REPLACE
            if relative = true.
              add ypos to pos-y.
            else.
              pos-y = ypos.
            endif.
          when 'WINDOW'.
            pos-x = ft-tdwlefts.
            pos-y = ft-tdwtops.
          when 'PAGE'.
            pos-x = 0.
            pos-y = 0.
          when space. exit.
          when '.'.   exit.
          when others.
            perform cop_warning using subrc_param_unknown next.
        endcase.
      endwhile.
      perform cop_end.
      check co-error = false.
      ft-wpx = pos-x.
      ft-wpy = pos-y.
    endform.
    form co_size.
    data: begin of dim,
            w type i,
            h type i,
          end of dim,
          next(10),
          relative     like boolean,
          width        type i,
          height       type i.
      dim-w = ft-wpw.
      dim-h = ft-wph.
      while co-endline = false.
        perform cop_next using next 10.
        case next.
          when 'WIDTH'.
    *{   REPLACE        ED1K902054                                        1
    *        perform cop_relative_number using relative width.
            perform cop_relative_number using relative width 'X'.
    *}   REPLACE
            if relative = true.
              add width to dim-w.
            else.
              dim-w = width.
            endif.
          when 'HEIGHT'.
    *{   REPLACE        ED1K902054                                        2
    *        perform cop_relative_number using relative height.
            perform cop_relative_number using relative height 'Y'.
    *}   REPLACE
            if relative = true.
              add height to dim-h.
            else.
              dim-h = height.
            endif.
          when 'WINDOW'.
            dim-w = ft-tdwwidths.
            dim-h = ft-tdwheights.
          when 'PAGE'.
            dim-w = form_header-tdpagwidth.
            dim-h = form_header-tdpagheigh.
          when space. exit.
          when '.'.   exit.
          when others.
            perform cop_warning using subrc_param_unknown next.
        endcase.
      endwhile.
      perform cop_end.
      check co-error = false.
      ft-wpw = dim-w.
      ft-wph = dim-h.
    endform.
    *{   REPLACE        ED1K902054                                        3
    *form cop_relative_number using is_relative like boolean
    *                               val         type i.
    form cop_relative_number using is_relative like boolean
                                   val         type i
                                   type        type c.
    *}   REPLACE
    data: num type f,
          next(10).
      clear is_relative.
      perform cop_next using next 10.
    *{   REPLACE        ED1K902054                                        1
    *  if next(1) cn '+-.0123456789 '.
      if next(1) cn '#+-.0123456789 '.
    *}   REPLACE
        perform cop_warning using subrc_param_unknown next.
        clear: is_relative, val.
        exit.
      else.
        if next+1(9) cn '.0123456789 '.
          perform cop_warning using subrc_param_unknown next.
          clear: is_relative, val.
          exit.
        else.
          case next(1).
            when '+'.
              is_relative = true.
              num = next+1(9).
            when '-'.
              is_relative = true.
              num = next+1(9).
              num = -1 * num.
    *{   INSERT         ED1K902054                                        2
            when '#'.
              is_relative = true.
              num = next+1(9).
              case type.
                when 'X'.
                  num = ( ft-line_width  - ft-rem_width ) + num.
                when 'Y'.
                  num = ( ft-fill_height - ft-rem_height ) + num.
              endcase.
    *}   INSERT
            when others.
              num = next.
          endcase.
        endif.
      endif.
      perform cop_num_val using num.
      val = num.
    endform.

  • Printing text in last page main window of a script

    Hi All,
           I want to print some text at the bottom of last page main window.But how can we find that it is last page.I mean which condition we have to put for that.
    I think the below condition like
    If last-page NE ' 0'.
    write : '----
    '..........   will be used for printing at last page footer window.
    what about main window........how to find that it is the main window of last page............
    Thanks in advance ....
    Regards,
    Rakesh.

    Hi,
    you can use this
    IF NEXT_PAGE EQ ' 0 '.
    write the text here.
    ENDIF.
    in the main window itself. Once all the records got printed, it will check that there is no next page. at that time, that was the end of the internal table in the mainwindow and the text will be printed.
    If you want a seperate window, then also the same logic will work.
    If you want a seperate window, then the output look and feel will not be so good.
    I mean where ever the last record got completed, it will print the text if you put it in Main window. other wise statically it will print at a particular position where your window was placed.
    Regards,
    Venkatesh

  • Print Dialog Box Opens behind open windows

    The print dialog box opens behind any open windows everytime I print to a PDF.
    It seems to happen from every program AutoSketch, Word, Excell, QuickBooks.
    Very annoying.
    The minimized dialkog box opens and flashes below on the task bar. When you click on the mini icon the print dialog box comes to the front.
    How can I get the dialog box to open on top of all windows?
    Scott

    I was unable to find the SavedData file.  I am running Windows 7 and there seems to be two files there /Roaming/Adobe/InDesign and /Roaming/Adobe/AdobeInDesing5.5 and neither one has a clear file name "InDesign SavedData" for me to remove.  I think I found the "InDesign Debaults" under the /Roaming/Adobe/InDesign/version7.5/en_US/InDesignDefaults.  Is that one it?

  • Positioning a box dynamically into a window

    Hi,
    I have a problem with a sapscript:
    Can I print a box (or a grid) after the current row?
    Can I read the current row?
    Thanks

    Hi,
    U can print a box after current row.
    /: BOX XPOS '0' MM YPOS '6.50' MM WIDTH '188' MM HEIGHT '0' MM FRAME 10 TW
    /: BOX XPOS '0' MM YPOS '0' MM WIDTH '0' MM HEIGHT '6.50' MM FRAME 10 TW
    Give this in text editor.
    Yes u can reday current row...also
    p0008-lga01 - From Field
    p0008-lga02 - Next Field
    l_lga01 - Holds the value
    DO 40 TIMES VARYING l_lga01 FROM p0008-lga01 NEXT p0008-lga02
    ENDDO.
    DO ... VARYING dobj FROM dobj1 NEXT dobj2 [RANGE range].
      [statement_block]
    ENDDO.
    Thanks,
    Neelima.
    Press F1 you can get the information & Example

  • Include text to be printed in the middle of main window

    hi Gurus,
    In SAP script - i have used include text ( which is a picture ) which i need to bring it nearly to the center of the main window. ie.,
    /: INCLUDE IMAGE1 OBJECT TEXT ID ST PARAGRAPH P1
    paragraph p1, i have made the alignment as centered.
    and i have changed it to
    /: include zhex-macro-image1 object text id st ----> also didnt work 
    posnr         matnr         then this image should come.
    but still the image is coming in the begining of the new line.  i want it to be continued with the previous line.
    please guide me.
    thanks.
    Sakthi.

    >
    sakthi sri wrote:
    > hi Prakash,
    >
    > i already did what u said. but the problem is that image should come only for that material. if suppose that material is going to come as the last material then how that image will come in the last. it always comes in the same window only what we difined. thats why i am trying to push it in the main window itself.
    >
    > did u got my problem?
    As i understand the image is to be shown conditionally.
    Try:
    {code]
    /: IF posnr = 'the position you want' AND matnr = 'matrn you want'
    /: INCLUDE IMAGE1 OBJECT TEXT ID ST PARAGRAPH P1
    /: ENDIF
    {code}

  • Displaying bottom text of main window in box?

    Hi all ,
    I am working with a sap script, where i need to display standard text in box at end of the main window.
    The problem is i am unable  to set the dynamic position of the box at bottom of the main window .
    please help me to fix this problem?
    Thanks,
    Vamshi.
    Edited by: VAMSHI KRISHNA on Oct 29, 2008 12:04 AM

    Hi Gustavo,
    Thanks for your reply.
    But here my requirement is the text should be displayed immediately after the data in main window is printed . If i used the bottom window , then it will display exactly in that position despite of the main window data.
    So Is there any way to display text in box dynamically, after main window data is completed?
    Thanks,
    Vamshi.

  • Box in main window (sapscript) problem.

    Hi, all.
    I meet a weird problem....
    I have 2 pages form which have 2 same MAIN window and of course their source code is same one. But when I run the output form, I found that one of the page which main window's box is disappear, while the other page no problem.
    How come like this? Should be the box appear in both MAIN window, right? Hope someone can guide me.
    Thanks in advance.

    Boxes in the main window only get printed in the first page, unless you include them in an element and explicitly call the, But of course that's not the way to go.
    Every other window in the same page which has content that's not inside one element gets printed every page. So to solve your problem, declare another window (perhaps called BOXES) with the appropiate dimmensions and define in it the boxes you need. Replicate this BOXES in the other pages (if you use different page formats inside the sapscript) or leave it in the First page (if it's the only one in the sapscript). The boxes will now print in every page.

  • How to print items in the MAIN window of the NEXT page (smartform)?

    Dear forumers,
    There are two pages (FIRST and NEXT) in my smartform with the same MAIN windows in each of the pages. Whatever that are changed in FIRST-MAIN window will also be seen in NEXT-MAIN window.
    I will need to control the printing of table TABLE3 contents (already contained in the MAIN window) such that if a variable V_MAT_PRINT is 'X', the TABLE3 contents will only be printed in NEXT page and not printed in FIRST page at all.
    How may I achieve this? Please help.
    Thank you.

    >
    Mohammed Ahasanullah Mulla wrote:
    > Hi Deborah,
    >
    > I had also faced a similar situation,in my case it was three pages..However i will try to tell you for 2 pages..After the second table .Add a program lines and force a page break only if V_MAT_PRINT is 'X'. After the program lines add a command and make the go to new page as second page.This will solve your problem.I have done the same and its working fine .If you have any questions do ask.
    >
    > Thanks,
    > Ahsan
    Hi Ahsan,
    Here's my case.
    If V_MAT_PRINT is 'X', print the following:-
    FIRST page, MAIN window
    - TABLE1
    - TABLE2
    - TABLE4
    - TABLE5
    NEXT page, MAIN window
    - TABLE3
    If V_MAT_PRINT is not 'X', print the following (no additional controls / changes are needed, everything remains unchanged):-
    MAIN window
    - TABLE1
    - TABLE2
    - TABLE3
    - TABLE4
    - TABLE5
    In this case, is a page break suitable? I doubt it as TABLE4 and TABLE5 will still need to be printed back on the FIRST page regardless of the V_MAT_PRINT value.
    Please advise further. Thanks.

Maybe you are looking for

  • Why does mail sent using the MacOSX mail client not show up in my sent folder when I access my Gmail account in a browser?

    I've recently started using my first Mac, and I hooked my work email (Forwarded to Google Mail) and my personal email (Gmail) into the MacOSX mail client. Everything seemed to be going smoothly, until I noticed that sent mail from my work email throu

  • What's the easiest way to have a message box?

    Hey, i'm making this game and i have one frame and i have and one panel inside, and when the user completes the game i want a message box to popup saying "Congratulations, You Won!" At the moment when the user wins the game, i've just put a "System.o

  • Error message in desktop Manager: Media

    I have downloaded Desktop Mgr, and when I try to access Media, I get this error message : image File "file": C/program files (x86) common files\roxio shared\9.0\common resources/\shared\generic\images\about_RIM_Backgro​und.PNG" cannot be loaded Can a

  • Tree structure in advanced datagrid

    Hi I'm using advanced datagrid to mainly display heirarchical data. There are five columns in my datagrid and name column is heirarchical one. Problem I am facing is tree symbols are getting displayed in some other columns. Please help.

  • A pop up comes up for Wi-Fi, but won't go away

    Hello, I was using my phone was a personal hotspot for my laptop so I could work outside, when I got a pop-up on my screen. The pop-up won't go way, I tried clicking all buttons, and forced quit all of my applications, but nothing seems to work. Plea