Smartform All pages in one print preview problem

Hi
     I am displaying the employee data in ALV with checkbox selection.. i put two user defined buttons like print and print preview. when user clicks on print button, smartform will call for very employee in loop and print it employee wise. But my problem is when user clicks on print preview by selecting multiple checkboxes , I need all pages(employee wise like page1,2,3..) in one print preview. I done but for every employee,i have to press the BACK button. But I need all pages in one preview. I'm pasting my code here. Can anyone suggest??
WHEN 'PREVIEW'.
w_cparam-no_dialog = 'X'.
  w_cparam-preview = 'X'.
   w_cparam-getotf = ' '.
   w_outoptions-tddest = 'LOCL'.
   w_outoptions-tdnoprev  = ' '.
    w_outoptions-tdimmed  = 'X'.
* to reflect the data changed into internal table
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data.
      ENDIF.
loop at i_data into wa_data where SEL = 'X'.
MOVE-CORRESPONDING WA_DATA TO WA_PRINT.
  APPEND WA_PRINT TO I_PRINT.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZHRF1_PTAR1001'
*       VARIANT                  = ' '
*       DIRECT_CALL              = ' '
     IMPORTING
       FM_NAME                  = FM_NAME
*     EXCEPTIONS
*       NO_FORM                  = 1
*       NO_FUNCTION_MODULE       = 2
*       OTHERS                   = 3
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  CALL FUNCTION FM_NAME
    EXPORTING
*     ARCHIVE_INDEX              =
*     ARCHIVE_INDEX_TAB          =
*     ARCHIVE_PARAMETERS         =
     CONTROL_PARAMETERS         = W_CPARAM
*     MAIL_APPL_OBJ              =
*     MAIL_RECIPIENT             =
*     MAIL_SENDER                =
     OUTPUT_OPTIONS             = W_OUTOPTIONS
     USER_SETTINGS              = 'X'
      FR_DATE                    = PN-BEGDA
      TO_DATE                    = PN-ENDDA
   IMPORTING
*     DOCUMENT_OUTPUT_INFO       =
    JOB_OUTPUT_INFO            = T_OTF_FROM_FM
*     JOB_OUTPUT_OPTIONS         =
    TABLES
      ITAB                       = I_PRINT
*   EXCEPTIONS
*     FORMATTING_ERROR           = 1
*     INTERNAL_ERROR             = 2
*     SEND_ERROR                 = 3
*     USER_CANCELED              = 4
*     OTHERS                     = 5
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
CLEAR: WA_DATA,WA_PRINT.
CLEAR: I_PRINT.
  ENDLOOP.

Hi friend sure.
You need to increment the index only at the loop no where else and the variable for holding the index value is global.
If you create before the read every time it gets trigerred.
After each loop you assign the sy-tabix value to that variable.
Just like this ,
v_index = sy-tabix.
Then at the window just read the table as shown
READ TABLE t_chq INTO x_chq INDEX v_index.
This will do friend.
I will update the flow of my code here, then you many understand it much clear.
Page1
  Main window (below page1)
    Loop (inside Main win)
      program lines. code : v_index = sy-tabix. v_lines =  lines( t_chq ). (inside loop)
      Condition (inside loop)
         True
            check the v_index < v_lines if true break page, for page break create a command and do it (Inside true condition)
         false
           blank.
  Secondary window (below page1)
    program line (inside sec wind)
    Inside program lines the code is READ TABLE t_chq INTO x_chq INDEX v_index. (inside sec wind)
  Secondary window2  (below page1)
     program line (inside sec wind2)
    Inside program lines some other code. (inside sec wind2)
This is my logic try like this friend.
I think for other records its coming fine because since it is an local variable its getting updated some where and also showing 1 bec its always initializing.
Try this you will get if any issues please revert back to me
Thanks,
Sri Hari
Edited by: srihari.kumar on Jan 6, 2012 11:04 AM
Edited by: srihari.kumar on Jan 6, 2012 11:05 AM

Similar Messages

  • Is it possible to see all pages in one document at once?

    Hey.
    So I can't figure out if it's possible to see all pages in one document at once, so that it's all on screen at the same time.
    Is it possible and if it is then how so?
    Thanks in advance for any kind of help

    Wouldn't that depend on how many pages there are, how large your screen is and how small you were willing to put up with in the thumbnails?
    Peter

  • How to copying all pages at one shot?

    Does anybody know of a way of copying all pages at one shot, under a tabset in an application in a workspace to another application in the same workspace instead of doing it page by page?

    There is no Select All option, but you can do it a little faster than opening each email and tapping the Trash icon. In the top rightcorner of the list of email is an edit button. Tap Edit.
    You can then tap each email in the list to select it for deleting and then tap the Delete button at the bottom of the list.
    These screenshots are from my iPad, but it works the same on my iPhone.

  • HP Officejet pro 8500A premium, all-in-one printer, scanner problems

    I have an HP Officejet pro 8500A premium, all-in-one printer.
    Tried uninstalling using the HP supplied uninstall software and installed recommended OSX 10.8 software for this device.
    I use wireless scanning. Scanner only scans the first page then shows an error.
    Anyone have this problem as well and any possible solutions?
    Thanks

    The HP Scan works just fine in Mountain Lion for me. Always has.
    OfficeJet Pro 8500 A909a
    I think the original poster needs to reinstall the latest software for the printer that came with his printer or directly from HP. Then, install the Apple HP updates.
    When he unistalled the HP software, it may have removed the software needed for HP Scan to work properly.
    The last software I installed from HP was -> HP_Installer_Officejet_Full_Group05_10.3.dmg
    Yes, there have been Apple HP updates, but they never stopped my HP Scan from working.

  • Deskjet 3520e all in one printer network problems

    Hi All.
    I have a brain teaser for the technical types out there hoping someone can shed some light on a weird sort of problem.
    History: All has been fine with my g6 Pavillion latop 64bit W8 and 3520e all in one printer and working as always very well.
    Oct 16th 2014 My broadband service went down and after many communictions with ISP eventualy received (Nov 4th) and installed a new "super hub modem".
    OK so far, Managed to connect laptop via wireless router and connect to internet etc., however . . . I cannot get my printer to network as before, I can use it via USB port but if I try to network it, The Cyan ink cartridge reports as being broken or damaged even though 3/4 full and will not allow printing, but when connect via USB port the Cyan ink cartridge registers normal and will print as expected.
    Has anyone else come across this problem?
    If I go down the route of uninstalling and reinstallin the Printer software is there a set order in which to do so?
    In the list of programs these four are shown. . 
    HP Deskjet 3520 series Basic Device Software
    HP Deskjet 3520 series Help
    HP Deskjet 3520 series Product Improvement Study
    HP Deskjet 3520 series Setup Guide.
    I would like very much to get back to network printing if at all possible.
    The router IP address is 192.168.1.3
    The printer IP address is 192.168.0.1
    I have been led to believe that as the addresses are so close this shouldnt be the cause.
    I must add that in the past I have had occasional printer software problems which I was unable to resolve without help from the technical centre and I would prefer not to restart the installation if at all possible.
    Your comments would be appreciated.
    Thanks in advance.
    Un1corn.

    Hi @Un1corn 
    What exactly happens when you try to convert from USB to Wireless and configure the printer to the Virgin Media Super Hub? Do you get an error message of some sort?
    Maybe there is a firewall on the Super Hub. Do you have the model number for this device? I can look up some information to see what could be casing the issue.
    In the meantime, running the Print and Scan Doctor might help. The HP Print and Scan Doctor is a free utility (tool) that helps to quickly resolve common printing, scanning and connectivity issues including but not limited to:
    Connectivity:
    USB: Verifies that the USB connection from your computer to the HP product is working correctly.
    Network: Verifies that the network connection between your computer and your network is working correctly.
    Device Status Test: Checks for device errors such as out of paper, paper jams, carriage stalls, and paper feed issues, and then provides instructions for fixing the error.
    Driver Check: Checks for missing or corrupt driver files.
    Device Manager: Checks for problems in Device Manager that would prevent printing.
    Device Online: Checks if the product has been paused or set to offline, and then sets the status back to online if necessary.
    Print Queue: Checks for and clears pending print jobs in the print queue (a log of print jobs waiting to print).
    Port Match: Checks the port settings for the HP product.
    Device Conflicts: Checks for conflicts with other drivers, such as other printer brands.
    Ink Issues: Checks the cartridges and ink levels for issues that affect print quality.
    Print Settings: Checks and adjusts the print quality settings.
    Test Print: Prints a test page for print quality evaluation, and provides options for cleaning and aligning the printhead if necessary.
    Scan Tests: Checks the scan mechanism, drivers, and registry entries.
    Source:Try the HP Print and Scan Doctor for Windows
    Click here to download and run the Print and Scan Doctor> www.hp.com/go/tools
    If that does not resolve the issue, post back and let me know if there are any symbols other than green check marks and what they are next to of course. The wrench is not always easy to spot as the wrench and the check mart are in the green circle.
    If you see only green check marks (), the tool did not find any problems.
    If you see green wrenches (), the utility identified an issue and corrected it automatically.
    If you see yellow exclamation points (), the test failed and required user action, but the step was skipped.
    If you see a red X (), follow the on-screen instructions to resolve the issue.
    I look forward to hearing back from you.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • HP 7510 all in one printer driver problem

    Trying to reload HPPhotosmart 7510 series all in one printer software.  Have CD/downloaded newsest version from HP.com, have uninstalled all versions etc....have downloaded hppiw /hp prin and scan doctor when running HP doctor indicates two 7510 series (Net) and not net.....just the IP/MAC information as listed on the printer. However when trying to load the software it uses the non-net IP address...it can identifies the IP address for the printer, when using older printer software it works wireless and prints .,....however when trying to load software automatically get error message "unsuccessful network installaion" the prinert was unable to be installed over the network...tried with printer cable, it would not accept.....looking at the Device  Manager, Other devices 5 listings of HP Photosmart 7510 series (1 has exclamation point 4 have question mark icon, within the properties of each inidcates that "the drivers dfor this device are not installed)...attempted to uninstall each to no avail..have 6 listings of Photosmart 7510 series all with the exclamation icon and same properties....not installed. same situtation tried to uninstall, to no avail.......have tried other suggestions which were listed on forum to no resolution....any suggestions greatly appreciated..thanks

    Hello etrout17,
    Welcome to the HP Support Forums!
    I see you are having some install issues with the HP Photosmart 7510, it shows multiple printers in the installers and even more in the Device Manager. What version of Windows is installed on the computer?
    Have you been able to add the printer from the Devices and Printers? This of coarse is not a fix for the issue but my allow you to get some printing done.
    I will research the issue more and wait for your reply.
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • Usb for 1510 all-in-one printer causing problems with it accepting print jobs

    I am having trouble downloading the driver for a 1512 all-in-one printer.  It was working for about a week and it is not working now.  I loaded the suggested driver 1510 all-in-one driver but when I get to plugging in the usb from my Windows 7 laptop to the printer, it does not feel it is connected.  I can print items that I scan but am puzzled how it will not print.  The only thing I have deduced is I need a new usb cable.  I bought on ebay as I've always had good luck with hp products.
    Sparky325

    I decided that in spite of the fact that it had previously printed, I got another USB cord and used that and then the printer worked.  The one I received with the printer must have been too loose to make a connection.  This one feels snug when i need to print from my laptop.  Thanks for your help. Sparky 325

  • L7680 Print Preview Problem

    When I select 'Print Preview', the Preview screen appears, but the document is blank.  All pages print properly, however.  This applies to all the apps I use mostly (maybe more) such as Word, Excel and Internet Explorer.
    Spent 30 minutes with Chat, going through all the options, default and otherwise, before they hung up on me.  No joy.
    The last thing I want to hear is un/reinstall.  That seems to be the usual solution to my problems.  Hope this one is different.
    Thx for any suggestions
    Haz

    Quote: When I select 'Print Preview', the Preview screen appears, but the document is blank.  All pages print properly, however.  This applies to all the apps I use mostly (maybe more) such as Word, Excel and Internet Explorer.
    Yes, I get the same problem since installing Windows 7! If I wait long enough, the document is eventually displayed in the Print Preview screen!
    But the question is why is this happening in Windows 7, when it did not happen in XP or Vista? I believe the answer is that there is still a fault in the OS that has not been corrected. The fact seems to be that we have all purchased an OS that was not fully ready for public release! And that is just not good enough MICROSOFT!

  • I changed my margins in page setup and now I cannot see page setup, a print preview, or print, what do I do?

    I changed left and right margins to .5 thinking they were in inches and closed the page setup screen the next time I tried to print all I saw was a blank page or no page depending on zoom / shrink to fit ratio set. When I go to page setup all I get is a new window that is transparent in the text area and extends off the right side of the screen. I have to right click and select close to close it as I do not see the standard minimize, maximize, and close buttons. I do not want to reset defaults as I have changed many settings and do not remember all the settings I have changed. I do have an older copy of my firefox profile in a previous user profile of mine on this machine. Is there an easy way to reset the page setup settings?
    What do I do?
    PS. I am using Firefox 29 on a XP Pro machine slated for upgrade to windows 7 Pro.

    Sorry I have been away from this system forr a while. when I turned it on this morning and launched Firefox it upgraded me to version 31.0.
    Attached are three Png files, one is what happens if I try to print to do a print preview. If I try to print a web page it prints the same thing.
    The other file is what comes up when I click on page setup. It opens a very wide window that is a copy of the web page that was there when page setup was clicked on.
    The Third is what happens to the above page setup window when I drag the window to the left.

  • Purchase order Print preview Problem in ME23N

    Hi all,
    We are trying to see print preview of purchase order in ME23N, but, when we press print preview button another window named "SAPLPD" is poping up. The pop-up window looks like command propmt window and contains lines like
    "(11:25:54 AM) Icon DLL loaded.
    (11:25:54 AM)
    (11:25:54 AM) Network Communication via SAP-NiLib
    (11:25:54 AM) Hostname: L04WSChe0300
    (11:25:54 AM) IP Address: 10.87.7.11
    (11:25:54 AM)
    (11:25:54 AM) SAPLPD Version 6.28 for Windows/NT (OPT) is listening
    (11:25:54 AM) OS-Info: version = 5.1, build = 0/2600, text = Service Pack 2
    (11:25:54 AM) Copyright © 1992-2001 SAP AG
    (11:25:54 AM)
    (11:26:04 AM)
    (11:26:04 AM) Receive job for printer __DEFAULT (Berkeley LPD protocol / RFC1179)
    (11:26:04 AM) send_status called
    (11:26:05 AM) send_status called
    (11:26:05 AM) send_status called
    (11:26:07 AM) send_status called
    (11:26:07 AM) send_status called
    (11:26:07 AM) Job 000jgjJp.DEV for user DEV2 queued.
    (11:26:07 AM) Start printing job 000jgjJp.DEV on printer MICROSOFT OFFICE DOCUMENT IMAGE WRITER
    (11:26:13 AM) Error: Unable to start print job, Windows rc = -2, Error = Overlapped I/O operation is in progress.
    (11:26:13 AM) Error: BG: saplpd_open_dc failed, msg = 808 SAPLPD:Windows Problem, siehe SAPLPD Protokoll
    How can I fix this problem and see print preview of purchase order in ME23N.
    Please help me!
    Thanks,
    Rajan

    hi,
    DATA: w_compop    TYPE ssfcompop.
    w_compop-tdimmed   = ' '.     "Print Immediately control parameter should be empty..
    Then only print preview pop-up will come..
    then call your smartform like this..
    CALL FUNCTION fnam
        EXPORTING
          control_parameters = w_ctrlop
          output_options     = w_compop
              TABLES
          it_vbdkr           = it_tvbdkr[]
          it_vbdpr           = tvbdpr[]
          it_zglentitycode   = it_zglentitycode[].
    regards
    vijay

  • Web page truncated in print preview

    Print preview on this web page is truncated in the middle of the comments.
    Internet Explorer 11.0 is worse, omitting the comments entirely.
    Chrome 37.0 print preview is quite good with a few minor errors. And the print function includes PDF file output, exactly what I was looking for.
    I am a long time Firefox fan so it is painful to have resorted to installing Chrome.... :-( :-)
    Are there some config change(s) I could make so the print preview would be complete?
    (Maybe it's the content that's causing the problems? :-D)
    http://www.gayguys.com/2014/08/young-gay-guys-becoming-attraction-older-men/

    This is a tough one. The Facebook content is in an iframe (inline frame) and due to the style rules in the frame, or something about the way the frame is positioned in the page, Firefox is not correctly paginating the full iframe content.
    There are lots of cases like this where Firefox stumbles in its print layout. Often a little hack solves it, but in this case, I don't see a quick fix.
    You can print the comments in full as follows:
    right-click the Facebook content > This Frame > Print Frame
    In the print dialog, you can start on page 2 (e.g., 2 to 99) to reduce the duplication. (Due to text size difference when printing the FB content outside of the frame, there was still some overlap in my test.)

  • Smart forms Print preview problem

    Hi
    Experts,
    I am working in CRM2007. I am creating number of different type Smart forms for our client requirement. All Smart Forms working fine in WEB GUI. In Web GUI there have two buttons; one is print buttons and another one is Print Preview buttons.  When we press print buttons it is directly go to printer for printing service order or service invoice or sales order or sales invoice whatever user is selected. Means working fine print buttons. And in case when we press print preview button it is open selected forms in PDF format; it is also work fine in our desire. But problem is here PDF format front size; which is very small. And after looking the PDF format if we select for print out of this PDF form; the print out orientation is Landscape and front size is very small. Now my question to all of experts u2026u2026u2026.How I change PDF front size and orientation? u2026u2026u2026u2026u2026u2026any type of BSP Enhancement or functional setting is required? Please Experts help meu2026u2026u2026u2026u2026u2026u2026u2026..
    Regards
    Tarapada  D.

    please CRM Experts give me some answer!!!!!!!!!!!!!!!

  • Adobe PDF Form print preview problem

    Hi All,
    I am new to Adobe PDF form.  I have created one small form using the t-code SFP.
    I am testing this form directly from the T-code SFP.
    When i use the print preview to see the fom output it is givine me below exception.
    "Device type unsuitable for ADS documents"
    I am using the printer LOCL.
    Can you please help me to rectify this problem.
    I am not able to undestand why i am getting this error as i am new to ADOBE form.
    Thanks in advance
    Sachin

    Hi
       check this [LINK|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/other-topics/how%20to%20check%20if%20the%20adobe%20document%20service%20is%20running%20correctly.pdf] to check if ADS is working or not.
    Thanks
    Viquar Iqbal

  • SmartForm Last Page to be printed in Duplex mode

    I have a requirement in PO printout where the Last page containing the Terms and Condition to be printed on Duplex mode.
    Suppose the PO is taking 4 pages without Terms and condition. then the TC must be printed on the backside of the 4th page.
    My smartform contains 3 Pages  'First', 'Next' and 'TC'.
    If i set page 'Next' duplex then the 3rd page is getting printed on the back side of the 2nd page.
    So how can i Print the TC page on the backside of the Last Page.
    Thanks & Regards
    Sukriti.

    Hi All,
       I know this is a very old post. Currently I am also facing same issue. Does anybody has solution for it. ?
    Regards,
    Leona

  • Subcontracting challan print preview problems

    Hello sir,
    i am having a problem  when i create subcontracting  challan from j1if01 for a vendor 'S'  item 'x'.
    material details for 'X' is shown for vendor 'S' in challan print preview.
    again when i crete second challan from j1if01 for the same vendor 'S' item 'y'
    material details for 'y' is not shown for the same vendor 'S' in challan print preview.
    i have maintained chapter id for both material.
    regards
    sanjay

    Hi Sanjay,
    Your problem is not clear. IS it that you have two materials in BOM and you are transferring these two materials to the vendor but only one item is printing and not the second one.
    Pls check your settings under logistics General> Tax on goods movement>India--> Subcontracting attributes in that EI items. What is the number selected there. If it is one it will print different challan per item.
    Regards
    Sangeeta

Maybe you are looking for

  • Wireless issue on Satellite 1900-303

    I installed an Intel Pro wireless 2200BG mini PCI on my notebok all the drivers installed properly Windows recognizes the card and reports no probles but no matter is the hardware switc on or off it reports hardware switch is off turn it on and the l

  • Time Machine won't allow me access to i photo to reinstall deleted folders

    I have deleted a couple of events from i photo 09 and want to reinstall them from time machine. When I attempt this tiem machine tells me the action can't be completed because I do not have acess to i photo library 15-29-00. Just before I attempted t

  • ORA-00150: duplicate transaction ID ?

    Hi guys, I am calling a sql program from within my shell script and passing two parameters but I keep getting SQL Error Code -150. Any ideas about what this is ? Thanks

  • Do you have to uninstall premier elements 11 for premier elements 13

    1)  I have just purchased Adobe photoshop elements 13.  I currently have CS5.....  Can I use both on my Mac on the "same" HD? 2) I have also purchased Adobe Premier Elements 13.  I currently use Premier Elements 11.   Can I keep/use Mac  Both  on the

  • Unmark batch management at Material Master Record.

    Hi all: Is it possible to unflag the batch management mark from a material (with an existent batch) and use it again? The material is already marked for batch management use. An initial stock (with batch) was made. Then a necessity to unflag (batch m