ALV Grid to PDF File

I know the FM  - CONVERT_ABAPSPOOLJOB_2_PDF  will convert ALV to PDF but i am not clear with input paramters need to pass to this function module. How to get spool request number. Kinldy give me an example how to convert my current alv output to PDF format file.

Hello,
Please check this sample report:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Problem in mailing smartforms output using so_new_document_send_API1
How to email a smartform?
http://www.sapgenie.com/abap/example_code.htm
Vasanth

Similar Messages

  • Converting ALV grid into PDF file

    Hi,
    I have searched for a way to convert my ALV output into a PDF file, and then e-mail it, but I haven't succeeded in using what I found so far:
    CONVERT_OTFSPOOLJOB_2_PDF - I don't want it to work only when I run the report in the background.
    CONVERT_OTF - I don't have a sapscript input to provide the function with.
    What are the options available for me? I am forced to use any of these alternatives, eventually ?
    Thanks
    Avraham

    Hello,
    You can make use of the param IS_PRINT. But if you read the long text, it will create the spool but not display the ALV.
    A small code snippet for your ready reference:
    TYPE-POOLS slis.
    DATA: itab TYPE STANDARD TABLE OF t001,
          v_repid TYPE sy-repid,
          st_print TYPE slis_print_alv,
          v_spono TYPE rspoid.
    v_repid = sy-repid.
    st_print-print = 'X'. "Will create a spool req. but not diplay the ALV
    SELECT * FROM t001 INTO TABLE itab UP TO 20 ROWS.
    IF sy-subrc = 0.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = v_repid
          i_structure_name   = 'T001'
          is_print           = st_print
        TABLES
          t_outtab           = itab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc = 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        v_spono = sy-msgv1. "You have the Spool No., create the PDF :-)
        CLEAR st_print.
    *   As the previous call will not display ALV, call the FM again
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = v_repid
            i_structure_name   = 'T001'
            is_print           = st_print
          TABLES
            t_outtab           = itab
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
        IF sy-subrc = 0.
    *   So Nothing
        ENDIF.
      ENDIF.
    ENDIF.

  • Download from ALV grid to PDF format

    hai Friends!
       plz tell me how can i download from ALV grid to PDF format..
    send me some sample codes

    check this thread
    ALV Grid to PDF
    and do use the search functionality from next time and post the question only wheb u dont find the answer
    кu03B1ятu03B9к

  • How to download the blocked ALV output to PDF file.

    How to download the blocked ALV output to PDF file.
    I am able to download the BLocked ALV output in PDF format,
    but the each bolck in ALV is displaying different pages of PDF.
    In my report I have 4 block in 1 page, I am able to see the output in PDF but in different page.
    How to avoid the Page-break in PDF.
    Thanks,
    Ravi Yasoda.

    hi,
    I believe that your have 4 containers on the screen with individual ALV display. in this case, there is no way to get combined PDF output to my knowledge.
    However you can use Smartform/Sapscript as output which would allow you to display ALV in blocks and also print it in one.
    Regards,
    Nirmal

  • Runtime Error during export ALV Grid to Local File and Print Priview

    Hi all,
             While Exporting ALV grid to local file using menu List->export->local file , I m getting following runtime error,
             Field Symbol has not yet been assigned.
    Details of Errors:
    Program : SAPLKKBL
    Include :   LKKBLF99
    Module Type : (FORM)
    module name : GEN_FIELD_OUT2
    So. pls Suggest any good solution.
    Thanks & Regards,
    Sandip Sonar.

    hi
    this is happening just because you might have declared that your ALV list should have a checkbox, but defined no field as "checkbox" into your internal table.
    and one more thing to check up is that before you call the REUSE_ALV_GRID_DISPLAY, you need to fill a few parameters for instance is_layout. This one has a field box_fieldname, in which you have to enter the name of the field of the internal table that will store the 'X' as and when the checkbox is checked.
    hope this helps
    regards
    Aakash Banga

  • Export alv grid to local file

    Hi all,
             I m displaying records using ALV Grid , I want to export that ALV Grid to Local File ,
    using Menu->List->Export->Local File.
           I m able to export it in spreadsheet using option List-> Export->Spreadsheet, but while exporting to local file i m getting short dump with error  *Field Symbol Has not yet been Assigned*.
    Pls, Suggest any good Solution.
       Thanks & Regards ,
      Sandip Sonar.

    hi,,,,
    In your output are there any empty Columns, Because field Symbol Not assigned generally occurs if any one of your Internal table column is Blank, Just remove that Blank Column and then try it.
    Thanks
    Saurabh

  • Convert ALV output to PDF file , DXF and DWG format

    hi,
        How to convert a ALV report to PDF file, DXF and DWG format, I developed a ALV report which has to be converted as per the selections of above formats,
    Reward points for good & with example answers
    Thanks in advance
    RK

    Hello RK,
       Check this link. It has an example code for PDF Conversion.
    http://www.erpgenie.com/abap/code/abap51.htm
    Regards,
    Deepu.k

  • How to download a Block List based ALV report to PDF file?

    Hi Everyone,
    I need to display a report in block list alv format using REUSE_ALV_BLOCK_LIST_DISPLAY... I have done this. But my problem comes next.
    1. I need to download this report to a pdf file in the user given directory - in presentation server. How can I download this in PDF format.
    2. My report has TOP_OF_LIST and END_OF_LIST events. The body of the report contains a table with some material data. There should be 1 table for each material no. There are around 50 records for each material no. So I am looping at the material no. and calling REUSE_ALV_BLOCK_LIST_APPEND.
    Now my problem is that I should have only 20 records in each page. How can I determine this? How do I put a page-break?
    Please anyone help me.

    Hi Anwesha
    You can send the report output to spool using the IS_PRINT parameter of REUSE_ALV_BLOCK_LIST_DISPLAY FM. Then read the spool number generated and pass it to CONVERT_ABAPSPOOLJOB_2_PDF to get the pdf content which could be downloaded to presentation server.
    The splitting of records on count could be done by calling above method with different internal table filtered as per your requirement.
    Regards
    Ranganath

  • To convert ALV Grid to PDF format

    Hi Experts,
    We have a requirement where in the output in ALV grid display should be downloaded to PDF format.
    We came across two processes.
    1. To download the output  to Smartform and then convert to PDF format
    2. To send the ALV output directly to spool and then convert it to PDF
    Please let me know which of the above two gives better performance and also please guide me through the process.

    HI Mallika,
       Both the ways are feasible. For conversion of ALV to PDF,
    1. Display ALV output as usual using factory method .
    2. Create a Button 'Download to PDF' in the GUI status
    3. Set the Sy-batch as 'X'.
    4. Call the Factory method for list display
    5. Catch the sy-spono
    6. Use the FM CONVERT_ABAPSPOOLJOB_2_PDF  to convert alv data to PDF.
    7. Use the FM GUI_DOWNLOAD  to dowload the above PDF file

  • ALV GRID SPOOL PDF EMAIL

    Hello,
    I'm getting frustrated with a ALV issue.
    My report creates a ALV grid which I'm able to print to spool, afterwards create a PDF and finally send to a specific email adress with the PDF attached.
    What I'm wondering is, why when calling 'REUSE_ALV_GRID_DISPLAY' I'm getting this print parameter dialog.
    Moreover calling function 'SET_PRINT_PARAMETERS' has no effect to the parameters showing in the dialog?!
    As I finally want to run this report within a scheduled job I do not want that popup.
    I now read the forum entires for half a day, tried almost everything, but without success.
    Maybe someone can help with my code?
    * Declaration section
    DATA: itab_feldkatalog   TYPE   slis_t_fieldcat_alv,
          wa_feldkatalog     TYPE   line of slis_t_fieldcat_alv,
          gs_layout          TYPE   slis_layout_alv,
          gs_print           TYPE   SLIS_PRINT_ALV.
    *   output as PDF eMail
        g_repid = sy-repid.
        CALL FUNCTION 'SET_PRINT_PARAMETERS'
          EXPORTING
    *        destination   = 'LOCL'      " Printer
            layout        = 'X_65_200'  " Format
            line_count    = '65'        " Line Count
            line_size     = '200'       " Line Size
            in_parameters = gs_print-print_ctrl-pri_params.
    *   Print parameters
        gs_print-print              = 'X'.
        gs_print-prnt_title         = 'X'.
        gs_print-no_coverpage       = 'X'.
        gs_print-no_print_listinfos = 'X'. 
        gs_print-no_print_selinfos = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program     = g_repid
            i_callback_top_of_page = 'TOP_OF_PAGE_SETUP'     
            I_GRID_TITLE           = 'Risk MM Report'
            I_SAVE                 = 'A'
            IT_FIELDCAT            = itab_feldkatalog
            is_layout              = gs_layout
            IS_VARIANT             = is_variant
            IS_PRINT               = gs_print
          TABLES
            T_OUTTAB               = t_inv_cond.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        perform pdf_email.  " create PDF and send by email
    Thanks a lot!

    Thanks for your help.
    This modifications solved my problem!
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            immediately            = ' '
            line_size              = 220
            release                = 'X'
            mode                   = 'CURRENT'
            no_dialog              = 'X'
          IMPORTING
            out_parameters         = gs_print-print_ctrl-pri_params
            valid                  = gv_valid
          EXCEPTIONS
            archive_info_not_found = 1
            invalid_print_params   = 2
            invalid_archive_params = 3
            OTHERS                 = 4.
        NEW-PAGE PRINT ON PARAMETERS gs_print-print_ctrl-pri_params NO DIALOG.
    *   Print parameters
        gs_print-print              = 'X'.
        gs_print-prnt_title         = 'X'.
        gs_print-no_coverpage       = 'X'.
        gs_print-no_print_listinfos = 'X'.  " display no listinfos
        gs_print-no_print_selinfos  = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program     = g_repid
            i_callback_top_of_page = 'TOP_OF_PAGE_SETUP'       " Ref. to form
            I_GRID_TITLE           = 'Risk MM Report'
            I_SAVE                 = 'A'
            IT_FIELDCAT            = itab_feldkatalog
            is_layout              = gs_layout
            IS_VARIANT             = is_variant
            IS_PRINT               = gs_print
          TABLES
            T_OUTTAB               = t_inv_cond.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        NEW-PAGE PRINT OFF.

  • Saving ALV Grid to Local File issue - Missing half of the report

    Hi Experts, Good Day.
    I have developed an ALV Grid report using class CL_SALV_TABLE which displays 200 Columns and 100+ rows/records. It is displaying well, but when I am saving the output into local file (any type) there only 98 columns are downloading and remaining all the columns are missing.
    I would like to know whether there is any restriction for number of columns or what might the problem for it. How can I download all the columns into local file.
    Thanks in Adv.
    Vijay

    Hi,
    Thanks for your response. Even though there are multiple ways to send data to local file I believe all three are same. And even I am facing same issue all the ways. Only 98 Columns data is getting downloaded into Files (it might be .txt, .xls, etc.).
    After downloading first 98 Columns, I am hiding the downloaded columns and again I am downloading remaining columns. Then I am merging in the Excel file. This is very complicated for the End-User. So, please help me out.
    I have used only following methods for displaying ALV.
    For initial object/instance:
    CL_SALV_TABLE=>FACTORY,
    For ALV functions:
    CL_SAVL_TABLE->GET_FUNCTIONS,
    CL_SALV_FUNCTIONS_LIST->SET_ALL,
    For Column heading and Optimized width:
    CL_SALV_TABLE->GET_COLUMNS,
    CL_SALV_COLUMNS_TABLE->SET_OPTIMIZE,
    CL_SALV_COLUMNS_TABLE->GET_COLUMN,
    CL_SALV_COLUMN->SET_SHORT_TEXT,
    To display grid:
    CL_SALV_TABLE->DISPALY.
    - Thanks
    Vijay

  • Export Grid to PDF file In windows Store app using Xaml and C#

    I am working on windows store and have multiple data field  which I have to export to PDF  file 
    In wpf  project i easily export gridview data to pdf file but need help to do same thing in windows metro app.
    Thanks in Advance

    There is no in-box PDF writing API. You will need to find a third party component. If you search the forum there are several threads (as recent as yesterday) with discussing this with component suggestions.

  • Download to Excel file from ALV Grid

    Hi,
    I'm having a problem in downloading ALV Grid to excel file. The problem are the numbers are not in float format. I want them all in float format. Numbers in thousands are formatted with comma and decimals but numbers less than thousands are not in decimals.
    Ex:
    5 should be 5.00.
    In ALV, this number is being displayed as 5.00 but when downloaded it displayed as 5 only.

    Did you mention the INTTYPE and Decimals in the fieldcatalog for those fields.
    INTTYPE = 'P'.
    DECIMALS_OUT = '3'.
    try this..
    also
    use the Option
    short cut CTRLSHFTF9 option
    Local File->Spreadsheet->  and save it to excel file.

  • Error while opening a pdf file sent as an attachment in mail

    Dear All,
            We have converted a alv grid into pdf and sent a mail with the attached pdf file. When the attachment is opened in the received mail we get an error " File does not begin with %pdf-". I am pasting the code.
    Select single
      from
        TSP01
      where
        RQIDENT = wa_listident.
      if sy-subrc <> 0.
         exit.
      endif.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
    *BREAK-POINT.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  AUTHORITY     = 'SP01'
                  CLIENT        = client
                  NAME          = name
                  PART          = 1
             IMPORTING
              CHARCO        =
              CREATER       =
              CREDATE       =
              DELDATE       =
              MAX_CREDATE   =
              MAX_DELDATE   =
              NON_UNIQ      =
              NOOF_PARTS    =
              RECTYP        =
              SIZE          =
              STOTYP        =
                  TYPE          = type
                  OBJTYPE       = objtype
             EXCEPTIONS
                  FB_ERROR      = 1
                  FB_RSTS_OTHER = 2
                  NO_OBJECT     = 3
                  NO_PERMISSION = 4.
      if objtype(3) = 'OTF'.
        is_otf = 'X'.
      else.
        is_otf = space.
      endif.
    *BREAK-POINT.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
             EXPORTING
                  rqident              = wa_listident
                  desired_type         = desired_type
             IMPORTING
                  real_type            = real_type
             TABLES
                  buffer               = l_objcont
             EXCEPTIONS
                  no_such_job          = 14
                  type_no_match        = 94
                  job_contains_no_data = 54
                  no_permission        = 21
                  can_not_access       = 21
                  read_error           = 54.
        IF sy-subrc EQ 0.
          attach_type = real_type.
        ENDIF.
    if is_otf = 'X'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = wa_listident
              NO_DIALOG                      = c_no
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              PDF_BYTECOUNT                  =  gd_bytecount
              PDF_SPOOLID                    = pdfspoolid
          OTF_PAGECOUNT                  =
              BTC_JOBNAME                    = jobname
              BTC_JOBCOUNT                   = jobcount
            TABLES
              PDF                            = it_pdf_output
            EXCEPTIONS
              ERR_NO_OTF_SPOOLJOB            = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DSTDEVICE              = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
      CHECK sy-subrc = 0.
      ENDIF.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Please guide me to resolve this issue.
    Thanks & Regards,
    Anand

    Hi,
    is the next part of the code correct.
    What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
    You can also try below link..
    Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
    Hope this helps.
    Regards,
    -Sandeep

  • Custom F4 for a field in ALV GRID

    I am want to provide a custom f4 fro a field in alv gird
    similiar to the functionality of process on value request
    on a normal screen

    Hi Kaushik
    You can find some information at page 37 of the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
    *--Serdar

Maybe you are looking for