Issue in New Page Display in a SAP Script

Hi All
         I have applied a line count logic in my SAP script, such that if lines are more than 32, Sub Total is displayed on this page(Sub Total needs 4 lines to display) and from next page,another heading starts. (Total around 39 lines can be displayed  in one page)
Sub Total Text contains 2 lines of text, and 2 blank lines after it (Total 4 lines)
Now, if number of lines is around 36, Sub Total, doesnt fully display in this page and the 2 blank lines gets passed to the next page. And I am also firing a new page from my code. As a result, the 2nd page comes fully blank and the data is now being displayed at the 3rd page. How can I prevent the 2nd page from coming blank ??
I am using Function Module 'CONTROL_FORM' (or WRITE_FORM) to fire a new page.
I do not want to apply a line count logic for this as this wont be fool proof !!
I hope I have made the issue clear. Kindly help !!
Thanks
KP

Hi,
otherwise u can do one thing: U call the PERFORM in the SCRIPT FORM passing the &PAGE&(Contains the current Page No) value to it. take a loal variable and pass the PAGE value to the local variable and check for every line whether both &PAGE& & local varaiable are same, if not then set the FLAG value to 'X' (it means the new page has triggered).
Eg:
In Script:
/:  lv_tabix = lv_tabix + 1.
/: PERFORM new_page_flag IN PROGRAM ZXXXXX
/: USING &PAGE&
/: USING &lv_tabix&
/: CHANGING &FLAG&
In ZXXXXX Program:
FORM new_page_flag USING int_tab STRUCTURE itcsy
                            CHANING out_tab STRUCTURE itcsy.
data : lv_page TYPE i,
         lv1_tabix TYPE i.
READ TABLE int_tab WITH KEY name = 'LV_TABIX'.
IF sy-subrc EQ '0'.
  lv1_tabix = int_tab-value.
  clear : int_tab.
ENDIF.      
IF lv1_tabix EQ '1'.
  lv_page = '1'.
ENDIF.
READ TABLE int_tab WITH KEY name = 'PAGE'.
IF lv1_tabix GT '1'.
  IF lv_page NE  int_tab-value.
    READ TABLE out_tab WITH KEY name = 'FLAG'.
    IF sy-subrc EQ 0.
       out_tab-value = 'X'.
       MODIFY out_tab.
       clear : out_tab.
    ENDIF.
  ENDIF.
ENDIF.
IF sy-subrc EQ '0'.
  lv_page = int_tab-value.
ENDIF.                          
Hope it helps!!
Rgds,
Pavan

Similar Messages

  • New Page Format implentation in Sap Scripts and Reports

    Hi,
       I want to print Report details and also some of the SAP Script details on the paper size of 350MM width and 310MM Height in the PORTRAIT format.
       So i created new page format with these dimensions.
       How i can use this for reports. So i can set these parameters while taking output from Report.
       Pls specify if any configuration required for this.
    Thanks in Advance,
    Regards,
    Pavan.

    In SAPscript, you set the Page Format for the document in the "Page Format" field of the "Basic Settings" page of the documents "Header" information. The popup list of this field will show all available formats in your system, so this is a ggod way to make sure your new format is set up properly.
    For reports, page format is set either with the LINE-SIZE addition to the REPORT and NEW-PAGE commands, or through the PARAMETERS addition to the NEW-PAGE command. When you use LINE-SIZE the print system picks the format for you, based on the available formats in the systems.
    I don't remember if there is an activation step for Page Formats, or if saving is all you have to do.

  • Calling different pages in a single sap script based on conditions?

    Hi All,
             Can anyone please give me an example of how to call different pages in a single sap script based on condition. Eg., i need to call 5 differnet pages from a single sap script based on 5 company codes.
    Please help
    Regards
    Priya

    This approach to make call from SAPscript. Its concept is similar to make call to a subroutine in another program. I would presume you understand how to use USING and CHANGING parameter. =)
    SAPscript -
    /: Perform get_date in program z_at_date
    /:    using &p_year&
    /:    changing &new_date&
    /: endperform.
    program z_at_date -
    form get_date TABLES rec_in  STRUCTURE itcsy
                                    rec_out STRUCTURE itcsy..
    DATA:
       v_year type char10.
    sap script and subroutine uses itcsy structure to transmit parameters
    first parameter is incoming while second parameter is out going
    their function is like an internal table with header line
    all data types between SAPscript and subroutine are string.
    so, you might need additional conversion.
    read incoming parameter with exact name from SAPscript
      READ TABLE rec_in WITH KEY name = 'P_YEAR'.
      IF sy-subrc EQ 0.
        v_year = rec_in-value.
      ENDIF.
    to return value, use the exact name on the second structure
        CONCATENATE v_year v_year INTO v_year.
        READ TABLE rec_out WITH KEY name = 'NEW_DATE'.
        IF sy-subrc EQ 0.
          rec_out-value = v_year.
          MODIFY rec_out TRANSPORTING value WHERE name = 'NEW_DATE'.
        ENDIF.
    endform.
    Hope this helps =)

  • Issues with having pages display correctley. It does this in multiple browsers, Chrome, IE, and FF. Some pages display correctley.

    I have been having trouble viewing pages in multiple browsers since last night. It has done this with me before. I am using an Acer Aspire and also Firefox version 23. I've tried looking online and following suggestions such as clearing the cache, retarting in safe mode, etc. Nothing seems to work. It's only on certain pages. For example- Facebook works and displays fine. It's when I go to websites like Amazon, Wix, Ebay, and others that I get the issue. The pages are displaying with a white background and just text/links and basic images. I've checked the page style and it is on Basic Page Style. Here is what I have:
    http://i45.photobucket.com/albums/f78/DovesPaintedJewel/screen2.png
    http://i45.photobucket.com/albums/f78/DovesPaintedJewel/screen1-1.png

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • The next page in not displaying in the SAP Script

    Hello,
    I had one SAP script. There were two pages in the script and i mentioned the next page also for the FIRST and NEXT page as
    First - next page --> next
    and next -- next page --> next
    Now, I am having 3 items which needs to be gets displayed using SAP script.
    The first two items displayed properly but the third item is not getting displayed, as of the size of main window is small.
    Whenver i am increasing the size of main window the third item gets displayed propely.
    But i guess whenever the data will get overflow in main window then it should gets displayed in the next page, this is not happening in my case.
    Can any one tell me, how to display the next page whenver the data will get overflow in main window?
    Please help me with this.
    Thanks in advance
    Regards,
    Darshana

    Hi Darshana,
    if you use text element for the item output, you will need same text element on NEXT page. Check for Typos. Switch on sapscript debugger and check what happens.
    Regards,
    Clemens

  • Drawing Table & Displaying Data in SAP Script : Data Alignment probelm

    Hi Experts,
    I am Developing An SAP Script in Which Had to Display Data in a Table with Three column & multiple rows, i had created the Table using BOX Command in SAP SCRIPT & assigned a TEXT Element to it & calling this text element while Looping in WRITE_FORM FM.but while displaying DATA in One column the data in another columns shift to the right & if the data in 1st column is less the data in the second column shift to the left. i know these issues had been covered in the past but i am not getting any concrete results from searching in the forum.
    Also On more problem when ever i am declaring a text element in some other window & also giving the Command BOX inside it to draw outline the BOX is not drawn.
    This seem to be an alignment issue . Experts Please provide me with some alternative.
    Thanks & Regards
    Priyesh Shah

    Hi ,
    To stop columns going left and right.Use number of position in the variable .Like fix the lenght &name(10)&.Here name can print 10 characters.
    For box not appearing in other window check the box command parameters .It will draw.Not a alignment problum.

  • Junk Characters on first two pages of Cheque Printing SAP Script.

    Hi All
    I implementing cheque printing for one of our client's Oman based subsidiary. I have copied the standard SAP Script F110_PRENUM_CHCK into a Z-Form and maintained its original language as EN. I have commented out all the unnecessary peices of information in all the windows and customised as per my requirement.
    Now the problem that i am facing is that when i execute this script through the standard driver program RFFOUS_C, i am getting junk characters on first two pages of the script. The info displayed comes in the HEADER and MAIN Windows. The desired output is coming in the 3rd, 4th and 5th pages.
    Please let me know how should i get rid of these junk characters.
    Regards
    Harsh
    PS: All info printed is in English only.

    Hi
    Thanks for your response.
    Yes, the remittance advice header info is getting printed in the HEADER Window and its contents in the tabular structure are in the MAIN Window.
    I am passing EN as the language.
    Adding to this, the report RFFOUS_C gets executed and i am checking the spool that is created which has the junk characters on the first two pages.
    Regards
    Harsh

  • Issue with the font and alignment in SAP Script PDF

    Hi Experts,
    I have a problem with the font in SAP Script PDF conversion.
    The output of the form is working fine but in the PDF the output is wrong.
    There is a dutch letter ' ï ' which is pinted in the form output correctly but in the PDF output the character
    has been changed to '#'.
    and also the alignment of some text has beed changed without line spacing in between.
    Please let me know what could be the problem and how to solve this issue.
    Thanks in advance,
    Regards,
    Sankara Chakradhar.

    Hi Prabhudas,
    I am using the FM 'CONVERT_OTF' to convert the data to pdf.
    The FM CLOSE_FORM is creating the IT_OTF internal table and the CONVERT_PDF uses that internal table to populate the         IT_PDF internal table and then using the FM 'SO_OBJECT_SEND' to send the PDF file to mail.
      CALL FUNCTION 'CONVERT_OTF'             
           EXPORTING                          
                format       = 'PDF'          
           IMPORTING                          
                bin_filesize = g_filesize     
           TABLES                             
                otf          = it_otf         
                lines        = it_pdf.        
    Regards,
    Sankara Chakradhar.

  • Displaying variable in sap-script

    Hi folks,
           I need to pass a variable to an existing sap-script. But that window is not calling form the print program. It just called dynamically, which contains current date and time. In that window i need to pass the variabe. But the value to the variabel is coming from the print program. How can i pass this variable to the script now...pls help me.
            Thanks,
            Shyam.

    Hi
    Create the window and pass these system symbols
    &date&
    &time&.
    Regards,
    Sravanthi

  • Firefox stops loading new pages, displays "Loading". When I close it it goes. But when I restart it gives me "Another version is running, but not responding. This requires a power cycle reboot.

    Version 3.6.18. Running on Windows XP Pro. (kept current)
    This happens on a variety of pages. I get the little Loading thing in the tab, with the circle moving. So I X out (to exit Firefox). When I go to restart I get the error message "Another version of FireFox is running, but not responding". I give Windows the "three finger salute", and go to Task Manager, and do not see any reference to Firefox, and the Performance, and Processes seem OK. But it never seems to close the earlier Firefox, and won't let me open a new one. Any suggestions? Super Thanks for your help!

    Hi Andis.
    First of all, this is completely normal behavior, although it's a bit irritating, I know. What happens is that when you close Firefox, despite the window disappearing right there and then, Firefox keeps running for a little bit until the whole closing procedure is completed. This can take a fraction of a second on fast computers, or can take a few seconds on slow computers or when Firefox is storing a large session (if you save your tabs). All you have to do is wait a bit until Firefox closes, and then open it again.
    To see if it's still running, you can press CTRL+SHIFT+ESC and then, under the Processes tab, you can see if firefox.exe is still there. If it's taking an unusual amount of time to close (which happens very rarely, and only if the browser freezes on exit), you can force the application to terminate from this application (task manager).
    Firefox 4.0 will reduce by 97% the time it takes firefox.exe to close, so this problem will be basically erased for Firefox's next version.
    Until then, I can recommend you this extension, which helps you restart your browser more easily and without bothering about closing times:
    https://addons.mozilla.org/en-US/firefox/addon/3559/
    Hopefully this will help.

  • Second page not triggering in SAP script

    plz help me in this too
    The code below is for two pages.
    Problem is that...My second page is not triggering.
    In the layout
    for Fist page
    attributes.
    page: FIRST
    next page: SECOND
    for second page
    attributes.
    page:SECOND
    next page: SECOND
    REPORT ZNEW1 .
    TABLES: MARA.
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ERSDA LIKE MARA-ERSDA,
    ERNAM LIKE MARA-ERNAM,
    LAEDA LIKE MARA-LAEDA,
    END OF ITAB.
    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF table ITAB
    WHERE VPSTA = 'K'.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    *DEVICE = ' '
    DIALOG = 'X'
    FORM = 'ZNEWLAY1'
    LANGUAGE = SY-LANGU
    EXCEPTIONS
    OTHERS = 1.
    call function 'START_FORM'
    EXPORTING
    FORM = 'ZNEWLAY1'
    LANGUAGE = ' '
    STARTPAGE = 'FIRST'
    PROGRAM = ' '
    MAIL_APPL_OBJECT =
    IMPORTING
    LANGUAGE =
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'HEADER'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'HEADER'
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.
    call function 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'LOGO'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'LOGO'
    EXCEPTIONS
    UNOPENED = 4
    OTHERS = 9.
    LOOP AT ITAB.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'MAIN'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2
    ENDLOOP.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'FOOTER'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'FOOTER'
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.
    call function 'END_FORM'
    EXCEPTIONS
    UNOPENED = 1
    BAD_PAGEFORMAT_FOR_PRINT = 2
    OTHERS = 3.
    call function 'START_FORM'
    EXPORTING
    ARCHIVE_INDEX =
    FORM = 'ZNEWLAY1'
    LANGUAGE = ' '
    STARTPAGE = 'SECOND'
    PROGRAM = ' '
    MAIL_APPL_OBJECT =
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.
    call function 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'MAIN'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.
    call function 'END_FORM'
    EXCEPTIONS
    UNOPENED = 1
    BAD_PAGEFORMAT_FOR_PRINT = 2
    OTHERS = 3.
    CALL FUNCTION 'CLOSE_FORM'
    EXCEPTIONS
    UNOPENED = 1
    OTHERS = 2.

    Hi Scientila Choudary,
           Your problem will be cleared once you remove start_form and end_form as these are not necessary.we have to use start_from and end_from when we are operating on different forms.Presently we are operating on only no need to use this.
           Once your problem is solved please close this.

  • Small doubt on displaying variables in sap script

    HI all,
    Can anyone let me know if i am in the correct way or not.
    i'm modifying one existing script. to display some data in the script i am doing like this :
    get the data into itab.
    loop at itab into wa.
    call FM write_form
       element = 'TEXT'.
    endloop.
    in the layout i am using this elements and variables
    /E TEXT
    S1 <D1>&WA-FIELD1&</> <D1>&WA_FIELD2&</>
    but the work in not having any data in the layout whereas before call write_form its having data.
    can anyone suggest me who to deal with this.
    thanks

    You can check if your SAPScript is able to talk with the driver program.
    In SE71
    Open in Change Mode
    Form > Check > Text
    Select the Include Res checkbox .. Press Enter
    Enter your Program in the Next popup by "Append Print Program"
    Now, press Copy.
    It will show you the errors.
    In your proram WA must a in TOP include or Globally declared.
    Regards,
    Naimesh Patel

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • RE Sapscript Customised MEDRUCK New Page

    Hi Abapers,
    I have added a extra Page to the customised MEDRUCK.I think I have done all the necessary requirements that has to be done. But the Problem here is the new page is getting printed only for certain PO's. I have not added any logic for this. Please can anyone would tell me whats the problem?
    Thanks and regards
    Salish

    Hi There,
    Am I correct in uderstanding that the new page you created is getting triggerred for certain PO's and not for all,
    Try debugging the code for both the examples, the issue could be with the block where you are calling the new-page. Either in SAP Script or in the Driver program you can call the new page.. see which one is getting triggerred and when..
    That should help you..
    Let me know if you are able to resolve this or if you need further help.
    Thanks-

  • Blank page is getting displayed in SAPScript when using NEW-PAGE option.

    Hello Experts,
    We have created a customized SAPScript and in this separate Script is generated based on the currency(WAERS).
    So if we have 3 different currencies, then 3 pages will be created with there details, but we are using NEW-PAGE option in
    MAIN window to separate the pages and after 3rd page it is displaying 4th page also with footer details.
    So how can we avoid last blank page which is getting displayed?

    Hi isha.walia ,
       This issue can be solved by two ways. Please take the one which suits you better.
    Solution 1: If  you need to generate separate prints for different currencies.
    In the driver program, build an internal table for different currencies which needed to be printed. (Using delete adjacent duplicates, build the internal table with exact number of currencies to be printed). Remove the NEW-PAGE option and call the script/form inside the loop. Do the necessary conditions to manipulate the print.
    Advantages of above solution: Better control on spools if needed.
    Solution 2:  Get the count of the number of pages in a variable. Inside the print loop, increment a flag counter. Check it against the variable which contains the number of pages to be printed at the end of each page. Exit the loop when the number of pages to be printed is reached.
    Advantage of above solution: Simple to write the program.
    Thanks and Regards
    Raghesh R S

Maybe you are looking for

  • My iPhone 5 will change its time randomly throughout the day. How do I get this to stop and stay on local time?!

    Randomly my iPhone 5 will change the date and time on my phone. A message will then come up saying I need to set my date and time in order to send or receive messages. It's on the automatic setting for date and time but this is happening 3 and 4 time

  • File descriptor leak in socket programming

    We have a complex socket programming client package in java using java.nio (Selectors, Selectable channel). We use the package to connect to a server. Whenever the server is down, it tries to reconnect to the server again at regular intervals. In tha

  • Missing Photo Stream Album in iPhoto

    Hi! I'm hoping someone can help me. My Photo Stream album seems to be missing from my iPhoto. It use to be there but one day, it just disappeared. I already unchecked and checked under Preference to see if it would appear but it didn't work.Please he

  • EBS Error

    Hello Everyone, My client is using MT940 FORMAT for EBS. Suppose there are 10 transactions which have the same amount for eg:Rs.1000 for ten payment transactions, the system is unable to post the document when we import the bank statement. Kindly hel

  • Scenario à partir d'un fichier txt

    Bonjour, Je souhaiterais réaliser un programme pour créer ou modifier un scénario à partir d'un fichier .txt Quelle architecture me permettrait d'ajouter des étapes en cliquant sur le bouton "suivant" et modifier en revenant sur "précédent" ? (Comme