Converting to PDF in landscape format

Hello Friends ,
I am doing an ALV grid report which needs to be sent to users Lotus Notes Inbox. I was successful in converting the report to PDF format and sending it to the inbox.
The problem is that report has 15 columns . All these 15 columns are displayed in the PDF format but they are minimized . I need to zoom 200% to see all the columns .
Is there a way it can be printed in Landscape format ??
Any suggestions ?
Here are the function modules i have used .
CONVERT_ABAPSPOOLJOB_2_PDF
Z_CONVERT_PDF_TO_MAIL_ATTACH.
Please let me know .
Thanks

Hi,
Check this code , we can re-format the data after getting data from FM : CONVERT_OTFSPOOLJOB_2_PDF
*& Report  Y_SPOOL_TO_PDF                                             *
REPORT  y_spool_to_pdf                         .
      CLASS lcl_pdf_demo_event_receiver DEFINITION
CLASS lcl_pdf_demo_event_receiver DEFINITION.
  PUBLIC SECTION.
    DATA:
      entry_field1(100) TYPE c,
      entry_field2(100) TYPE c.
    METHODS:
      on_document_saved
        FOR EVENT document_saved OF cl_gui_pdfviewer
          IMPORTING file_path,
      on_viewing_finished
        FOR EVENT document_closing OF cl_gui_pdfviewer.
ENDCLASS.                    "lcl_pdf_demo_event_receiver DEFINITION
      CLASS lcl_pdf_demo_event_receiver IMPLEMENTATION
CLASS lcl_pdf_demo_event_receiver IMPLEMENTATION.
  METHOD on_document_saved.
    entry_field1 = 'Document Saved'.
    entry_field2 = file_path.
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = 'EVENT'.
  ENDMETHOD.                    "on_document_saved
  METHOD on_viewing_finished.
    entry_field1 = 'Viewing Finished'.
    entry_field2 = space.
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = 'EVENT'.
  ENDMETHOD.                    "on_viewing_finished
ENDCLASS.                    "lcl_pdf_demo_event_receiver IMPLEMENTATION
DATA : l_lines       TYPE i,
         l_temp(500)   TYPE c,
         l_offset      TYPE p,
         l_lineslen(2) TYPE p,
         l_mimelen(2)  TYPE p,
         l_tabix       LIKE sy-tabix,
         l_bytecount  TYPE i,
         l_size TYPE i.
DATA: it_pdf       LIKE tline OCCURS 10 WITH HEADER LINE,
      xi_pdf       LIKE tline OCCURS 0 WITH HEADER LINE,
      html         LIKE solisti1   OCCURS 0  WITH HEADER LINE,
      xi_temp      LIKE bapiqcmime OCCURS 0 WITH HEADER LINE,
      xi_mime(255) TYPE c OCCURS 0 WITH HEADER LINE,
       lt_doc  TYPE TABLE OF docs.
DATA : url TYPE char255.
DATA: my_pdf_viewer     TYPE REF TO cl_gui_pdfviewer,
       my_main_container TYPE REF TO cl_gui_custom_container,
       entry1(100) TYPE c,
       entry2(100) TYPE c.
DATA: okcode TYPE sy-ucomm.
DATA: l_event_receiver TYPE REF TO lcl_pdf_demo_event_receiver.
PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:\temp\file.pdf'."#EC NOTEXT
PARAMETERS : p_spool LIKE tsp01-rqident OBLIGATORY.
START-OF-SELECTION.
*-Convert OTF Spool to PDF
if x_temp = ''.
  CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
      src_spoolid              = p_spool
      no_dialog                = ' '
    IMPORTING
      pdf_bytecount            = l_bytecount
    TABLES
      pdf                      = it_pdf
    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.
  IF sy-subrc = 0.
    xi_pdf[] = it_pdf[].
  ELSE.
    xi_pdf[] = it_pdf[].
  ENDIF.
else.
   CALL FUNCTION 'CONVERT_OTF_2_PDF'
     IMPORTING
       bin_filesize           = l_size
     TABLES
       OTF                    = it_otf
       DOCTAB_ARCHIVE         = lt_doc
       LINES                  = it_pdf
     EXCEPTIONS
       ERR_CONV_NOT_POSSIBLE  = 1
       ERR_OTF_MC_NOENDMARKER = 2
       OTHERS                 = 3.
   IF SY-SUBRC <> 0.
     v_retcode = 1.
     perform protocol_update. exit.
   else.
     xi_pdf[] = it_pdf[].
   endif.
endif.
-Reformat the line to 255 characters wide (code from SAP)
  CLEAR: l_temp, l_offset, xi_temp.
  DESCRIBE TABLE xi_pdf   LINES  l_lines.
  DESCRIBE FIELD xi_pdf   LENGTH l_lineslen IN CHARACTER MODE.
  DESCRIBE FIELD xi_temp  LENGTH l_mimelen IN CHARACTER MODE.
<b>  LOOP AT xi_pdf.
    l_tabix = sy-tabix.
    MOVE xi_pdf TO l_temp+l_offset.
    IF l_tabix = l_lines.
      l_lineslen = STRLEN( xi_pdf ).
    ENDIF.
    l_offset = l_offset + l_lineslen.
    IF l_offset GE l_mimelen.
      CLEAR xi_temp.
      xi_temp = l_temp(l_mimelen).
      APPEND xi_temp.
      SHIFT l_temp BY l_mimelen PLACES.
      l_offset = l_offset - l_mimelen.
    ENDIF.
    IF l_tabix = l_lines.
      IF l_offset GT 0.
        CLEAR xi_temp.
        xi_temp = l_temp(l_offset).
        APPEND xi_temp.
      ENDIF.
    ENDIF.
  ENDLOOP.</b>
  LOOP AT xi_temp.
    xi_mime(255) = xi_temp-line.
    APPEND xi_mime.
  ENDLOOP.
-Final Data
  html[] = xi_mime[].
  DATA : cancel.
  PERFORM download_w_ext(rstxpdft) TABLES html[]
                                   USING p_file
                                         '.pdf'
                                         'BIN'
                                         l_bytecount
                                         cancel.
  CALL SCREEN 100.
*-Save spool in application server as pdf file
open dataset p_file for output.
if sy-subrc = 0.
   loop at html.
     transfer html to p_file.
     if sy-subrc <> 0.
       v_retcode = 1.
       perform protocol_update.
     endif.
   endloop.
   close dataset p_file.
   if sy-subrc <> 0.
     v_retcode = 1.
     perform protocol_update.
   endif.
   it_command_files = p_file.
   append it_command_files.
   clear it_command_files.
else.
   v_retcode = 1.
   perform protocol_update.
endif.
*&      Module  STATUS_0100  OUTPUT
      text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
  IF my_main_container IS INITIAL.
    CREATE OBJECT my_main_container
      EXPORTING
        container_name = 'CUSTOM_CNTL'
      EXCEPTIONS
        cntl_error     = 1
        OTHERS         = 2.
    IF sy-subrc <> 0.
      EXIT.
    ELSE.
      CREATE OBJECT my_pdf_viewer
        EXPORTING
          parent              = my_main_container
        EXCEPTIONS
          cntl_error          = 1
          cntl_system_error   = 2
          OTHERS              = 3.
      IF sy-subrc <> 0.
        "could not create PDF Viewer
      ENDIF.
    ENDIF.
    DATA: view_buttons_active TYPE char01.
    IF my_pdf_viewer->acrobat_vs_reader = ''.
      view_buttons_active = 'X'.
    ENDIF.
   CALL METHOD my_pdf_viewer->create_toolbar
     EXPORTING
       tool_buttons      = 'X'
       view_buttons      = view_buttons_active
     EXCEPTIONS
       cntl_error        = 1
       cntl_system_error = 2
       OTHERS            = 3.
   IF sy-subrc <> 0.
     "could not create toolbar
   ENDIF.
    CREATE OBJECT l_event_receiver.
    SET HANDLER l_event_receiver->on_document_saved FOR my_pdf_viewer.
    SET HANDLER l_event_receiver->on_viewing_finished FOR my_pdf_viewer.
   IF NOT my_pdf_viewer->html_viewer IS INITIAL.
      url = p_file.
      CALL METHOD my_pdf_viewer->open_document
        EXPORTING
          url = url.
   ENDIF.
  ENDIF.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
      text
MODULE user_command_0100 INPUT.
  LEAVE TO SCREEN 0.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
Regards
Appana

Similar Messages

  • Word I convert a PDF to WORD format. I have signed up to Export PDF but everytime I try to covert all it asks is that I sign in again and I cant get past it.

    convert a PDF to WORD format. I have signed up to Export PDF but every time I try to covert all it asks is that I sign in again and I cant get past ti and the covert button is not available.anyone else having this problem or know how to fix it.

    Hi bouerbird,
    I just l looked at your account using the same email address that you use here in the forums, and don't see any order history for you. Is it possible that you signed up using a different email address?
    Best,
    Sara

  • PDF in Landscape format

    Hi,
    ESS is displaying a smartform as PDF.
    The smartform is generated in landscape format.
    And this is rendered in portal as PDF in portrait format.
    Do we have any way to render the PDF in landscape format?
    Regards,
    Nagaraju Donikena.

    Changing the attributes can solve this problem.
    We did the changes in R/3 to solve this issue.
    --Nagaraju Donikena

  • How can we create a plugin for Acrobat reader to convert a Pdf to Excel format?

    Hi all,
    I need to convert a pdf to excel format ! is it possible by a plugin in acrobat reader.
    I know that it can be done with Acrobat Professional and i have to do the same with the Acrobat Reader?
    Does the Acrobat Reader support file conversion plugins?
    Sreejesh K V

    Hi,
    I don't know if Reader supports the onversion but you can easily check that : open an Excel file with Reader and check the result.
    With Acrobat Pro when you open a document using Acrobat then it's automatically converted. If this functionality is supported with Reader you will have the same behavior.
    Once it's supported you just have to open your document using Acrobat.exe (or Reader.Exe)
    My mistake I understood the opposite. To check that Acrobat Reader support the conversion you just have to check in the Reader interface.
    Regards,
    Joe

  • How to bulk convert from PDF to other formats (HTML, Word, etc)?

    I how to convert files into PDFs using "Batch Create Multiple Files," but I want to do the reverse; that is, export multiple PDF files into non-PDF formats. How can I accomplish this?

    Hi adamjazz,
    Gilad D is correct. And here is some information that might help: PDF task automation, Action Wizard | Adobe Acrobat XI
    Best,
    Sara

  • Can the online PDF converter convert secure PDFs to Word format?

    I have a PDF with copy protection set. Will the online PDF converter still convert it to Word format?

    Amplifying George's reply:
    Will Adobe ExportPDF convert any type of PDF file?
    Adobe ExportPDF will convert the vast majority of PDF files available today, including PDF files containing scanned documents.
    There are a few types of PDF files that cannot be converted, however.
    These include, but are not limited to,
    PDF Portfolios,
    PDF files that require a password to open the document, or
    PDF files that have permissions applied to prevent copying, or altering of the content.
    ExportPDF is also not capable of converting hand-written documents to Microsoft Office, due to the non-standard nature of each individual's handwriting.
    http://forums.adobe.com/docs/DOC-1515 
    Be well...

  • Convert to PDF in landscape orientation

    Hi experts !
    I´m using the CONVERT_ABAPSPOOLJOB_2_PDF function to convert a txt into PDF, but i have not found, how to convert this
    in landscape orientation, anybody can help me, pls.
    Thanks in advanced !

    Hi,
    I never face this problem.
    While searching i find some help for you.
    Please visit this link. This link may contains solution for your problem.
    Re: Downloading converted PDF file - output is truncated
    May this helps you.
    Regards.
    Deepak Sharma.

  • Convert from PDF to doc format

    Try to convert IRS Form 1099 to document format getting error that file cannot be converted please help.

    Hi wlunchmeat,
    IRS form 1099 is created with the help of LC Designer which is used to create the XFA(XML Form Architecture). ExportPDF would not be able to convert these kind of forms as it tends loose the important data from the form.
    Regards,
    ~Pranav

  • How to use VBA in Excel to convert a pdf file to XML?

    Hello,
        I need to convert pdf to XML format so that it can be imported into Excel workbook and the information can be extracting out and mapped to existing excel cells. What is the easiest way to get it down without introduce any additional tools/software
    other than Microsoft products? Client want to keep their process simple and it will be used for many agents in remote locations. They mentioned that they want to use VBA to do it. I could not find much useful information on this. Thanks a lot!
    Wei

    No Office programs can open a pdf and edit the contents so you will have to get a different app to convert teh pdf into xls format. There are plenty to be found on the web.
    Rod Gill
    The one and only Project VBA Book
    Rod Gill Project Management

  • When converting a document to PDF, it won't convert my landscape format !

    In Microsoft, when I convert a document that's in landscape format to a PDF, it converts in portrait format.  In the PDF I open print, select orientation and/or page setup, change the format but all the text does'nt change back to landscape.  How do I get my original format when converting to a PDF ?

    This isn't the proper forum for that. This is for the free Reader application which does not convert files to PDF.
    Depending on what you actually use to convert to PDF, you may need a Microsoft forum or the Adobe Acrobat forum.

  • PDF Landscape Format

    Friends,
    I have a program which writes a report. Since this is scheduled in the background, a spool is created. I am converting this spool into a PDF (function module CONVERT_ABAPSPOOLJOB_2_PDF) and sending this PDF as a mail attachment (function module SO_DOCUMENT_SEND_API1). The PDF which I am getting is in portrait format.
    Can I get a PDF which is in Landscape format?
    I tried customising function module CONVERT_ABAPSPOOLJOB_2_PDF and changing the standard layout from 'X_65_80' to 'X_90_120' but the PDF output is still portrait.
    Please suggest a solution.
    Warm Regards,
    Sagar Satalkar

    hai Mr.Sagar,
    if it's possible means can u send me your code..to my personal ID (for this code)
    [email protected]
    (for smartform and abap editor program samrt styles)
    thanks,
    sn

  • ALV output converted into PDF format and send that PDF to user through mail

    Hi Experts,
    I have report earlier its output was in alv grid.
    Now i want that ALV output converted into PDF format.And that PDF output send to user through mail.
    Can u please tell how to do?
    My code is here(output is displaying in ALV grid).
    INCLUDE <icon>.
    TYPE-POOLS: slis, kkblo.
    TABLES : zmsd_freight_hdr, zmsd_freight_det, zmsd_blinfo, zmsd_diheader.
    TABLES : lfa1.
    DATA : t_hdr   LIKE   zmsd_freight_hdr   OCCURS 0 WITH HEADER LINE,
           T_DET   LIKE   ZMSD_FREIGHT_DET   OCCURS 0 WITH HEADER LINE,
           t_bl    LIKE   zmsd_blinfo        OCCURS 0 WITH HEADER LINE,
           t_di    LIKE   zmsd_diheader      OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_det OCCURS 0.
            INCLUDE STRUCTURE zmsd_freight_det.
    DATA    type(30).
    DATA: END OF t_det.
    DATA: v_target2(30),
          v_zsammg LIKE t_det-zsammg,
          v_gsttotal LIKE t_det-zamount.
    DATA : BEGIN OF t_data OCCURS 0,
             zsammg       LIKE  zmsd_freight_hdr-zsammg,
             zdidbl       LIKE  zmsd_freight_hdr-zdidbl,
             zvkorg       LIKE  zmsd_freight_hdr-zvkorg,
             zinvno       LIKE  zmsd_freight_hdr-zinvno,
             zttlamt      LIKE  zmsd_freight_hdr-zttlamt,
             zstatus      LIKE  zmsd_freight_hdr-zstatus,
             ztype        LIKE  zmsd_freight_hdr-ztype,
             zconfirm     LIKE  zmsd_freight_hdr-zconfirm,
             zconfirmdate LIKE  zmsd_freight_hdr-zconfirmdate,
             erdat        LIKE  zmsd_freight_hdr-erdat,
             ernam        LIKE  zmsd_freight_hdr-ernam,
             erzet        LIKE  zmsd_freight_hdr-erzet,
             aedat(10),
             aenam        LIKE  zmsd_freight_hdr-aenam,
             aezet        LIKE  zmsd_freight_hdr-aezet,
             zline        LIKE  zmsd_freight_det-zline,
             zfptype      LIKE  zmsd_freight_det-zfptype,
             zchrcode     LIKE  zmsd_freight_det-zchrcode,
             zcurcode     LIKE  zmsd_freight_det-zcurcode,
             zqty         LIKE  zmsd_freight_det-zqty,
             zuom         LIKE  zmsd_freight_det-zuom,
             zrate        LIKE  zmsd_freight_det-zrate,
             zamount      LIKE  zmsd_freight_det-zamount,
             zexrate      LIKE  zmsd_freight_det-zexrate,
           zccode       LIKE  zmsd_blinfo-zccode,      "MADK991565
             zccode       like  ZMSD_FREIGHT_HDR-zfcode, "MADK991565
             zbldate(10),
             zbl          LIKE  zmsd_blinfo-zbl,
             type(3),
             waerk        LIKE  zmsd_freight_det-zcurcode,
             zamountl     LIKE  zmsd_freight_det-zamount,
           END OF t_data.
    DATA : w_layout      TYPE   slis_layout_alv,
           w_catalog     TYPE   slis_fieldcat_alv,
           t_catalog     TYPE   slis_t_fieldcat_alv,
           w_sort        TYPE   slis_sortinfo_alv,
           t_sort        TYPE   slis_t_sortinfo_alv.
    DATA   V_ZINVNO    like   T_HDR-ZINVNO.                   "MADK991565
    DATA : v_count  TYPE  i.
    SELECTION-SCREEN BEGIN OF BLOCK a0 WITH FRAME TITLE text-001.
    PARAMETERS     :  p_zvkorg LIKE zmsd_freight_hdr-zvkorg  OBLIGATORY .
    SELECT-OPTIONS :  s_zdidbl FOR  zmsd_freight_hdr-zdidbl             ,
                      s_zccode FOR  lfa1-lifnr                          ,
                      s_status FOR  zmsd_freight_hdr-zstatus            ,
                      s_ztype  FOR  zmsd_freight_hdr-ztype              ,
                      s_erdat  FOR  zmsd_freight_hdr-erdat              ,
                      s_ernam  FOR  zmsd_freight_hdr-ernam              ,
                      s_zconfd FOR  zmsd_freight_hdr-zconfirmdate       .
    PARAMETERS     :  p_zconf  AS   CHECKBOX                            .
    SELECTION-SCREEN END OF BLOCK a0.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-002.
    PARAMETERS     :  p_hdr    RADIOBUTTON GROUP rad DEFAULT 'X'        ,
                      p_det    RADIOBUTTON GROUP rad                    .
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM process.
      PERFORM display.
    END-OF-SELECTION.
      PERFORM fm_get_num_pages.
    AT USER-COMMAND.
    AT LINE-SELECTION.
    TOP-OF-PAGE.
      PERFORM fm_top_of_page USING '7010' sy-title space.
    FORM get_data.
      SELECT   *
        FROM   zmsd_freight_hdr
        INTO   TABLE t_hdr
       WHERE   zvkorg        EQ  p_zvkorg
         AND   zdidbl        IN  s_zdidbl
         AND   zstatus       IN  s_status
         AND   ztype         IN  s_ztype
         AND   erdat         IN  s_erdat
         AND   ernam         IN  s_ernam
         AND   zconfirmdate  IN  s_zconfd
         AND   ZFCODE        IN  S_ZCCODE.                      "MADK991565
      IF p_zconf = 'X'.
        DELETE t_hdr WHERE zconfirm NE 'C'.
      ENDIF.
      CHECK NOT t_hdr[] IS INITIAL.
      SELECT   *
        FROM   zmsd_blinfo
        INTO   TABLE t_bl
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_bl BY zsammg.
      SELECT   *
        FROM   zmsd_diheader
        INTO   TABLE t_di
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_di BY zsammg.
    IF P_DET = 'X'. "MADK933361
      SELECT   *
        FROM   zmsd_freight_det
        INTO   TABLE t_det
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg  =  t_hdr-zsammg
       AND ZINVNO =  T_HDR-ZINVNO .                           "MADK991565
    SORT t_det BY zsammg zline.                            "MADK991565
       SORT T_DET BY ZSAMMG ZINVNO ZLINE.                     "MADK991565
    ENDIF. "MADK933361
    ENDFORM.
    FORM process.
      REFRESH t_data.
      CLEAR v_gsttotal.                                         "MADK933361
      LOOP AT t_hdr.
    Start of MADK933361
        CLEAR: v_target2.
        v_zsammg = t_hdr-zsammg.
        V_ZINVNO = T_HDR-ZINVNO.                                "MADK991565
       AT NEW zsammg.                                         "MADK991565
         AT NEW ZINVNO.                                         "MADK991565
          PERFORM get_gst_value.
        ENDAT.
    End of MADK933361
        PERFORM move_header.
        CHECK t_data-zccode IN s_zccode.
        IF p_det = 'X'.
    CSF Project Changes Starts   DEV34    MADK985782
        LOOP AT T_DET WHERE ZSAMMG = T_HDR-ZSAMMG..
          LOOP AT t_det WHERE zsammg = t_hdr-zsammg AND
                              zinvno = t_hdr-zinvno.
    CSF Project Changes Ends     DEV34    MADK985782
            PERFORM move_header.
            CHECK t_data-zccode IN s_zccode.
            MOVE-CORRESPONDING t_det TO t_data.
            t_data-zamountl = t_data-zamount * t_data-zexrate.
            APPEND t_data.
            CLEAR t_data.
          ENDLOOP.
        ELSE.
          APPEND t_data.
          CLEAR t_data.
        ENDIF.
        AT END OF zsammg.
          CLEAR v_gsttotal.
        ENDAT.
    *Start of changes for  IS090901289-PIA MADK991565
        AT END OF ZINVNO.
          CLEAR V_GSTTOTAL.
        ENDAT.
    *End of changes for  IS090901289-PIA MADK991565
      ENDLOOP.
    ENDFORM.
    FORM move_header.
      MOVE-CORRESPONDING t_hdr TO t_data.
      t_data-zttlamt = t_data-zttlamt + v_gsttotal.             "MADK933361
      t_data-waerk = 'SGD'.
      IF NOT t_hdr-aedat IS INITIAL.
        WRITE: t_hdr-aedat TO t_data-aedat.
      ELSE.
        CLEAR : t_data-aedat.
      ENDIF.
      READ TABLE t_bl WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
      IF sy-subrc EQ 0.
      t_data-zccode  = t_bl-zccode.   "MADK991565
        T_DATA-ZCCODE = T_HDR-ZFCODE.   "MADK991565     
        IF NOT t_bl-zbldate IS INITIAL.
          WRITE: t_bl-zbldate TO t_data-zbldate.
        ENDIF.
        t_data-zbl     = t_bl-zbl.
        t_data-type    = 'DBL'.
      ELSE.
        READ TABLE t_di WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
        IF sy-subrc EQ 0.
        t_data-zccode  = t_di-zdiforcode.     "MADK991565
          T_DATA-ZCCODE = T_HDR-ZFCODE.         "MADK991565
          t_data-type    = 'DI'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM display.
      IF t_data[] IS INITIAL.
        MESSAGE s398(00) WITH 'No Data Selected'.
        EXIT.
      ENDIF.
      DATA : l_repid LIKE sy-repid.
      l_repid = sy-repid.
      REFRESH t_catalog.
      CLEAR   t_catalog.
      w_layout-cell_merge = 'X'.
      PERFORM map_fields.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = l_repid
                i_callback_user_command = 'ALV_USER_COMMAND'
                is_layout               = w_layout
                it_fieldcat             = t_catalog[]
                i_grid_title            = sy-title
                i_save                  = 'A'
                it_sort                 = t_sort[]
           TABLES
                t_outtab                = t_data
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
    FORM map_fields.
    Sort Order
      CLEAR v_count.
      PERFORM sf USING 'ZDIDBL'   'X'  'X'.
    Fields to be displayed
      CLEAR v_count.
      IF p_hdr = 'X'.
        PERFORM af USING :
       DESCRIPTION       FIELD        LEN   RTABLE             RFIELD
        'DI/DBL         ' 'ZDIDBL'     '14' '                ' '        ',
        'Type           ' 'TYPE'       '04' '                ' '        ',
        'Forwarder Code ' 'ZCCODE'     '14' '                ' '        ',
        'BL Number      ' 'ZBL'        '14' '                ' '        ',
        'BL Date        ' 'ZBLDATE'    '10' '                ' '        ',
        'Invoice Number ' 'ZINVNO'     '15' '                ' '        ',
        'Extraction     ' 'ZSTATUS'    '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type   ' 'ZTYPE'      '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation   ' 'ZCONFIRM'   '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date   ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount   ' 'ZTTLAMT'    '18' '                ' '        ',
        'Created On     ' 'ERDAT'      '10' '                ' '        ',
        'Created By     ' 'ERNAM'      '10' '                ' '        ',
        'Changed On     ' 'AEDAT'      '10' '                ' '        ',
        'Changed By     ' 'AENAM'      '10' '                ' '        '.
      ELSE.
        PERFORM af USING :
       DESCRIPTION         FIELD     LEN   RTABLE             RFIELD
        'DI/DBL           ' 'ZDIDBL'   '14' '                ' '        ',
        'Type             ' 'TYPE'     '04' '                ' '        ',
        'Forwarder Code   ' 'ZCCODE'   '14' '                ' '        ',
        'BL Number        ' 'ZBL'      '14' '                ' '        ',
        'BL Date          ' 'ZBLDATE'  '10' '                ' '        ',
        'Invoice Number   ' 'ZINVNO'   '15' '                ' '        ',
        'Extraction       ' 'ZSTATUS'  '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type     ' 'ZTYPE'    '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation     ' 'ZCONFIRM' '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date     ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount     ' 'ZTTLAMT'  '18' '                ' '        ',
        'Freight Payment  ' 'ZFPTYPE'  '14' '                ' '        ',
        'Charge Code      ' 'ZCHRCODE' '10' '                ' '        ',
        'Currency         ' 'ZCURCODE' '08' '                ' '        ',
        'Quantity         ' 'ZQTY'     '13' '                ' '        ',
        'UoM              ' 'ZUOM'     '04' '                ' '        ',
        'Rate             ' 'ZRATE'    '15' '                ' '        ',
        'Amt(Foreign Curr)' 'ZAMOUNT'  '16' '                ' '        ',
        'Exchange Rate    ' 'ZEXRATE'  '13' '                ' '        ',
        'Amt(Local Curr)  ' 'ZAMOUNTL' '16' '                ' '        ',
        'Created On       ' 'ERDAT'    '10' '                ' '        ',
        'Created By       ' 'ERNAM'    '10' '                ' '        ',
        'Changed On       ' 'AEDAT'    '10' '                ' '        ',
        'Changed By       ' 'AENAM'    '10' '                ' '        '.
      ENDIF.
    ENDFORM.
    FORM af USING text
                  field
                  len
                  table
                  reffield.
      v_count = v_count + 1.
      w_catalog-col_pos       = v_count.
      w_catalog-fieldname     = field.
      w_catalog-ref_tabname   = table.
      w_catalog-ref_fieldname = reffield.
      w_catalog-seltext_s     = text.
      w_catalog-seltext_m     = text.
      w_catalog-seltext_l     = text.
      w_catalog-outputlen     = len.
      IF field = 'ZTTLAMT' OR field = 'ZAMOUNTL'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'WAERK'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
    IF FIELD = 'ZRATE' OR FIELD = 'ZAMOUNT'.
      IF field = 'ZAMOUNT'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'ZCURCODE'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
      IF field = 'ZQTY' OR field = 'ZRATE'.
        w_catalog-no_zero     = 'X'.
        w_catalog-datatype  =  'DEC'.
      ENDIF.
      APPEND w_catalog TO t_catalog.
      CLEAR  w_catalog.
    ENDFORM.
    FORM sf    USING   fieldname  sortup  group.
      v_count = v_count + 1.
      CLEAR w_sort.
      w_sort-fieldname = fieldname.
      w_sort-spos      = v_count.
      w_sort-up        = sortup.
      w_sort-group     = group.
      APPEND w_sort TO t_sort.
    ENDFORM.
    FORM alv_user_command USING  in_ucomm    LIKE sy-ucomm
                                 in_selfield TYPE slis_selfield.
      DATA: lfs_data LIKE t_data.
      IF in_ucomm = '&IC1'.
        READ TABLE t_data INDEX in_selfield-tabindex INTO lfs_data.
        CHECK NOT lfs_data-zdidbl IS INITIAL.
        IF lfs_data-type = 'DBL'.
          DATA: l_zdbl LIKE zmsd_diheader-zdinum.
          l_zdbl = in_selfield-value.
          EXPORT l_zdbl TO MEMORY ID 'VBL'.
          CALL TRANSACTION 'ZMSD_BL01'.
        ENDIF.
        IF lfs_data-type = 'DI'.
          DATA: v_dinum LIKE zmsd_diheader-zdinum.
          v_dinum = in_selfield-value.
          EXPORT v_dinum TO MEMORY ID 'VDI'.
          CALL TRANSACTION 'ZMSD_DI01'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM get_gst_value.
      LOOP AT t_det WHERE zsammg = v_zsammg
         AND ZINVNO = V_ZINVNO.                              "MADK991565
        CHECK t_data-zccode IN s_zccode.
        t_det-zamount  = t_det-zamount * t_det-zexrate.
        SELECT SINGLE  y0mmtarget2
                INTO   v_target2
                FROM   y0mmipstranslate
                WHERE  y0mmdatatype = '70' AND
                       y0mmsource = t_det-zchrcode.
        SELECT SINGLE y0mmtarget1
               INTO   t_det-type
               FROM   y0mmipstranslate
               WHERE  y0mmdatatype = '76' AND
                      y0mmsource = v_target2.
        IF t_det-type NE '3Z'.
          v_gsttotal    = v_gsttotal +
                               ( t_det-zamount * 5 / 100 ).
        ENDIF.
      ENDLOOP.
    Regards,
    Raj.

    Hello,
    Following is the procedure to convert alv output to spool and then it to PDF Format.
    After we display the ALV, we can check whether it is running in the background using system field u2018sy-batchu2018. Then,we call an function module named u2018GET_JOB_RUNTIME_INFOu2019 to get the current job information. Then go to spool request table tbtcp to get the spool id.
    Get current job details
      CALL FUNCTION u2018GET_JOB_RUNTIME_INFOu2019
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                               AND jobcount = gd_jobcount
                               AND stepcount = gd_stepcount
                               AND listident <> u20180000000000u2032
                               ORDER BY   jobname
                                                   jobcount
                                                   stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    Finally, we can call function module u2018CONVERT_ABAPSPOOLJOB_2_PDFu2018 to convert spool reqeust(which is stored in OTF format) to PDF format. Then we can call either function module u2018SO_DOCUMENT_SEND_API1u2032 or SAP BCS (Business Communication Service) to send the pdf as an email attachment.
    CALL FUNCTION u2018CONVERT_ABAPSPOOLJOB_2_PDFu2019
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount = gd_bytecount
           TABLES
                pdf = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 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
                OTHERS                   = 12.
    Regards,
    Sayali
    Edited by: Sayali Paradkar on Apr 20, 2010 12:51 PM

  • How to convert a pdf file into RTF format or Doc Format

    Hello
    I need to convert a pdf file into a rtf file or doc file.
    But i need to do this with a command line or with the api of acrobat.
    My version is adobe acrobat 9 standard.
    Is it possible to do this?
    So i see there's a convert pdf online.
    Is it possible to use this whith a web service?
    The final file (RTF or doc) must be analyse into an application
    Best regards

    Look at the doc.saveAs JavaScript method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.524.html
    You can save to other formats when you include the corresponding cConvID parameter. It can be used in a batch sequence, but you'll need the Pro version for that.

  • Converting a PDF file to Word format issue

    I am using Adobe Reader XI 11.0.09 with the paid side bar to convert the pdf file to an editable Word 2007 format. The problem is that the formatting after conversion is really bad and getting worse, example of the most recient: "I n  a cont ingent circumstance, an effect  results  from  clearly definable causes, t hough t he effect could be  different, given an entirel y  possible and  different interrelation of  causes. In   short, a  contingent  event   or thi ng is a nonnecessa ry event or thi ng tha t either might  not  exist or could  be other than it is."
    The conversion in the past was never this bad and I was hoping it was some setting but I have not found a way to tweak the settings in the converter. I have converted many pdf files and had no problems with the outcome of the conversion until recently.
    Any help in this matter would be greatly appreciated.
    Ken
    Windows 7 professional

    Moved to Adobe ExportPDF (read only)

  • Converting a pdf-document in a tiff-formatted document

    Hello,
    I have created an interactive form in web-dynpro.
    Now I want to convert the pdf document with the  user filled-in data into a document with tiff-format.
    But I´don´t know how.
    Can you help me?
    Best regards
    Oliver

    You can potentially use the Adobe bean library with the Batik.jar file to convert the PDF to TIFF or any other image format.
    The Adobe bean library is available from
    <a href="http://www.adobe.com/products/acrviewer/acrvdnld.html?name=Accept">Adobe</a>
    Batik is avaiable from <a href="http://xmlgraphics.apache.org/batik/">Batik</a>

Maybe you are looking for

  • Memory upgrade on new macbook pro without Retina display?

    Hello, I was wondering if the memory on the new macbook pro's without the retina display be upgraded still or is it soldered on? Thanks,

  • Attachment button disabled

    Hi, The attachment icon in our custom screen is disabled since we upgraded from 11.5.10 to 12.1.3. It was working fine before the upgrade. All the standard Oracle forms have the icon enabled. I did verfiy the document categories, assignments etc. Is

  • Images in Tilelist not actual size

    I am pulling urls from my database and having them and a small caption populate a tilelist. The images vary in size and I am wanting them to show up their actual size and will have 1 row in the TileList and just scroll horizontally to view the images

  • How to map

    Hi, if i am mapping from db2 to 11i ..i want ot understand how to work with the API(hrms) in 11i ..i have the db2 table definitions and have to map to the interface tables and API's in 11i to import the data to 11i ... thanx to you all..... venu

  • ITunes 9.2 and PDFs

    One of the main things I am excited about the 9.2 update is the fact that I can sync PDFs with my iPad and (future) iPhone 4. I already purchased multiple books through the iBookstore, but have quite a few PDFs that I already added to my iTunes libra