Dynamic text based on page number

Hi Everyone,
I'm trying to place a dynamic text on an hrform. The form is displaying wage types and when there are more than 2 pages, the values on the first page need to be summerized into a variable with the text subtotal in front of it. When we are on the last page, the text total with the total of all the wagetypes needs to be displayed. I tried to use the sfsy-page and sfsy-formpages variables to know on which page i am but the strange thing is that when i use in in program lines and i use debugger to look into the variable i get this:
First page:
sfsy-page = 1
sfsy-formpages = 1
Second page:
sfsy-page = 2
sfsy-formpages = 2
But when i place it into a text element to test i get 1 of 2 on page one and 2 of 2 on page two. How is this possible?
Also i want to display a subtotal of the displayed wagetypes per page. Anyone an idea how i can do that?
Thank you!
Lars

Hi,
The reason you get 1-1 ,2-2 in debugging is because, the pages are added dynamically,depending on the length of your main window.Which doesnt get captured initially,but can be used in text element.
As far as totalling on every page and at the last page is concerned ,try teh following link:
link: [http://wiki.sdn.sap.com/wiki/display/ABAP/Togetsubtotalsoneachpagein+smartforms]

Similar Messages

  • How to increment a value in a textfield based on page number

    Hi,
    I am doing PDF based print forms which is non interactive, i got a requirment where i have to increment the binded value of a text field based on page number.
    presently i am using this code in initialize event of that textfield.
    var curpage = $layout.page ( ref ( $ ) )
    var totpages = $layout.pageCount()
    $.rawValue = $.rawValue - totpages
    $.rawValue = $.rawValue + curpage
    but this is not helping me, can anyone help me regarding this

    Thanks for yor reply.please you can tellme clearly how to set use 'NQ_SESSION.USER' to set the value to logged in User.i.e i have circle table in that users and circle names will be there.it is teradata database.so how can i set that in to the dashboard prompt and one thing along with that prompt the follwing prompts will be there
    mobile no<>
    date<>
    circle name<"user">
    this is my requirement so please help me step by step what to do for achiving this.
    thanking oyu

  • Adding logic based on page number

    Hi,
    in my invoice report, i need to add some logic based on page number. My objective is to print a group of 4 lines (OMR Marks) on right hand side of the page. For example, on first page, print 1st line only, on second page, print 2nd line only, on third page, print 1st and 2nd lines only, on 15th page, print all four lines, on 16th page, print lines similar to 1st page i.e. print 1st line only, on 17th pages, print lines similar to 2nd page i.e. print 2nd line only.
    Is there any way to use page number or some other variable that can represent page number in an IF condition? Your help is highly appreciated.
    Regards,
    sanjai misra

    Thanks for your reply.
    I need to print OMR marks in our invoice report and i am not sure how to do it. I will highly appreciate your inputs.
    I have to print OMR mark a per the logic given below
    1. Divide the page number by 15
    2. Based on remainder value, print 4 horizontal lines. For example,
    if remainder is 1 then print only line 1,
    if remainder is 2 then print only line 2.
    if remainder is 3 then print line 1 and line 2.
    If remainder is 4 then print only line 3,
    if remainder is 5 then print line 1 and line 3
    if remainder is 6 then print line 2 and line 3
    if remainder is 7 then print line 1, 2, 3
    if remainder is 8 then print only line 4 and so on
    if remainder is 0 then print all lines i.e. line 1,2,3 and 4.
    Could you please tell me how I could achieve this? If you have some code that you could share, it would be great.
    OR is there some other way to achieve this?
    Thanks,
    sanjai misra

  • Adding dynamic text to SharePoint Pages

    Hello all,
    Our SharePoint developer has quit and not his "duties" have been "pushed" onto me. While I am no developer, I can hold my own on certain things.
    Basically I have been asked to add "dynamic" text to our pages that will "read" a field in our "project information list" - project name, client etc.
    Is there a way to "read" a field in SharePoint and add this information dynamically to a page? Our project pages will be around 20 and to do it manually for every page would be a bit of a bear.
    Lastly, we have a documentation library with folders in it. Is there a way to display the "folder" the user is currently in? Right now, when the user clicks on "procedures", there is no visual indication on the page they are in the "procedures"
    folder.
    Thanks all for any help you may be able to provide.
    Brent

    Hi,
    It would be easier for communities focus on one question in one single thread, if you may have more than one questions, it would be better to post one question in one single
    thread.
    For the first question, you want to display values from a column of a list in a page, what’s more, the values will be changed along with the changes in the corresponding list.
    Content Query Web Part would be a good choice without coding.
    You can specify the column you want to display, the style of the content and you can even filter the values you got. All you need to do is add this web part into your 20 pages
    with some necessary settings, then you will get a dynamic view of data on your page.
    Display a dynamic view of content on a page by adding the Content Query Web Part
    http://office.microsoft.com/en-001/sharepoint-foundation-help/display-a-dynamic-view-of-content-on-a-page-by-adding-the-content-query-web-part-HA101794897.aspx
    Here is two demos about how work with the Content Query Web Part:
    http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/05/10/how-to-use-the-content-query-web-part-to-rollup-data-in-sharepoint-2013.aspx
    http://www.codeproject.com/Articles/756834/Customizing-the-Content-Query-Web-Part-and-Item-St
    Feel free to reply if there are still any questions.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Can I set up a master page to show custom alternating footer text dependant on page number?

    Hi,
    Is it possible to set up a master page to show different messages in the footer of a brochure dependant on page number? For example;
    Page 1: Buy from us because...
    Page 2: Our website address is...
    Page 3: Here's a special offer...
    Page 4: Our website address is...
    Page 5: Buy from us because...
    Page 6: Our website address is...
    ...and so on, repeating until the end of the brochure. The intention is for the footers to update automatically if the pagination of the brochure in question needs moving around - or if the messages need changing.
    Thanks!

    Thanks, but the text needs to be on a single master page which every page is assigned to. This is so the text alternates correctly regardless of whether new pages are inserted or moved. If I assigned separate master pages to individual pages and then moved the pages to a different location, the alternating footer text would then fall out of sync. I hope that made sense!

  • Dynamic Text in Apple Pages

    I know that it's possible to create Placeholder Text. However I'm looking for dynamic text. I frequently deal with documents where I need to update 30 fields with the same information. Rather than going 30 times and replacing the Placeholder Texts with the correct info, I'd love to be able to just fill out a couple fields and the remaining ones to populate dynamically. Kind of how you can create cell references in Apple Numbers and Excel, I'd love to create references for text.
    Any ideas on how to achieve this?

    Pages does not have Dynamic Text.
    Use a marker placeholder eg «example1»
    Then use Find and Replace to substitute what you want.
    Peter

  • Moving objects incrementally based on page number

    Hey all,
    Trying to automate a group of objects moving down a page, driven by the page location in a book.
    New to scripting, just need some pointers on best practise, gotchas etc.
    Any thoughts?

    Using a script doesn't make it 'live', the object will not be 'affected' after you move it once. But apart from that, it's pretty simple.
    Given a current page number n, a number of pages ntot, a page height h, and an object height oh, you can use this calculation for the top position:
    topy = n*(h – oh)/ntot
    You can change an object's y position by writing the value into its geometricBounds array:
    var myBounds = someFrame.geometricBounds;
    myBounds[2] = myBounds[2] - myBounds[0] + topy;
    myBounds[0] = topy;
    someFrame.geometricBounds = myBounds;
    As you can see, you have to read and write the array in one single piece. You need to change two elements: number [0] holds the top y position, number [2] holds the bottom y position. As you can see, you have to 'calculate' the bottom first, based on the top (A good alternative is using the move function but I can't write that from the top of my head.)

  • Modify width of rectangle based on page number in InDesign via Javascript

    I have a rectangle called `pageBar` on my master page !
    I would like to create a script that will automatically resize the width of the rectangle based on the page number.
    Something like : `width = 1280 * (pageNumber / pageTotal)`
    Any help would be much appreciated.
    Thanks in advance,
    J.

    Here's the script I ended up with. I'm a bit unhappy that I ended up having the literal string "pageBar" in it twice. The second instance is there to allow the script to be run on the same document twice -- that's one of the prices you pay for using master page items in a script rather than creating objects on the fly and applying an object style to them (better than setting selected properties):
    //DESCRIPTION: Size PageBar on each page
    (function() {
              if (app.documents.length > 0) {
                        sizePageBars(app.documents[0]);
              return;
    function sizePageBars(aDoc) {
              var pageBar = getMasterItem(aDoc, "pageBar");
              if (pageBar == null) return;
              // walk through the document's pages and deal with each page
              var theMaster = pageBar.parent;
              var numPages = aDoc.pages.length;
              for (var j = numPages - 1; j >= 0; j--) {
                        if (theMaster == aDoc.pages[j].appliedMaster) { // ignore pages with other masters
                                  processPage(aDoc.pages[j]);
              function processPage(page) {
                        // numPages, pageBar and j are visible as global variables in this function
                        // caculate desired width
                        var desiredHalfWidth = 1280 * (j + 1)/(numPages * 2); // j starts at zero;
                        // could be running script for a second time, so check to see if page already has pageBar on it
                        var bar = page.rectangles.item("pageBar");
                        if (bar == null) {
                                  var bar = pageBar.override(page);
                        var pBounds = bar.geometricBounds;
                        var xCenter = (pBounds[3] + pBounds[1])/2;
                        pBounds[1] = xCenter - desiredHalfWidth;
                        pBounds[3] = xCenter + desiredHalfWidth;
                        bar.geometricBounds = pBounds;
              function getMasterItem(aDoc, name) {
                        var appliedMaster = aDoc.pages[0].appliedMaster;
                        var anItem = appliedMaster.rectangles.item(name);
                        if (anItem == null) {
                                  alert("Couldn't locate 'pageBar' rectangle.");
                        return anItem;
    I was going to introduce to the resize method, but that would have first meant understanding it myself. The description in the object model viewer is a masterful demonstration of how not to communicate complicated information.
    So I did a web search and found myself on this page by Marc Autret: http://www.indiscripts.com/post/2013/05/indesign-scripting-forum-roundup-4
    Search that page for resize and you'll see what I mean. Compared to the simple manipulation of geometric bounds, using resize is a nightmare of complexity. Marc has simplified it by providing a function you can call, but I decided to just go with using the bounds.
    I hope this proves helpful to you.
    Dave

  • Conditional formatting based on page number that resets on repeating frame

    Hello everyone,
    I have searched through multiple forums on multiple sites and haven't come across anyone who has accomplished this.
    I have a report with pages numbers that reset on a repeating frame.
    I have a text boiler plate that I want to only show up on page 1. On every occurrence of page 1.
    SRW.GET_PAGE_NUM does not work because it returns physical page number.
    I'm trying to access the value of the field for my page number. The value comes from "source" drop down with value of "Page Number".
    I've tried accessing the <&page number> in the PL/SQL of my conditional formatting trigger but no luck.
    This report is 14K plus pages so I'd rather not be inserting and selecting the value back out of the database.
    Does anyone have any ideas??
    Thanks,
    Alan

    To avoid inserting/selecting from the database
    Maybe you could create a small package on the database to store page numbering information.
    Then use get/set routines per your requirements.
    CREATE OR REPLACE PACKAGE rep_page_no IS
       gPageNo NUMBER;
       PROCEDURE set_it(pPage NUMBER);
       FUNCTION get_it RETURN NUMBER;
    END rep_page_no;
    CREATE OR REPLACE PACKAGE BODY rep_page_no IS
       PROCEDURE set_it(pPage NUMBER) IS
       BEGIN
          gPageNo := pPage;
       END set_it;
       FUNCTION get_it RETURN NUMBER
       IS
       BEGIN
          RETURN(gPageNo);
       END get_it;
    END rep_page_no;Then in your repeating frame you could access this package rather than insert/select from any database table.
    Let me know if this works, I might like to try it.
    Thanks

  • Howto create sales text based on material number in VA01any Exit or badi

    Hi All,
    I have to create sales text for each material number entered in sales order which using VA01 tcode .
    i know there is configuration settings in SPRO, but i want to do automatically while using VA01 tcode.
    i need right Exit or Badi for this as soon as i save the sale order.
    can i do this using Function Module CREATE_TEXT in that exit....any Suggestions.
    Regards,
    Sudhakar Reddy.A

    Hi..
    Please check the Availability in MV45AFZZ include of SAPMV45A program.
    If you are able to access the Corresponding table data ..you can set the Text directly at that place.

  • Dynamic links based on page's content

    Hi folks,
    I would like to implement a functionality into my application which would dynamically display "smart links" to other pages within application based on CONTENT of current page (or cursor position in field). I'm only at a starting point right now, but does anybody worked on something similar?
    An easy example what I mean:
    You have an application for book shop, and you're on page, where you're editing a specific book. And for example if user will be in field BOOK_TYPE, then a dynamicaly created smart link would display a links to other pages like: "Add a new book type ...", "Modify list of Book Types", ... in some "special left menu". Then when user changes a position, some other links will display.
    Also whe user will be in page for maintaining "Book Types" one of a dynamic links could be "Add a book of this type ..." => which will point to Add new Book page, but Book Type will be prepopulated
    Above I want to have as much generic as possible, and maintained in seperate application.
    Any ideas are more than welcome.
    Or any example where is something similar in use?
    Many thanks,
    Tomeo

    Hi,
    The reason you get 1-1 ,2-2 in debugging is because, the pages are added dynamically,depending on the length of your main window.Which doesnt get captured initially,but can be used in text element.
    As far as totalling on every page and at the last page is concerned ,try teh following link:
    link: [http://wiki.sdn.sap.com/wiki/display/ABAP/Togetsubtotalsoneachpagein+smartforms]

  • Dynamic Text in the Page Header

    Hi Gurus,
         I have a small requirement i.e., changing the text of title on page header UI element based on condition. if create then create data else if it is display then display the info some thing like that.
       Kindly can some help me regarding this....
    Regard
    Sankar

    Hi Sankar,
    Create on eattribute of type String and bind to title property of page header,
    and your WDDOINIT or any event write code to set title for PG header,
    You are using different buttons, use this code in your buttons and change text.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->Element_context.
      DATA lv_pg TYPE wd_this->Element_context-pg.
    * get element via lead selection
      lo_el_context = wd_context->get_element( ).
      data pg1 type string.
      pg1 = 'selected the record'.
      lv_pg = Pg1.
    * set single attribute
      lo_el_context->set_attribute(
        name =  `PG`
        value = lv_pg ).
    In button 1..
    lv_pg = 'Enter the entries'.
    * set single attribute
      lo_el_context->set_attribute(
        name =  `PG`
        value = lv_pg ).
    Cheers,
    Kris.

  • I can't copy a text based illustrator page to indesign

    Hi i have the tutorials running of illustrator and indesign. I have just created a page of text boxes in illustrator and now need to copy or place this into my indesign file but cant seem to do it.
    I either get unformatted text or a plug in error in indesign.
    I know this is possible because I am copying what I have seen done before but cant make it work.
    Urgent help needed as will miss deadline as a result.
    Many thanks

    Unfortunately, it's not possible to copy anything other than unformatted text from Illustrator to InDesign. The two applications have completely different, non-compatible text engines.
    However, save your page as an Illustrator (AI) file. Then choose File > Place. If you turn on Show Import Options, you can choose which artboards are placed. Note that the AI file will not be editable.

  • Need help printing pagefooter conditionally based on page number

    In the layout I'm working on, there is a <?call:footer?> in footer section. I want to avoid call it for certain pages. Eg. not print it on the first page.
    Is there a page-variable available that can be used to conditionally test and print this? (in example below find something replacing "currentpagevariable")
    Eg. <?if:currentpagevariable!='1'?><?call:footer?><?end if?>
    Note, I've tried to use the "Different first page" option, but due to reports complexity in report header, cannot use this option.
    Any suggestions as soon as possible would be much appreciated.
    /Thanks, Dan

    this is not possible.

  • Displaying dynamic data on every page of standard text

    Hi All,
    I m using standard text (created in SO10) in smartform . I want to display dynamic data on the top of every page of standard text.
    Displaying the dynamic data is not the problem, but how would i know where is page finished(or started) as Preview in SO10 may not look the same as smartform output.
    I dont want to do this manually by adjusting the size of window. Is there any other way to do the same??
    Vanita.

    Try to create a text in your SF and write the dynamic data.
    To know in which page use &SFSY-PAGE&
    this system fields may also be helpful for dynamic text on each page
    &SFSY-COPYCOUNT0&   "COPY COUNTER( 0 = ORIGINAL, 1 = 1st COPY)
    &SFSY-COPYCOUNT&   "COPY COUNTER( 1 = ORIGINAL,  2 = 1st COPY)
    Still you can called DYNAMIC text through your standard text.. but place your conditions.
    Regards,
    SaiRam
    Message was edited by:
            Sai Ram Reddy Neelapu
    Message was edited by:
            Sai Ram Reddy Neelapu

Maybe you are looking for

  • BASIC PLANT DATA VIEW in BAPI_MATERIAL_SAVEDATA

    HI,     I need to save some fields in the BASIC PLANT DATA View using BAPI_MATERIAL_SAVEDATA. Would anyone know the HEADER VIEW DATA I need to select and how I am going to go about this? I am able to successfully save a material but I am having probl

  • Printer recommendation please

    I am looking for a trouble free, relatively inexpensive to operate printer for everyday photo printing. I enjoy printing many of my images up to 8.5 X 11 on matte paper. Archival qualities are not important. My main concern is reliability and operati

  • Premium World subscription doesnt seem to work

    I've activated the Premium subscription plan that came allong with my Surface. In my accountsettings It aslo shows up as activated. But when I try to call phone nummers (mobile or land) my Skype tells me that no subscriptioins are Active (no belance)

  • I need content

    What I am really wondering is what to do with Apple TV or iPod Touch. I can see myself buying both of those products if there where som content available, I live in Sweden and the iTunes Store only have music, not movies and TV shows. The music part

  • Google maps have been replaced by swinging sign

    I now have a swinging sign that says "Mobie Me Closed" where my Google Maps used to be.  Efforts to reset them have resulted in the same sign showing up.  I realize that IWeb did not migrate to the cloud, but this is rediculous.  I can put other Goog