Generating print preview

Hi,
I would like to generate print preview of all the fields in the form dynamically when the user clicks a button. How do I make a pop up PDF form when the user clicks a button.
The reason for not going for Adobe's print functionality is that I have some fields in the form that can have more than 100 lines so when tried to print using adobe's print function, it does not print all the lines instead it prints only the visible lines in the form.
Any help is greatly appreciated.
Thanks,
Kalyan

Hi ,
Just a work around -
In Click event of the button call print method like this -
<b>Examples
JavaScript
xfa.host.print(1, "0", "0", 0, 1, 0, 0, 0);</b>
Print Method -
Prints a specific number of pages from a document. It is available only for client applications.
Syntax
EMPTY print( BOOLEAN param1, STRING param2, STRING param3, BOOLEAN param4,BOOLEAN param5, BOOLEAN param6, BOOLEAN param7, BOOLEAN param8 )
Parameters
param1
&#9679; True (default)
Displays a print dialog box and prompts the user for printing setup information and
confirmation of the action.
&#9679; False
Does not display a print dialog box. Printing proceeds without prompting the user for information or confirmation.
param2
A valid string representing the page number of the beginning of the range to print. Page values are 0-based, so you represent page 1 with a value of 0.
The start page is included in the printing.
param3
A valid string representing the page number of the end of the range to print. Page values are 0-based, so you represent page 1 with a value of 0.
The end page is included in the printing.
param4
&#9679; True (default)
Does not display a cancel dialog box during the printing process.
&#9679; False
Displays a cancel dialog box to stop the printing process.
param5
&#9679; True (default)
Shrinks the page (if necessary) to fit within the imageable area of the printed page.
&#9679; False
Does not shrink the page to fit within the imageable area of the printed page.
param6
&#9679; True (default)
Prints each page as an image.
&#9679; False
Prints each page as a page of text.
param7
&#9679; True (default)
Prints the pages in reverse order.
&#9679; False
Prints the pages in order.
param8
&#9679; True (default)
Prints all annotations.
&#9679; False
Does not print annotations.
Try to call print in java script.
Nanda

Similar Messages

  • How to find the query that generates print preview?

    Hello,
    How can I find the query that gets executed to generate  print preview? On SAP Business One client if I open a Sales Quotation and click on print preview a report is generated. What queries are run in the background to generate this report?
    Thanks for your help.
    Regards,
    Sheetal

    Hi Sheetal,
    In such cases i am using a Profiler which is connected to my company's database. If you are using SQL-Server, the start the "Profiler", connect it to your database server and start the trace. When the trace is running, execute the SBO action. After you executed this action you will see in the profiler the excuted SQL-Statements.
    Regards,
    Christian

  • Generating Print Preview of report in PDF

    Hi all,
    I need to generate a print preivew of a report output in PDF. When the report is executed, it displays the output. On the status bar, there is a button. When the user clicks on this button, instead of downloading the report in PDF, the report should be displayed in PDF format. Can anyone explain how this can be achieved?
    regards,
    Hamza

    Hi see this tutorial.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785
    It is about displaying smartform output as pdf in web dynpro.
    in the code given there is a method display pdf, try writing ur report code inside it and see if it gets displayed as pdf.
    Not sure if it would work but can give it a try.
    кu03B1ятu03B9к

  • Not able to print the script form from print preview

    Hi Experts,
    I need to print one of the script form from print preview. As per the req. first i need to generate a print preview of this form and if required should be able to print it from this preview.
    i am able to generate print preview and also able to see the print option but when i try to print it is going to the spool (which i dont want). I want it to be printed directly to the printer instead of sending it to the spool.
    Please suggest me
    The way i coded it is
    DATA: arcpar TYPE arc_params,
                pripar TYPE pri_params.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          layout                 = 'X_65_132'
          line_count             = 65
          line_size              = 132
        IMPORTING
          out_parameters         = pripar
          out_archive_parameters = arcpar
          valid                  = val
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      pr_options-tddest = ''.
      pr_options-tdpreview = 'X'.
      pr_options-tdnoprint = ''.
      pr_options-tdsuffix1 = 'STUFF'.
      pr_options-tdsuffix2 = matnr.
      pr_options-tdimmed = ''.
      pr_options-tdlifetime = '2'.
      pr_options-tdprogram = Form-name.
    CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device   = 'PRINTER'
          dialog   = space
          form     = "purchase or"
          language = sy-langu
          OPTIONS  = pr_options
        EXCEPTIONS
          canceled = 01
          device   = 02
          form     = 03
          OPTIONS  = 04
          unclosed = 05.
      CALL FUNCTION 'START_FORM'.
    ENDFORM.                    " open_and_start_form
    Thank you.

    Hi,
       Just pass the value 'X' to "pr_options-tdimmed" field.Try this.
    I hope,it help you
    <=<< Sharing Knowledge is a way to Innovative  >=>>
    By,
      Yoga

  • Generate and Print Preview Multiple Forms in a Single PDF

    There have been other questions similar to this but none directly address my problem.  We have the need to generate multple forms in a .pdf using Adobe interactive forms.  We can generate the multiple forms, but the user has to click on each form to view.  They want to have the forms in a single document that they can scroll through before printing.  We can do this in SmartForms but need to do it in Adobe.  Does anyone know how to generate multiple forms, either multiple copies of the same form or various forms, from an ABAP program into a single pdf that can be print previewed, in scrollable form, by the user?

    I can describe it one more time, I think:))
    You have multiple options, but only one "reasonable" within SAP.
    You can call an external application (through command line etc.) to concatenate forms for you.
    You can use iText as mentioned in the thread, and write yourself a "tool" which will concatenate the forms for you.
    Both these "options" would not be acceptable for my clients, I name them to help you get the whole picture.
    Then there is the third option: use a form for a single instance (template/ form A) and create a new form (form B), where you will use the A template:
    - you need to: create a new interface where everything from the old interface is a row of the table (example: you have a form to print out the personal card of the employee, so in a new form you will need to use a table, where a row is an employee)
    - you need to create a new form layout based on the new interface:
    in this new layout you will paste the whole layout of the old form (A/ single instance) and wrap it into a subform. The added subform will work as a table (you will bind that to the table from interface) and everything from the old template within this new subform will work as a "row" (something what you can repeat for each data item).
    Does that sound reasonable?
    Cheers Otto

  • Vendor Ref. no. not displayed in print preview in vendor aging report

    Dear SAP team,
    Vendor reference number is not displayed in print preview/print on vendor liabliteis aging report,
    but this vendor reference number actually show in report,We are taking report by journal postings,
    vendor reference entered in NumAtCard in AP invoice get copied to Ref2 in Journal Entry,then
    why it is not showing in print preview/print.
    Whether this is an application error / missing functionality ?
    We are using SAP Business One 2005 B (7.40.252)  SP: 00  PL: 36.
    Whether upgrade to latest patch 2005B PL46 will solve this issue ?
    Jeyakanthan

    Hello Jeyakanthan,
    I would like to draw your attention to the enhancements we delivered within Aging Report in 2007 version and plan for 8.8 release.
    The primary enhancement in 2007 version is reflecting new concept of Internal Reconciliation with more convenient backward reporting.
    Within the 8.8 release ...
    - when you generate the aging report you can group the report by customer or sales employee in the customer receivables aging report, and by vendor or buyer in the vendor liabilities aging report;
    - when the aging report has been generated, you can view multicustomer/multivendor detailed information in the aging report window. There is no need to double-click each customer/vendor row to view the details.
    We would strongly to recommend you to upgrade to 2007 version or join the ramp-up of 8.8 release soon.
    Peter Dominik
    B1 Solution Management

  • How to see the print preview of outgoing excise invoice.

    Hi Experts,
    How to see the print preview of outgoing excise invoice.
    Thanks,
    srinivas.

    Dear Sreeni,
    Just go to J1IIN, click on "Exc.inv for delivery -- Display" where you input delivery reference and execute. If you have generated excise invoice, you can see the corresponding excise invoice for that delivery / billing document.
    Preethi.

  • Problem while viewing print preview in Portal(EP7.0)

    Hello Experts,
    We have prepared an ABAP report which generates an output in print format.We have used standard function module(SSF_FUNCTION_MODULE_NAME) and the smartform gets displayed correctly in print preview on R/3 side.But when i create a transaction iview and use this report in portal,  the output gets generated in pdf format directly.I do not want to display the report in .pdf format but i would like the users to view the output same as in R/3 format.
    Please advise.
    Thanks in advance.
    Regards,
    Subodh

    Hello Experts,
    Can anyone reply to this thread?

  • Crystal Report: Show Field only in Print-Preview

    Dear Experts,
    is it possible to show a field only in the print preview (when the report is generated) without printing this field?
    Thanks for Help.
    Jacqueline

    No, it is not possible to display a report object on screen then suppress it when printing.
    Fuskie
    Who thinks you would have to use 2 reports or use a parameter that offers the option of formatting for view versus for print...

  • Print preview of smart form

    Hi all,
    how to view the print preview of a smart form and how to debug the smart form
    Thank You

    SMARTFORM-> execute->execute->pass values if require to import & table parameters ->execute-> on the pop up window give Printer name as LP01 and press print preview.
    For debussing -
    1. write BREAK POINT in the code window.
    2. Put a break point on the call function in the driver program
    3. put a brak point in the generated Function module.
    Refer this link too -
    Re: smartforms
    Regards,
    Amit

  • Problem in alv grid display (it is not filtering the data in print preview)

    Hi Every One,
    Its very urgent for me to deliver this report ....
    I applied sort criteria on my final internal table which is pupulated and then i passed to the function module...
    when i execute the program it is showing me the perfect output..when i take a print preview it is not filtering the data instead it is showing me the normal uotput i.e..,without sort criteria...
    here is the code plz go thru it and tell me were i am doing wrong...
    i thank u one and all ...and plz debub the code on the system and let me know....
    REPORT  tracking-quotation NO STANDARD PAGE HEADING MESSAGE-ID zrv_message LINE-COUNT 65 LINE-SIZE 110.
                          Includes
    This include contains declarations
      INCLUDE ZMM_TRACKING_QUOTATION_T.
    This include contains code for the performs
      INCLUDE ZMM_TRACKING_QUOTATION_F.
    AT SELECTION SCREEN                                                  *
    AT SELECTION-SCREEN.
    This perform will validate the fields
      PERFORM f_validate_sel_screen.
                         Start-Of-Selection
    START-OF-SELECTION.
    This perform will read the values from the database.
      PERFORM selection.
    This perform will build the field catalogue
      PERFORM f_build_catalogue.
    This perform will build the sort
      PERFORM f_event_sort.
    This perform will build the layout
      PERFORM f_build_layout.
    This perform will build the event
      PERFORM f_event_build.
    This perform will build the comment
      PERFORM f_comment_build.
    This perform will display the list
      PERFORM f_list_display.
              End-Of-Selection
    END-OF-SELECTION.
    *&  Include           ZMM_TRACKING_QUOTATION_T                         *
               T a b l e s   D e c l a r a t i o n s                     *
    TABLES: eban,
            ebkn,
            ekko,
            eket,
            lfa1,
            ekpo.
          Selection Screen Declaration
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-100.
    SELECT-OPTIONS: bednr  FOR eban-bednr,
                    ps_psp FOR ebkn-ps_psp_pnr,
                    kostl  FOR ebkn-kostl,
                    erdat  FOR ebkn-erdat.
    SELECTION-SCREEN END OF BLOCK b1.
               Type Pools  D e c l a r a t i o n s                        *
    TYPE-POOLS: slis.
               V a r i  a b l e s                                        *
    DATA : rt_fieldcat  TYPE slis_t_fieldcat_alv,
           i_layout     TYPE slis_layout_alv,
           i_event      TYPE slis_t_event,
           i_listheader TYPE slis_t_listheader,
           l_sort       TYPE slis_t_sortinfo_alv,
           wa_sort      TYPE slis_sortinfo_alv.
               I n t e r n a l  T a b l e s                               *
    DATA: BEGIN OF i_final_tab OCCURS 0,
          name1      LIKE lfa1-name1,
          banfn      LIKE eban-banfn,
          badat      LIKE eban-badat,
          bnfpo      LIKE eban-bnfpo,
          txz01      LIKE eban-txz01,
          menge      LIKE eban-menge,
          bednr      LIKE eban-bednr,
          frgdt      LIKE eban-frgdt,
          lfdat      LIKE eban-lfdat,
          ps_psp_pnr LIKE ebkn-ps_psp_pnr,
          bwbdt      LIKE ekko-bwbdt,
          aedat      LIKE ekko-aedat,
          lifnr      LIKE ekko-lifnr,
          ihran      LIKE ekko-ihran,
          ebeln      LIKE ekpo-ebeln,
          ebelp      LIKE ekpo-ebelp,
          plifz      LIKE ekpo-plifz,
          eindt      LIKE eket-eindt,
          END OF i_final_tab.
    DATA: BEGIN OF itab OCCURS 0,
          name1      LIKE lfa1-name1,
          banfn      LIKE eban-banfn,
          badat      LIKE eban-badat,
          bnfpo      LIKE eban-bnfpo,
          txz01      LIKE eban-txz01,
          menge(17),
          bednr      LIKE eban-bednr,
          frgdt      LIKE eban-frgdt,
          lfdat      LIKE eban-lfdat,
          ps_psp_pnr LIKE ebkn-ps_psp_pnr,
          bwbdt      LIKE ekko-bwbdt,
          aedat      LIKE ekko-aedat,
          lifnr      LIKE ekko-lifnr,
          ihran      LIKE ekko-ihran,
          ebeln      LIKE ekpo-ebeln,
          ebelp      LIKE ekpo-ebelp,
          plifz      LIKE ekpo-plifz,
          eindt      LIKE eket-eindt,
          END OF itab.
    *&  Include           ZMM_TRACKING_QUOTATION_F                         *
    **&      Form  FIELDCAT_INIT
          text
         -->P_GT_FIELDCAT[]  text
    FORM f_build_catalogue.
      DATA : ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname     = 'BANFN'.
      ls_fieldcat-tabname       = 'itab'.
      ls_fieldcat-seltext_m   = 'PR Number'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
      ls_fieldcat-fix_column  = ''.
      ls_fieldcat-emphasize   = ''.
      APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'BNFPO'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'BADAT'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'TXZ01'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'MENGE'.
    ls_fieldcat-ref_tabname   = 'ITAB'.
    ls_fieldcat-seltext_l     = 'Quantity'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'PS_PSP_PNR'.
    ls_fieldcat-ref_tabname   = 'EBKN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'BEDNR'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'FRGDT'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'LFDAT'.
    ls_fieldcat-ref_tabname   = 'EBAN'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'EBELN'.
    ls_fieldcat-ref_tabname   = 'EKPO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'EBELP'.
    ls_fieldcat-ref_tabname   = 'EKPO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'AEDAT'.
    ls_fieldcat-ref_tabname   = 'EKKO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'LIFNR'.
    ls_fieldcat-ref_tabname   = 'EKKO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'NAME1'.
    ls_fieldcat-ref_tabname   = 'LFA1'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'IHRAN'.
    ls_fieldcat-ref_tabname   = 'EKKO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'EINDT'.
    ls_fieldcat-ref_tabname   = 'EKET'.
    APPEND ls_fieldcat TO rt_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-tabname       = 'ITAB'.
    ls_fieldcat-fieldname     = 'PLIFZ'.
    ls_fieldcat-ref_tabname   = 'EKPO'.
    APPEND ls_fieldcat TO rt_fieldcat.
    ENDFORM.                    " FIELDCAT_INIT
    *&      Form  selection
          text
    -->  p1        text
    <--  p2        text
    FORM selection .
      SELECT
                lfa1~name1
                eban~banfn
                eban~badat
                eban~bnfpo
                eban~txz01
                eban~menge
                eban~bednr
                eban~frgdt
                eban~lfdat
                ebkn~ps_psp_pnr
                ekko~bwbdt
                ekko~aedat
                ekko~lifnr
                ekko~ihran
                ekpo~ebeln
                ekpo~ebelp
                ekpo~plifz
                eket~eindt
                                    FROM lfa1 INNER JOIN ekko ON ( lfa1lifnr = ekkolifnr )
                                              INNER JOIN ekpo ON ( ekkoebeln = ekpoebeln )
                                              INNER JOIN eket ON ( ekpoebeln = eketebeln
                                                                             AND
                                                                   ekpoebelp = eketebelp )
                                              INNER JOIN eban ON ( ebanbanfn =  eketbanfn
                                                                            AND
                                                                  ebanbnfpo =  eketbnfpo )
                                              INNER JOIN ebkn ON ( ebanbanfn =  ebknbanfn
                                                                                 AND
                                                                  ebanbnfpo =  ebknbnfpo )
                                    INTO TABLE i_final_tab WHERE eban~bednr      IN bednr  AND
                                                           ebkn~ps_psp_pnr IN ps_psp AND
                                                           ebkn~kostl      IN kostl  AND
                                                           ebkn~erdat      IN erdat AND
                                                           ekko~bstyp <> 'F'.
      LOOP AT i_final_tab.
        itab-name1      = i_final_tab-name1.
        itab-banfn      = i_final_tab-banfn.
        itab-badat      = i_final_tab-badat.
        itab-bnfpo      = i_final_tab-bnfpo.
        itab-txz01      = i_final_tab-txz01.
        itab-menge      = i_final_tab-menge.
        itab-bednr      = i_final_tab-bednr.
        itab-frgdt      = i_final_tab-frgdt.
        itab-lfdat      = i_final_tab-lfdat.
        itab-ps_psp_pnr = i_final_tab-ps_psp_pnr.
        itab-aedat      = i_final_tab-aedat.
        itab-lifnr      = i_final_tab-lifnr.
        itab-ihran      = i_final_tab-ihran.
        itab-ebeln      = i_final_tab-ebeln.
        itab-ebelp      = i_final_tab-ebelp.
        itab-plifz      = i_final_tab-plifz.
        itab-eindt      = i_final_tab-eindt.
        APPEND itab.
        CLEAR itab.
      ENDLOOP.
    ENDFORM.                    " selection
    *&      Form  f_event_build
          text
    -->  p1        text
    <--  p2        text
    FORM f_event_build .
      DATA wa_event TYPE slis_alv_event.
      CLEAR: wa_event,
             i_event.
    *read event top-of-page
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = i_event.
      IF sy-subrc <> 0.
      ENDIF.
    *Prepare event table
      READ TABLE i_event WITH KEY name = 'TOP_OF_PAGE' INTO wa_event.
      IF sy-subrc EQ 0.
        MOVE 'TOP_OF_PAGE' TO wa_event-form.
        APPEND wa_event TO i_event.
      ENDIF.
    ENDFORM.                    " f_event_build
    *&      Form  f_comment_build
          text
    -->  p1        text
    <--  p2        text
    FORM f_comment_build .
      DATA: wa_listheader TYPE slis_listheader.
      CLEAR wa_listheader.
      wa_listheader-typ = 'H'.
      wa_listheader-info = 'Tracking Of Quotation For Purchase Requisition'.
      APPEND wa_listheader TO i_listheader.
      CLEAR wa_listheader.
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'SMS-DEMAG Pvt. Ltd.'.
      APPEND wa_listheader TO i_listheader.
      CLEAR wa_listheader.
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'R1- Nehru Enclave'.
      APPEND wa_listheader TO i_listheader.
      CLEAR wa_listheader.
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'New Delhi - '.
      APPEND wa_listheader TO i_listheader.
    ENDFORM.                    " f_comment_build
    *&      Form  f_build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM f_build_layout .
      CLEAR i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-zebra = 'X'.
      i_layout-totals_text = 'Total'.
    ENDFORM.                    " f_build_layout
    *&      Form  f_list_display
          text
    -->  p1        text
    <--  p2        text
    FORM f_list_display .
    *sort itab by name1
                banfn
                badat
                bnfpo
                txz01
                menge
                bednr
                frgdt
                lfdat
                ps_psp_pnr
                bwbdt
                aedat
                lifnr
                ihran
                ebeln
                ebelp
                plifz
                eindt.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = i_layout
          it_fieldcat        = rt_fieldcat
          it_events          = i_event
          it_sort            = l_sort
        TABLES
          t_outtab           = itab.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " f_list_display
    *&      Form  TOP_OF_PAGE
          text
    -->  p1        text
    <--  p2        text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_listheader
          i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  f_event_sort
          text
    -->  p1        text
    <--  p2        text
    FORM f_event_sort .
    wa_sort-spos = 1.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'BANFN'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    CLEAR WA_SORT.
    wa_sort-spos = 5.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'MENGE'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 2.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'BNFPO'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 3.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'BADAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 4.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'TXZ01'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 7.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'BEDNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 6.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'PS_PSP_PNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 8.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'FRGDT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 9.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-fieldname = 'LFDAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 10.
    wa_sort-fieldname = 'EBELN'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 11.
    wa_sort-fieldname = 'EBELP'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 12.
    wa_sort-fieldname = 'AEDAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 13.
    wa_sort-fieldname = 'LIFNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 14.
    wa_sort-fieldname = 'NAME1'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 15.
    wa_sort-fieldname = 'IHRAN'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-up = 'X'.
    wa_sort-tabname = 'i_final_tab'.
    wa_sort-spos = 16.
    wa_sort-fieldname = 'EINDT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    *sort l_sort by spos.
      CLEAR wa_sort.
      wa_sort-spos = 1.
      wa_sort-fieldname = 'BANFN'.
      wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-subtot = ' '.
      APPEND wa_sort TO l_sort.
    wa_sort-spos = 5.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'MENGE'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-spos = 2.
    wa_sort-fieldname = 'BNFPO'.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    wa_sort-spos = 3.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'BADAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 4.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'TXZ01'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 7.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'BEDNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 6.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'PS_PSP_PNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 8.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'FRGDT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    wa_sort-spos = 9.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-fieldname = 'LFDAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 10.
    wa_sort-fieldname = 'EBELN'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 11.
    wa_sort-fieldname = 'EBELP'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 12.
    wa_sort-fieldname = 'AEDAT'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 13.
    wa_sort-fieldname = 'LIFNR'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 14.
    wa_sort-fieldname = 'NAME1'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-down = 'X'.
    wa_sort-tabname = 'itab'.
    wa_sort-spos = 15.
    wa_sort-fieldname = 'IHRAN'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    CLEAR wa_sort.
    wa_sort-spos = 16.
    wa_sort-fieldname = 'EINDT'.
    wa_sort-tabname = 'itab'.
    wa_sort-down = 'X'.
    wa_sort-subtot = ' '.
    APPEND wa_sort TO l_sort.
    *CLEAR WA_SORT.
    *sort l_sort by spos.
    ENDFORM.                    " f_event_sort
    *&      Form  f_validate_sel_screen
          text
    -->  p1        text
    <--  p2        text
    FORM f_validate_sel_screen .
    *Tracking number
      SELECT SINGLE * FROM eban WHERE bednr IN bednr.
      IF sy-subrc NE 0.
        MESSAGE e013.
      ENDIF.
    *Wbs Element
      SELECT SINGLE * FROM ebkn WHERE ps_psp_pnr IN ps_psp.
      IF sy-subrc NE 0.
        MESSAGE e014.
      ENDIF.
    *Cost center
      SELECT SINGLE * FROM ebkn WHERE kostl IN kostl.
      IF sy-subrc NE 0.
        MESSAGE e015.
      ENDIF.
    *Date
      SELECT SINGLE * FROM ebkn WHERE erdat IN erdat.
      IF sy-subrc NE 0.
        MESSAGE e012.
      ENDIF.
    ENDFORM.                    " f_validate_sel_screen

    Hey Ravi,
    As you said it is urgent to deliver the report, i will suggest you temporary solution while i debug the program.
    In the FM "REUSE_ALV_GRID_DISPLAY", use layout to generate your sorted report for now as shown following:
    <b>DATA:   G_VARIANT LIKE DISVARIANT.</b>
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
         I_CALLBACK_PROGRAM = SY-REPID
         IS_LAYOUT = I_LAYOUT
         IT_FIELDCAT = RT_FIELDCAT
         IT_EVENTS = I_EVENT
         IT_SORT = L_SORT
         <b>is_variant = g_variant</b>
      TABLES
         T_OUTTAB = ITAB.
      IF SY-SUBRC <> 0.
      ENDIF.
    Where g_variant is your custom layout which you will make as default for output.
    Hope this helps and let me know if you need more details.
    In the mean time, i will look in to the program.
    Regards,
    Vicky
    PS: Award points if helpful

  • Credit memo print preview problem

    Hi Friends,
    The present process is return sales , in which return sales order created with reference to sales order, Credit memo request created and Credit memo also created.But the problem is not getting print preview.Error message is Excise invoice corresponding to the document type is not found.
    We are generating Excise invoice Automatically, Is there any effect of this on the present issue.Please give some hint.
    Thanks
    Chetan

    Hi,
    See normally we have excise invoice creation automatic when invoice is saved. In such cases we have a check in the print program of invoice, which prevents its printing if excise invoice is not created.
    In case of credit memo, you might not be creating any excise invoice, but the print program attached might be preventing its printing also.
    Check that such a check is given in print program for credit memo output, if yes you may have to remove it.
    Hope this helps you.
    Regards,
    Dhananjay

  • SAP CRM 7.0 Print Preview Functionality.

    Hi,
    We are using the SAP CRM 7.0 system. But i am not able to get the functionality of print preview (webclient) whenever i am trying to print a Application Form that uses an SAPscript.
    Can any one please help me on this issue.
    It seems the system generates the error when "call dialog DISPLAY_OTF".
    I get the following message in my print preview box:
    Remark
    The following error text was processed in the system XXX: Screen output without connection to user.
    The error occurred on the application server and the workflow KSWH739_WBE_34 1.
    Termination type: RABAX_STATE
    ABAP call hierarchy:
    SYSTEM-EXIT program or SAPMSSY0

    I want to print preview an service order true transcation CRM_IU.
    Then logged on to the webclient i open an service order then i click on the print preview button.
    After this is select the option confirmation_letter (this is an application form with sapscript).
    --> when i put breakpoints in the Function module:  DISPLAY_OTF.
    on the following points:
    call function 'WS_QUERY'  --> i get sy-subrc return 1? is this normal for print preview?
    after that the system generates the message when the following is done:
          call dialog 'DISPLAY_OTF'                "ABAP-List-Preview
               exporting otf itcpp 0
               importing itcpp.
    Thankx for your help.

  • How to show print Preview of an file in java

    Hi,
    Suppose i have a file like "bina.xls". Now i want to see the print preview of this file from java code. How is this possible? I s there anybody can help me? now i am in serious trouble with this? I can generate an excel file. But i can not show this file with JExcelApi. i can know that this is possible with jasper report, how this is possible with Jasper Report ? if any one help me with sample code then i will be very gratefull to u . Please help me.
    With Regards
    Bina

    This forum is exclusively for Sun Java Studio Creator. Please post your queries on appropriate forums to have better discussions :
    e.g.
    Java Technology Forums - Java Programming :
    http://forum.java.sun.com/forum.jspa?forumID=31

  • Adobe form is going to Spool directly want a print preview

    HI Experts,
    I have created a class where I am calling a standard Material document print form WOST_WSGM_MATDOC_PDF but it is directly going to spool.
    NOTE : I am calling this class method in one of my POWL Feeder class which is linked with standard GR print application and I want it to be previewed for user to save.
    Please refer the code below.
      DATA iv_funcname TYPE  funcname.
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name              = 'WOST_WSGM_MATDOC_PDF'"gc_mat_doc_form_name
        IMPORTING
          e_funcname          = iv_funcname  .
      DATA iv_outputparams TYPE  sfpoutputparams.
      CALL FUNCTION 'FP_JOB_OPEN'
        CHANGING
          ie_outputparams = iv_outputparams
        EXCEPTIONS
          cancel          = 1
          usage_error     = 2
          system_error    = 3
          internal_error  = 4
          OTHERS          = 5.
      IF sy-subrc <> 0.
    Implement suitable error handling here
      ENDIF.
      DATA fp_docparams TYPE sfpdocparams.
      DATA fp_formoutput TYPE fpformoutput.
    Now call the generated function module
      CALL FUNCTION iv_funcname
        EXPORTING
          /1bcdwb/docparams  = fp_docparams
          mat_doc_header     = es_mkpf
          doc_type_txt       = es_t003t
          vendor_data        = es_lfa1
          plant_data         = es_t001w
          move_plant_data    = es_t001w_move_plant
          mat_doc_item_tab   = et_mseg
          mat_doc_printgrgi  = et_printgrgi
        IMPORTING
          /1bcdwb/formoutput = fp_formoutput
        EXCEPTIONS
          usage_error        = 1
          system_error       = 2
          internal_error     = 3
          OTHERS             = 4.
      IF sy-subrc <> 0.
        CALL FUNCTION 'FP_GET_LAST_ADS_ERRSTR'
          IMPORTING
            e_adserrstr = ls_adserrstr.
      ENDIF.
    Close spool job
      CALL FUNCTION 'FP_JOB_CLOSE'
        EXCEPTIONS
          usage_error    = 1
          system_error   = 2
          internal_error = 3
          OTHERS         = 4.
    When  I am running this class individual then I am getting the print preview but when I am running it through portal by calling it in the feeder class then It is going directly to SPOOL request.

    try passing PREVIEW field  "X" in  FP_JOB_OPEN.
    Uma

Maybe you are looking for

  • Import failure and temporary files

    Hi, I'm trying to import my photos from my iPhone into Aperture using the Import function. During the import process, it creates a temporary file, like "..importing.IMG1721.JPG" onto my photo folder, and then continues to say "Importing" indefinitely

  • Can I clone to an external that has files on it, use it as a startup disk

    I have an external firewire drive but I didn't partition it before I started Time Machine backups on it.  I now need to clone my internal drive to the external and use it as a startup disk.  I'm afraid it won't work if there are other files (LOTS) al

  • POET vs GL Account in AP Invoice Work Bench

    Dear Members, We are on 11.5.10 version of e-business suite. If a User enters an Invoice manually through AP Invoice Work Bench form, he has two methods to enter a GL string at the distribution level. There are two cases here : 1. when we go to the d

  • Aggregation at Query level

    Hi, Does the aggregation at query level will not work in BI7. As i have a key figure with aggregation type summation in backend,there were some similar records when tried to set aggregation at query level it is not working summing the key figures. An

  • Indesign CC startet nicht.

    ERROR Adobe InDesign konnte nicht gestartet werden, da Sie nicht über die erforderlichen Berechtigungen zum Zugriff auf die Voreinstellungsordner verfügen. Stellen Sie sicher, dass Sie über die erforderlichen Berechtigungen verfügen und starten Sie A