Problem in report output to ms word

i am using generate to option to convert the oracle report output to rtf format. i am getting the rtf file but the file is not as report all columns were comming one after one means in report
column1 column2 column3
in rtf file
column1
column2
column3 like this
but report is comming fine with pdf and html formats
it is very urget can any one help please
thanks

u can convert report into text file using below parameter setting
first u set report's design in character units to yes
now u set system parameter
DESNAME : path of destination file where u want to create file
DESTYPE: file
MODE :character
and u search dflt.prt file into oracle froms and report's folder
and just change that file and set height and width as per requirement
and now run report
u can get text file output

Similar Messages

  • Converting report output to a word document

    Hi,
    Can anyone pls help me by providing the program for converting displaying/inserting the internal table values along with the table frame aound the internal table(in the sense displaying the rows and columns lines) to the word document not in the excel format, instead of displaying in the report.
    Thanks,
    Ravi

    Hi Ravi,
    see if this helps you in anyway:
    REPORT OUTPUT IN WORD OR EXCEL
    Re: OLE: ms word (Textbox)
    Re: OLE and MS Word
    Create MS-Word document (With format)
    Regards,
    Ravi

  • Problem In report output display when i run in the background

    Hi,
    In a classical report i am printing around 17 fields  the width of the report out put is around 800 characters.
    If i run  the report in the  fore ground it running perfectly. But the thing is when i give large selection is it GETTING ' TIMED OUT ' as it is running more than an Hour.
    so i wanted to run it in the back ground to avoid TIME OUT problems.
    But when i run in the backgroud   i am not getting  full  out put in the SPOOL request(SIZE of the report output may causing the problem) .
    Pls come up with some solutions
    Thanks in advance

    Try increasing the spool length..
    Refer this link for doing so.
    Spool List output display > 255 char when the rpt is run in Background
    Thanks
    mahesh

  • Problem in Report Output ( Batch )

    Hi ,
    We have a batch job ( a report ) that runs everyday , till friday the output in the spool was as expected , we were getting the output of everyline item in the same line ( single line ) but from monday onwards the same report output in the spool is spreading across two lines instead of one single line . It is working fine if we execute the report in foreground but the problem occurs if we do it in background . What could be the problem here ? Can some one pls help some inputs .
    Thanks in Advance

    hi...
    do one thing goto TCODE SM37 and give the name of the job and in command window give value 'JDBG' and execute it ...
    it will be in debug mode and may help to solve ur issue..
    regards

  • XML Report output giving error "word cannot open the file because....

    Hi All,
    Greetings!
    I have a standard report, 'Payables Posted Invoice Register".
    The report was going in to warning beacuse of some Invalid characters in the Data.
    I corrected the invalid characters and then ran the report ; it completed fine.
    But now when I try to open the report output, the output is not getting open but its allowing me to save the file.
    When I save it on my local machine and try to open it, I am getting an error as "word cannot open the file because it is larger than 512 megabytes".
    The document size showing is 664MB when I saved it on my machine. And the output type of the report is RTF and not PDF.
    Can anybody please help?
    Thanks,
    Sachin

    not sure, if the Microsoft word has limitation of file size.

  • Problem with Report Output in Apps R12

    Hi,
    I am having some problems with my report output when run under Apps R12. It looks fine when I run in Reports Developer 10g.
    The problem is that pages get split into two (i think because there are too many rows). So page 1 of the report will be split into two pages in the Apps report output, and the page number (which is normally at the bottom) displays on the second page as "Page 1 of xx".
    I think there is some problem but I don't know what.
    I am running the report as Text Output in apps, and using the default Landwide style (which is 180 col x 66 rows). In my report design, I made the dimensions of the body section to be 180 col x 66 rows as well. I also have it set to 8.5 tall x 14 inches wide.
    Any suggestions?
    Thanks,
    Kevin

    SQL> set long 1000000
    SQL> set heading off
    SQL> column cola format a40000
    SQL> select cola from clob_dummy;
    gfhjtuioep mnhjkie rt-hlospd. ngktio pokdnebtt, gkhohphpdjdbs wmqksxnd - kfnfdkdldkdkdkdkdkdkdkdkdbdsjgdvj h geg.jv ehh  shgghsga wshkwlsgsdklghlahgkh lahgkas lhks  kglaks gksh a
    ssjfsjgskjhghsgskgkksl hgeldhldlkskhdlk dklhkdlkhlkdlhdkfhldkhkhdkhkdhkdhkdkhklhkddkhdkhdkl djhlkdkhdhkshlkd dkhdkhldsjhkslhjd eutywe 398863694 i230e ehgd ehglegighsihdlk eltiweytilhdhgehgisehbkd
    SQL>Edited by: Tubby on Oct 3, 2008 11:44 AM

  • Problem in report output

    Hi,
    i had made a report which displays the changes made to the Purchase Order and when i execute it on the PRD Server it gives the run time error 'EXCEPTION RAISE FOUND'.
    I am using the FM:-
    GET_FIELDNAME_TEXT_1
    I had used this FM in other reports which used to display the changes made to things such as BOM,MATERIAL and they are exceuting fine.but when i use it in this report it gives runtime error on the PRD Server.
    Plaese proivde me guidelines to solve this problem .
    Edited by: ricx .s on Dec 3, 2008 7:11 AM

    HI,
    I had uncommented the exceptions and i am debugging on the DEV Server but i had to tranport it to the PRD Server and generate the request.
    I am using this FM as:-
    IF ITCDPOS-FNAME <> 'KEY'.
        CALL FUNCTION 'GET_FIELDNAME_TEXT_1'
          EXPORTING
           I_AS4LOCAL                = 'A'
           I_AS4VERS                 = '0000'
           I_FIELDNAME               = ITCDPOS-FNAME
           I_TABNAME                 = ITCDPOS-TABNAME
           TABLES
           E_DD03L                   = E_DD03L
           E_DD04V                   = E_DD04V
          EXCEPTIONS
          ERROR_IN_PARAMETERS       = 1
          NOT_FOUND                 = 2
          OTHERS                    = 3.
      ENDIF.
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      CLEAR E_DD04V-DDTEXT.
    ENDIF.

  • REPORT OUTPUT IN WORD OR EXCEL

    Hi,
    I need to convert my report output to word document with a customised logo in the word document. Can anyone please help me out by providing the necessary procedure (step by step process or code in abap).
    Thanks and Regards
    AK

    Hi Ashok ,
    You just copy this Abap code and run it. The output is an excel file .
    REPORT  ZKUN_FILE6                              .
    TABLES: USR03,DD02L.
    DATA: ZX030L LIKE X030L.
    DATA BEGIN OF ZDFIES OCCURS 0.
         INCLUDE STRUCTURE DFIES.
    DATA END OF ZDFIES.
    DATA: BEGIN OF FLDITAB OCCURS 0,
          FLDNAME(11) TYPE C,
          END OF FLDITAB.
    DATA ITABUSR03 LIKE USR03 OCCURS 0 WITH HEADER LINE.
    DATA TNAME LIKE DD02L-TABNAME.
    SELECT * FROM USR03 INTO TABLE ITABUSR03.
    TNAME = 'USR03'.
    PERFORM GETFIELEDS.
    PERFORM SHOW123.
    FORM GETFIELEDS.
         CALL FUNCTION 'GET_FIELDTAB'
          EXPORTING
              LANGU              = SY-LANGU
              ONLY               = SPACE
              TABNAME            = TNAME
              WITHTEXT           = 'X'
          IMPORTING
              HEADER             = ZX030L
          TABLES
              FIELDTAB           = ZDFIES
          EXCEPTIONS
              INTERNAL_ERROR      = 01
              NO_TEXTS_FOUND      = 02
              TABLE_HAS_NO_FIELDS = 03
              TABLE_NOT_ACTIV     = 04.
         CASE SY-SUBRC.
            WHEN 0.
              LOOP AT ZDFIES.
                   FLDITAB-FLDNAME = ZDFIES-FIELDNAME.
                   APPEND FLDITAB.
              ENDLOOP.
            WHEN OTHERS.
                 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  with  SY-SUBRC.
          ENDCASE.
    ENDFORM.
    FORM SHOW123.
    CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
         EXPORTING
              FILE_NAME                 = 'C:\USR03.XLS'
              DATA_SHEET_NAME           = 'USER LIST'
        TABLES
             DATA_TAB                  =  ITABUSR03
             FIELDNAMES                =  FLDITAB
        EXCEPTIONS
             FILE_NOT_EXIST            = 1
             FILENAME_EXPECTED         = 2
             COMMUNICATION_ERROR       = 3
             OLE_OBJECT_METHOD_ERROR   = 4
             OLE_OBJECT_PROPERTY_ERROR = 5
             INVALID_FILENAME          = 6
             INVALID_PIVOT_FIELDS      = 7
             DOWNLOAD_PROBLEM          = 8
             OTHERS                    = 9.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Thanks and Regards,
    Kunal.
    ( hope this solves your problem.)

  • Reports output to word

    Hi friend,
    I have a problem :-
    When I send my output to word for Report its format in number figure gets changed. I have to use New Times Roman Font.
    Regards and waiting early reply.
    ss rawat

    Hi,
    RTF can be edited using MS Word. Maybe the problem you are referring to is that the data is in tabular format, and you need to edit each cell separately.
    Though I haven't tried it, one way of output to MS Word could be to follow this demonstration:
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/excel/index.html
    This demonstration is for MS-Excel, but you might be able to replace the Excel MIME-type (page contentType) to that for Word, and it might work.
    Navneet.

  • Run a report as output format "MS Word" under Crystal Report Server 11 R2

    May I confirm any patches I can download to fix the problem ?
    The problem is if I set the output format as MS Word 2003/2007 instead of crystal report when "Schedule" a report in Crystal Report Server. I found a problem all reports cannot be show on the browser (with error message "Error on page." at the bottom of browser). I need quit the infoview and login again.
    Thanks for your kindly help

    Hello Wallace,
    I recommend to post this query to the [BusinessObjects Enterprise Administration|BI Platform; forum.
    This forum is dedicated to topics related to administration and configuration of BusinessObjects Enterprise, BusinessObjects Edge, and Crystal Reports Server.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all BOE Administration queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Problem in alv report output

    Hi friends,
    i have created alv report .no problem of getting output . but i m getting question mark in the standard menu. it is displaying 10 question mark (sub menu has print preview etc), edit ,question marks(ABC Analysis) ,question marks (abap list viewer etc ), settings ,system , help.
    i don't want these question marks. how to candle this.i haven't moved to test or production , but iwant  to know  in development  why it is coming..
    if any one knows please let me know.
    thanks and regards,
    kani.

    The Problem is with some GUI inconsistency.
    to overcome there are 2 solutions.
    1. You need to run a program Which i don't remember exactly.
    2. Using the Status event.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        it_fieldcat        = it_fieldcat
    I_CALLBACK_PF_STATUS_SET = 'STATUS'  "important
        it_sort            = it_sort
      TABLES
        t_outtab           = it_data
      EXCEPTIONS
        program_error      = 1.
    form status using extab tyoe slis_t_extab.
    "This status you can set using the program SAPLKKBL
    " go to se41 transaction, enter the program name SAPLKKBL
    "status as STANDARD , and click the Button Copy status
    "Now in the popup for Option to enter your program name and
    "press ok, then save and activate the status
    "now come here and activate the code and test now..
    set pf-status 'STANDARD' excluding extab.
    endform.

  • Report Output Saving Problem

    I am using Oracle Developer6.0 . I am facing problem with reports. I am invoking reports from form using run_product.
    1. I could not able to save the report in text file . Whenever i try to save the report output in a text file.It gives dump and application get closed.
    2. In RTF format , it execute the query which i have given at the design time while creating a report . But while running i am passing query either through lexical parameter or passing value of where criteria user parameters. It display the output for the specified value. But when i save this report output in rtf file . It execute design time query and save that in a rtf file.
    If any body is having any idea about it . Please let me ASAP . It is very urgent for me.
    Thanks in advance
    null

    Hi ,
    Why don't you try the output in PDF. Its been working for us. We don't have any problems
    Good Luck
    Rao

  • Problems Exporting Report to Word

    Hi,
    We are using the crystals reports bundled with VS2005 targetting .Net Framework 2.0, for a web based application. On some development PCs(Windows XP Sp3) and some ISS servers(IIS 6.0 and Windows Server 2003 R2(SP2) where the application is hosted we have a problem exporting the report is exported to word (programmatically using eportDocument.ExportToHttpResponse). Export to PDF and Excel on the PCs/server worls fine. This problem happens to all the reports in the system.
    The problem is that the window opens and closes and we don't get to see the word document. But the same report when exported to word from the export option in the Crystal Report viewer, it works fine. Also on two of our Windows 2003 server with SP2 the export to word is working fine.
    Please can you help us resolve this issue.

    Wrong forum.  Please post on the .Net forum.

  • Problem while downloading report output

    Hi friends,
    I want to download the report output to local disk in excel file format. The report is developed using ALV grid display (using type poolSLIS). When I run the report all the values are displaying correctly.
    When I download the same in excel file using spreadsheet/unconverted option, some fields are getting cut. For example Vendor code in report showing as 4060070, but in downloaded file it is showing as 406007 (last character missing.).
    I tried GUI_DOWNLOAD function module(for practice), and it is downloading correct values in excel format.
    The problem occurs for only one column. What will be the problem.
    Is this something system problem or we what else.
    Thank you,
    madan

    Hi,
    Did you set the outlen property for your ALV Grid display?
    Please check this.
    Also, check whether you are exceeding the size for uploading a row in Excel or not.
    Thanks and Best Regards,
    Suresh

  • Problem in converting report output to pdf

    Hi,
    I'm managing to get the spool id and other requirements but could'nt get the output of the program converted to pdf format.When i'm trying to do this i'm getting the pdf format of the functional module which retrievs the header and item records and displays the numbers records in the header and item like for eg. header records 8 and item records 10 this its displaying in the format in which we get our funtional module output when we give some data into it.....
    Can any one please tell me how to solve this for ur information i'm using hierarchail squential report with multiple reports in the same report.............
    for instance i'm using the following coding please find the bug......
    PARAMETER: p_email1 LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_delspl  AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject   LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Write statement to represent report output. Spool request is created
    if write statement is executed in background. This could also be an
    ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      new-page.
      commit work.
      new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
    Alternative way could be to submit another program and store spool
    id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
           to sap-spool
           spool parameters   %_print
           archive parameters %_print
           without spool dynpro
           and return.
    Get spool id from program called above
    IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM convert_spool_to_pdf.
        PERFORM process_email.
        if p_delspl EQ 'X'.
          PERFORM delete_spool.
        endif.
        IF sy-sysid = c_dev.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
          FORM get_job_details                                          *
    FORM get_job_details.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           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.
    ENDFORM.
          FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           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.
      CHECK sy-subrc = 0.
    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.
    ENDFORM.
          FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      CHECK gd_recsize > 0.
      PERFORM send_email USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM send_email USING p_email.
      CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachname'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
          FORM delete_spool                                             *
    FORM delete_spool.
      DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
      ld_spool_nr = gd_spool_nr.
      CHECK p_delspl <> c_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                spoolid = ld_spool_nr.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.

    Please  go throught the code    ... this  is  my salary sending  program to  all the employees   as pdf attach file of his  salary breakup ...... it was  so clear  how the   data  is converted in th  pdf   format   .... and more understanding way the internal tables are declared ....
    DATA W_OPTIONS LIKE ITCPO OCCURS 0 WITH HEADER LINE.
      DATA : z_itcpp LIKE itcpp OCCURS 0 WITH HEADER LINE.
      DATA : otfdt like ITCOO OCCURS 0 WITH HEADER LINE.
      DATA : pdfdt like TLINE OCCURS 0 with header line.
       DATA: NUMBYTES TYPE I.
      DATA: OBJPACK   LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
      DATA: OBJHEAD   LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
      DATA: OBJBIN    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
      DATA: OBJTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
      DATA: RECLIST   LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
      DATA: DOC_CHNG  LIKE SODOCCHGI1.
      DATA: TAB_LINES LIKE SY-TABIX.
      DATA: Begin of i_errors occurs 0,
            type(1) type c,
            descr(100) type c,
           End of i_errors.
        w_options-tdprinter = 'POSTSCPT'.
        W_options-TDRDIDEV = 'XP45'.
        W_options-TDGETOTF = 'X'.
        APPEND W_options.
        call function 'OPEN_FORM'
            exporting
                  device                      = 'PRINTER'
                  dialog                      = ' '
                  form                        = 'ZHRPAYSLIP'
                  language                    =  sy-langu
                  options                     =  w_options
    *      IMPORTING
    *         LANGUAGE                    =
    *         NEW_ARCHIVE_PARAMS          =
    *         RESULT                      =
           exceptions
                 canceled                    = 1
                 device                      = 2
                 form                        = 3
                 options                     = 4
                 unclosed                    = 5
                 mail_options                = 6
                 archive_error               = 7
                 invalid_fax_number          = 8
                 more_params_needed_in_batch = 9
                 others                      = 10 .
    CALL FUNCTION 'CLOSE_FORM'
    *    IMPORTING
    *         RDI_RESULT               =
        TABLES
             OTFDATA                  = otfdt
          EXCEPTIONS
               UNOPENED                 = 1
               BAD_PAGEFORMAT_FOR_PRINT = 2
               SEND_ERROR               = 3
               OTHERS                   = 4.
        EXPORT otfdt TO MEMORY ID 'PDFT'.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
    IMPORTING
       BIN_FILESIZE                = NUMBYTES
    *   BIN_FILE                    =
      TABLES
        otf                         = otfdt
        lines                       = pdfdt
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 4
    *   OTHERS                      = 5
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF .
    Refresh OBJTXT. clear OBJTXT.
      Refresh OBJPACK. clear OBJPACK.
      Refresh objbin. clear objbin.
      Refresh OBJHEAD. clear OBJHEAD.
      Refresh RECLIST. Clear RECLIST.
    * Creation of the document to be sent
    * File Name
      DOC_CHNG-OBJ_NAME = 'PAYSLIP'.
    * Mail Subject
      DOC_CHNG-OBJ_DESCR = 'Payslip'.
    * Mail Contents
      OBJTXT = 'This e-mail was sent from an automated system...'.
      APPEND OBJTXT.
      OBJTXT = 'Do not reply to this message.'.
      APPEND OBJTXT.
      OBJTXT = 'Please open the attachment to view the Payslip'.
      APPEND OBJTXT.
      OBJTXT = ''.
      APPEND OBJTXT.
      if not msgtxt1 is initial.
      OBJTXT = msgtxt1.
      APPEND OBJTXT.
      endif.
      if not msgtxt2 is initial.
      OBJTXT = msgtxt2.
      APPEND OBJTXT.
      endif.
      if not msgtxt3 is initial.
      OBJTXT = msgtxt3.
      APPEND OBJTXT.
      endif.
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    * Creation of the entry for the compressed document
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'RAW'.
      APPEND OBJPACK.
    * Creation of the document attachment
    CALL FUNCTION 'QCE1_CONVERT'
       TABLES
         t_source_tab         = pdfdt
         t_target_tab         = objbin
       EXCEPTIONS
         convert_not_possible = 1
         OTHERS               = 2.
    describe table objbin lines tab_lines.
    OBJHEAD = 'Payslip.PDF'.
    APPEND OBJHEAD.
    ** Creation of the entry for the compressed attachment
      OBJPACK-TRANSF_BIN = 'X'.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM = 1.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM = TAB_LINES.
      OBJPACK-DOC_TYPE = 'PDF'.
      OBJPACK-OBJ_NAME = 'Payslip'.
      OBJPACK-OBJ_DESCR = 'Payslip'.
      OBJPACK-DOC_SIZE = TAB_LINES * 255.
      APPEND OBJPACK.
    * Completing the recipient list
    *  Read table i_pa0105 with key pernr = pernr-pernr binary search.
      loop at i_pa0105 where pernr = pernr-pernr and USRTY = '0010'.
      endloop.
      if sy-subrc = 0.
          RECLIST-RECEIVER = i_pa0105-USRID_LONG.
          RECLIST-REC_TYPE = 'U'.
          APPEND RECLIST.
      endif.
      if RECLIST[] is initial.
          loop at i_pa0105 where pernr = pernr-pernr and USRTY = 'MAIL'.
          endloop.
          if sy-subrc = 0.
              RECLIST-RECEIVER = i_pa0105-USRID.
              RECLIST-REC_TYPE = 'U'.
              APPEND RECLIST.
          endif.
      endif.
       if not RECLIST[] is initial.
    * Sending the document
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
           DOCUMENT_DATA = DOC_CHNG
           PUT_IN_OUTBOX = ''
           COMMIT_WORK = 'X'
        TABLES
           PACKING_LIST = OBJPACK
           OBJECT_HEADER = OBJHEAD
           CONTENTS_BIN = OBJBIN
           CONTENTS_TXT = OBJTXT
           RECEIVERS = RECLIST
        EXCEPTIONS
           TOO_MANY_RECEIVERS = 1
           DOCUMENT_NOT_SENT = 2
           OPERATION_NO_AUTHORIZATION = 4
        OTHERS = 99.
        CASE SY-SUBRC.
           WHEN 0.
                   LOOP AT RECLIST.
    *                   Concatenate pernr-pernr '-'  RECLIST-RECEIVER(48)
    into error1.
                       IF RECLIST-RETRN_CODE = 0.
    *                     Concatenate error1 ': The document was sent' into
    error1.
                         i_errors-descr = pernr-pernr.
                         i_errors-type = 'S'.
                         append i_errors.
                       ELSE.
                         Concatenate error1 ': The document could not be
    sent' into error1.
                         i_errors-descr = error1.
                         i_errors-type = 'E'.
                         append i_errors.
                       ENDIF.
                   ENDLOOP.
            WHEN 1.
               Concatenate pernr-pernr '-'  RECLIST-RECEIVER(48) into
    error1.
               Concatenate error1 ': No authorization for sending to the
    recipients' into error1.
               i_errors-descr = error1.
               i_errors-type = 'E'.
               append i_errors.
            WHEN 2.
               Concatenate pernr-pernr '-'  RECLIST-RECEIVER(48) into
    error1.
               Concatenate error1 ': Document could not be sent to the
    recipient' into error1.
               i_errors-descr = error1.
               i_errors-type = 'E'.
               append i_errors.
            WHEN 4.
               Concatenate pernr-pernr '-'  RECLIST-RECEIVER(48) into
    error1.
               Concatenate error1 ': No send authorization' into error1.
               i_errors-descr = error1.
               i_errors-type = 'E'.
               append i_errors.
            WHEN OTHERS.
               Concatenate pernr-pernr '-'  RECLIST-RECEIVER(48) into
    error1.
               Concatenate error1 ': Error occurred while sending' into
    error1.
               i_errors-descr = error1.
               i_errors-type = 'E'.
               append i_errors.
        ENDCASE.
      else.
        error1 = pernr-pernr.
    *    Concatenate error1 ': Maintain Infotype 0105.' into error1.
        i_errors-descr = error1.
        i_errors-type = 'M'.
        append i_errors.
      endif.
    girish

Maybe you are looking for