Report output getting truncated in email attachment

Hello Gurus,
My requirement is to send a report output as an email attachment.
I have done the coding for this but have a small problem. In the attachment the report is getting truncated after certain length.
Can you advise wats the problem ?
Regards,
Suhas

Hello Guys,
I too was contemplating on those lines. But actually i was calculating the File Size incorrectly.
Changed the code & now it working !!!!!!!
BR,
Suhas

Similar Messages

  • Scheduling a Report to Deliver As an Email Attachment

    Hi,
    I want to schedule a Report to Deliver As an Email Attachment. But I am getting the below error.
    oracle.apps.xdo.service.delivery.DeliveryException: oracle.apps.xdo.delivery.DeliveryException: Exception reading response;
    nested exception is:
         java.net.SocketException: Connection reset
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:235)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1215)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:493)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    In the below link its given to setup the email server (ArGoSoft Mail Server Freeware)
    http://www.oracle.com/technology/obe/obe_bi/bipub/advance/advance.htm
    But I did not do the steps mentioned in the above link. Since I have email server configured on my system.
    I am using the proper Host name and Port. Can you please suggest why I am getting this error.
    Thanks,
    Shiva

    Not really the best way to go.  You'll waste a lot of time and it may not work for your receiver.  Most email hosts have file size limits that make emailing video files a problem.  Better choice is upload you video to YouTube or some other file sharing site then email a link.

  • Send report output(alv display) as email to end user

    I have developed a report the output of which has to be sent to the end user if he enters his email id in selection screen. The out put is in alv form. Pls can anyone tell me how to send this displayed output as an email attachment using function module SO_NEW_DOCUMENT_ATT_SEND_API1 . I am wondering How this displayed output can be passed as a parameter to this function module.

    Thanks Sham..
    I am able to send HTML email following above link.
    The problem i am facing is,When i am deploying the code through crxde.Code is working fine.
    But using maven deploy..Bundle get activated ..But at line:
    messageGateway = this.messageGatewayService.getGateway(HtmlEmail.class);
    ,it gives null Pointer exception.
    Any pointer,why its not working from maven deployment.
    Regards
    Deepika

  • Spool Output getting truncated

    Hi,
        I am using ALV grid display in a report.When we schedule the report in background and check the spool,The output is getting truncated (For eg Customer number is getting truncated ).I have checked the print parameters of background job,The format is passed as 'X_PAPER'.
    Pls suggest.
    Thanks
    Rakesh.

    Hi Rakesh,
    In SM36 during the Job creation Click on Print Specifications , Properties, Double click on Format value and change it to the required width.
    Use transaction SPAD to create width if it isn't available.
    Vijay

  • Report Output get line duplications.

    Hi,
    Oracle report output file getting line duplication. If its 2 line, the o/p get 4 lines. If its 3 lines, the o/p get 9 lines. If its 4 lines, the o/p get 16 lines. How to resolve this issue,
    Regards
    S.Arun

    user10101961 wrote:
    Hi,
    Oracle report output file getting line duplication. If its 2 line, the o/p get 4 lines. If its 3 lines, the o/p get 9 lines. If its 4 lines, the o/p get 16 lines. How to resolve this issue,
    Regards
    S.ArunWhat is the type of this concurrent program?
    Can you post the code here?
    Thanks,
    Hussein

  • Report output as body of email?

    This may be something obvious that I am just missing, but I have several executive summary reports that I just want to output as text in the body of an email, rather than have them have to go to a report viewer or have to open an attachment. Is there a way to do this?

    If on XIR3.x , this can be done with publications. Select mHTML as the format type.
    Regards
    James

  • Convert ABAP Report to HTML & Send External Email Attachment

    Hi,
    I have a requirement described as below. A report is scheduled to run in the background creates a spool, to be converted to HTML format and send to Third Parties (External Email ID's) via Email. Please let me know whether the requirement is not clear. Can you please suggest me a suitable SAP Solution for this requirement?
    Thanks,
    Kannan.SA

    Hi,
    See below simple report to convert the internal table data to a HTML format data and stores in a internal table and then pass that internal table as an attachment to the external email using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    You need for create a spool also.
    REPORT  Z_HTML                                                      .
    include <icon>.
    types: begin of msg,
             type      like icon-id,
             text(140) type c,
           end of msg.
    constants: gc_marked type c value 'X',
               gc_ok     like icon-id  value '@5B@'.
    data:
       gt_msg         type standard table of msg,
       gs_msg         like line of  gt_msg,
       gv_msg(138)    type c,
    *-- html
       html_container type ref to cl_gui_custom_container,
       html_control   type ref to cl_gui_html_viewer,
       my_row_header like w3head   occurs 10 with header line,
       my_fields     like w3fields occurs 10 with header line,
       my_header     like w3head,
       my_html       type standard table of w3html  ,
       ok_code       like sy-ucomm.
      Start of Selection                                              *
    start-of-selection.
        clear gv_msg.
        gv_msg = 'MESSAGES for HTML'.
        do 3 times.
          perform message using  gc_ok gv_msg .
        enddo.
      End of   Selection                                              *
    end-of-selection.
        set screen 0100.
    *&      Form  message
    form message using    p_type
                          p_text.
      clear gs_msg.
      gs_msg-type  = p_type.
      gs_msg-text  = p_text.
      append gs_msg to gt_msg.
    endform.                    " MESSAGE
    *&      Module  STATUS_0100  OUTPUT
    module status_0100 output.
      perform convert_itab_html.
      set titlebar '100' .
      set pf-status 'MAIN100'.
      create object html_container
          exporting
              container_name = 'CONTAINER'.
      create object html_control
           exporting
                parent    = html_container
                saphtmlp  = gc_marked      .
      data: assigned_url type url.
      call method html_control->load_data
    EXPORTING
       URL                  = url
       TYPE                 = 'text'
       SUBTYPE              = 'html'
       SIZE                 = 0
       ENCODING             =
       CHARSET              =
        importing
          assigned_url         = assigned_url
        changing
          data_table           = my_html
    EXCEPTIONS
       DP_INVALID_PARAMETER = 1
       DP_ERROR_GENERAL     = 2
       CNTL_ERROR           = 3
       others               = 4
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      call method html_control->show_url
        exporting
          url                    = assigned_url
       FRAME                  =
       IN_PLACE               = ' X'
    EXCEPTIONS
       CNTL_ERROR             = 1
       CNHT_ERROR_NOT_ALLOWED = 2
       CNHT_ERROR_PARAMETER   = 3
       DP_ERROR_GENERAL       = 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.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  exit  INPUT
    module exit input.
      leave program.
    endmodule.                 " exit  INPUT
    *&      Module  user_command_0100  INPUT
          text
    module user_command_0100 input.
      case ok_code.
        when 'EXIT' or 'BACK'.
          leave program.
        when others.
          call method cl_gui_cfw=>dispatch.
      endcase.
    endmodule.                 " user_command_0100  INPUT
    *&      Form  convert_itab_html
    form convert_itab_html.
      data: lv_tabix like sy-tabix.
    *-- table header
      call function 'WWW_ITAB_TO_HTML_HEADERS'
        exporting
          field_nr = 1
          text     = 'Type'
          fgcolor  = 'navy'
          bgcolor  = 'red'
          font     = 'Arial'
        tables
          header   = my_row_header.
      call function 'WWW_ITAB_TO_HTML_HEADERS'
        exporting
          field_nr = 2
          text     = 'Message'
          fgcolor  = 'navy'
          bgcolor  = 'red'
          font     = 'Arial'
        tables
          header   = my_row_header.
    *-- table rows
      clear lv_tabix.
      loop at gt_msg into gs_msg.
        lv_tabix = sy-tabix.
            call function 'WWW_ITAB_TO_HTML_LAYOUT'
              exporting
                field_nr = 1
                line_nr  = lv_tabix
                icon     = gc_marked
              tables
                fields   = my_fields.
            call function 'WWW_ITAB_TO_HTML_LAYOUT'
              exporting
                field_nr = 2
                line_nr  = lv_tabix
                fgcolor  = 'red'
                bgcolor  = 'black'
                font     = 'Arial'
                size     = '2'
              tables
                fields   = my_fields.
      endloop.
    *-- header
      move 'Messages during program run' to my_header-text.
      move 'Arial'                       to my_header-font.
      move '2'                           to my_header-size.
      move 'Centered'                    to my_header-just.
      move 'red'                         to my_header-bg_color.
      move 'blue'                        to my_header-fg_color.
      refresh my_html.
      call function 'WWW_ITAB_TO_HTML'
       exporting
         table_header = my_header
       all_fields   = ' '
        tables
          html         = my_html
          fields       = my_fields
          row_header   = my_row_header
          itable       = gt_msg.
    endform.                    "convert_itab_html

  • Report output to PDF and email

    Hi
    I have a requirement in which we have to add functionality to convert my ALV report out put into .pdf file and send it to mail as attachement.
    Please let me know how i can add this functionality to my report.

    It is possible to send e-mails of any SAP report in PDF format without changing the existing Program.
    Follow these steps.
    Check SCOT is configured to send mails.
    Execute the RSPO0075 report in SE38 ( Enter Various additional access methods) and create the e-mail method "M".
    Create a new output device in the SPAD transaction and enter PDF1 as the device type and M as the access method. No e-mail is required.
    Thats all. Then, when you want to send any report by e-mail in a PDF format, you should pull up the report to your screen.
    Then go to print, select the output device created before and enter the destination e-mail address. Don't forget to select "print out immediately."
    You also need to be sure to have the RSCONN01 report scheduled to run periodicaly (i.e., every 15 minutes).
    This report is resposible to deliver the SAPconnect objects.
    bye
    anupma

  • Report Output is truncated

    Hello All,
    I have a requirement wherein I am downloading the contents of an internal table from a report program to the application server (AL11) as a file.
    I have written the code as below:
        LOOP AT gt_file INTO gs_file.
          TRANSFER gs_file-content TO lv_filename.
        ENDLOOP.
    where,
    the declaration is as follows:
    TYPES:  BEGIN OF ty_file              ,
                   content TYPE string        ,
                  END OF ty_file                .
    DATA: gt_file   TYPE STANDARD TABLE OF ty_file,
               gs_file   TYPE  ty_file.
    DATA:lv_filename TYPE string .
    The problem is that in the downloaded file, for each record only 512 characters are displayed. The remaining record is truncated.
    Please help.
    I also tried declaring as:
    TYPES:  BEGIN OF ty_file              ,
                   content(5000) TYPE c      ,
                  END OF ty_file                .
    But in vain.
    Thanks,
    Dawood.
    Edited by: Dawood.S.Ghasletwala on Sep 10, 2008 6:47 PM

    yes it will take only 512 charters only, file created on  (al11)application server.
    but u can see full length  .txt file by download from app. server to local system by using CG3Y
    CG3Z
    there is no problem in your program, u can't see more than 512 char length in application server in SAP.
    i have also got this kind of problem.
    In this kind of interface once u create a file on all, the other system will fetch the file from AL11 and do some formating and send the related to the other external system.
    so, in SAP side our work is to create a file all 11, with required format thats it.
    if u want to see whole file check with tcode CG3Y

  • Report output to soppl - pdf- email

    Hi
    i am generating an alv report,
    1 .executing it in the background
    2, convert to pdf
    3,send mail
    my report contains 10 columns but the pdf is showing only 5 columns .
    is it possible to create a landsape so that all the columns will fit into the pdf or is there any other way to solve this?
    <removed_by_moderator>
    thanks
    Ramya
    Edited by: Julius Bussche on Jul 28, 2008 10:56 AM

    Hi,
    Please give correct  columns in your fieldcat.
    eg.
    WA_FIELDCAT-COL_POS = 1.
    WA_FIELDCAT-FIELDNAME = 'WERKS'.
    WA_FIELDCAT-SELTEXT_M = 'PLANT'.
    APPEND WA_FIELDCAT TO T_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-COL_POS = 2.
    WA_FIELDCAT-FIELDNAME = 'LGORT'.
    WA_FIELDCAT-SELTEXT_M = 'STORAGE LOC'.
    APPEND WA_FIELDCAT TO T_FIELDCAT.
    CLEAR WA_FIELDCAT.
    Give all columns value, like above.
    then
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-CPROG
       IT_FIELDCAT                       = T_FIELDCAT
       IT_SORT                           =  T_SORTINFO
      TABLES
        T_OUTTAB                          = T_OUTPUT
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE I005.
    LEAVE LIST-PROCESSING.
    ENDIF.
    Plz try like this.
    Thanking you.
    Subash

  • CiscoWorks: How to receive reports in email attachment?

    Hi,
    Please guide me that how I can get scheduled reports in Campus Manager in email attachment.
    I am unable to receive email for the schedule reports saying error says that unable to connect the smtp on port 25.
    In the location CS->Server->System Preferences Enable E-mail Attachment (Checked)
    I am using;
    RME: 4.3.0
    CM:5.2.1
    Thanks

    try to telnet on the port 25 of the SMTP server and see if you can.
    also you can check the anti-virus and the firewall if it's blocking the connection.
    else you can see the sniffer trace output while the LMs try to send the E-mail
    hope this helps

  • ALV report output to be send to the respective users through email

    Hi Gurus,
    My requirement is to send the ALV report output to the respective users Email ID (Lotus notes) when the report runs in background.
    Could any one suggest me with sample coding, How to send a ALV report output to the respective email ID's ( Suggest me the FM that used to send a internal table)
    Regards
    Paul

    Hi Paul,
      Here for u the sample code:
    <b>call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_txt               = it_message
                receivers                  = it_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.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.</b>
    Hope this helps you.Reply for queries
    Regards,
    Kumar.

  • Email attachment PDF format

    Gurus,
    Can any body logic for the below requirement for my Report. Report is also pasted. Thanks!
    Create a table as given in the requirement
    Table:
    Cleint   Jobname Email ID  Active  Subject Text  Body Text
                                                       SO10           SO10
    ·         The email part should contain the entire log and spool if available.
    ·         Once you have the job list, loop on the list and check if the job is defined in your custom table
    o   If you find an entry then
    §  Read the Job Log and convert it to HTML
    §  Read the spool if available and convert it to pdf
    §  Create an email with
    ·         To: Mail id from your custom table
    ·         Subject [ below: ]
    o   Then write the entire job log.
    o   Give one blank line
    o   If spool list is available the write else write
    o   Give one blank line
    o   Write
    ·         Attachment should contain the PDF attachment of the spool.
    o   If the email fails then Write (donu2019t give message) the Job name and message that email failed.
    o   If you donu2019t find a mail ID for the job Write (donu2019t give message) the Job name and message that email not found.
    ·         Continue to the next Job in your list.
    REPORT ZJOB_MONITORING.
    T A B L E S
    TABLES: tbtco.
    T Y P E - S P O O L S
    TYPE-POOLS: slis.
    T Y P E  D E C L A R A T I O N S
    *TYPES: BEGIN OF type_tbtco,
           include TYPE tbtco,
          END OF type_tbtco.
    TYPES: BEGIN OF type_output,
           STRTTIME TYPE tbtco-STRTTIME,
           strtdate TYPE tbtco-strtdate,
           jobname  TYPE tbtco-jobname,
           line     TYPE string,
           END OF type_output.
    S T R U C T U R E S
    DATA: s_tbtco  TYPE tbtco,
          s_joblog TYPE zsbb_uc4_joblog,
          s_output TYPE type_output.
    I N T E R N A L  T A B L E S
    DATA: i_tbtco  TYPE STANDARD TABLE OF tbtco,
          i_joblog TYPE STANDARD TABLE OF zsbb_uc4_joblog,
          i_output TYPE STANDARD TABLE OF type_output.
    DATA: Begin of itab_jobname OCCURS 0,
          jobname type tbtco-jobname,
          end of itab_jobname.
    DATA: Begin of itab_user OCCURS 0,
          jobname type tbtco-sdluname,
          end of itab_user.
    DATA: Begin of itab_stat OCCURS 0,
          jobname type tbtco-status,
          end of itab_stat.
    DATA: Begin of itab_uzeit occurs 0,
          uzeit type sy-uzeit,
          end of itab_uzeit.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    DATA : t_fieldcat TYPE slis_t_fieldcat_alv.
    S E L E C T I O N  S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_strtda FOR sy-datum,
                    s_lstrun FOR sy-uzeit OBLIGATORY,
                    s_jobnam FOR tbtco-jobname,
                    s_user   FOR tbtco-sdluname,
                    s_status FOR tbtco-status.
    PARAMETERS: p_email AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK bl1.
    "                         AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-LOW.
      PERFORM f4_JOBNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-HIGH.
      PERFORM f4_JOBNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-low.
      PERFORM f4_USER-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-high.
      PERFORM f4_USER-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-low.
      PERFORM f4_STATUS-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-high.
      PERFORM f4_STATUS-HIGH.
    S T A R T  O F  S E L E C T I O N
    START-OF-SELECTION.
      PERFORM select_data.
    If email is checked.
    Send the output table as an email attachment to the distribution list.
    Get the email list from the config table. " ask from where to get it
      IF p_email = 'X'.
    Call FM 'SO_OBJECT_SEND'.
    Fill the fields which are not commented accordingly.
    CALL FUNCTION 'SO_OBJECT_SEND'
       EXPORTING
         OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
         OBJECT_TYPE      = 'RAW'
         OWNER            = SY-UNAME
       TABLES
         OBJCONT          = TEXT
         OBJPARA          = OBJPARA
         RECEIVERS        = RECEIVERS
       EXCEPTIONS
         OTHERS           = 01.
    IF SY-SUBRC NE 0.
       RAISE ERROR.
    ENDIF.
    ENDIF.
    Prepare the ALV Report.
    PERFORM alv_grid_display.
    *&      Form  alv_grid_display
          text
    FORM alv_grid_display .
    alv required data objects.
      DATA: w_repid    TYPE syrepid,
            x_layout   TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
           t_fieldcat TYPE slis_t_fieldcat_alv,
            w_title    TYPE lvc_title,
            w_print    TYPE slis_print_alv,
            w_comm    TYPE slis_formname,
            flag       TYPE c VALUE 'N'.
      REFRESH t_fieldcat.
      REFRESH t_event.
      CLEAR   x_layout.
      CLEAR   w_title.
    Field Catalog
    PERFORM set_fieldcat2 USING:
       1 'strttime'   'BTCXTIME'   space           t_fieldcat ,
       2 'jobname'    'BTCJOB'     space           t_fieldcat ,
       3 'line'        space       'Job Log'       t_fieldcat .
    *PERFORM set_fieldcat2 USING:
       1 'strttime'   'BTCXTIME'   space     'I_OUTPUT'      t_fieldcat ,
       2 'jobname'    'BTCJOB'     space     'I_OUTPUT'      t_fieldcat ,
       3 'line'        space       'Job Log' 'I_OUTPUT'      t_fieldcat .
      PERFORM set_fieldcat.
    Layout
      x_layout-zebra = 'X'.
      x_layout-colwidth_optimize = 'X'.
    GUI Status
      w_repid = sy-repid .
    Top of page heading
    PERFORM set_top_page_heading USING t_heading t_event flag.
    call the FM 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = w_repid
         is_layout                         = x_layout
         it_fieldcat                       = t_fieldcat
        IT_SORT                           =
         i_save                            = 'X'
         it_events                         = t_event
       TABLES
          t_outtab                         = i_output
       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.
      ENDIF.
    ENDFORM.                    " alv_grid_display
    *&      Form  set_top_page_heading
          text
    FORM set_top_page_heading  USING
                               t_heading TYPE slis_t_listheader
                               t_events  TYPE slis_t_event
                               flag      TYPE c.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Job Details'(002).
      APPEND x_heading TO t_heading.
    Name of the report program
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Report ID:'.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.                    " set_top_page_heading
    *&      Form  set_fieldcat2
          text
    FORM set_fieldcat2  USING
                        p_colpos p_fieldname p_ref_fieldname
                        p_seltext_m
                        p_tabname
                        t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
    the ref_fieldname given is a data element.
      IF NOT p_ref_fieldname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      wa_fieldcat-tabname = 'I_OUTPUT'.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                    " set_fieldcat2
    *&      Form  F4_JOBNAM-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_JOBNAM-LOW .
      SELECT jobname FROM tbtco
                  INTO TABLE itab_jobname.
      DELETE ADJACENT DUPLICATES FROM itab_jobname.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield             = 'jobname'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_jobnam-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG               = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_jobname
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_JOBNAM-LOW
    *&      Form  F4_JOBNAM-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_JOBNAM-HIGH .
      SELECT jobname FROM tbtco
                    INTO TABLE itab_jobname.
      DELETE ADJACENT DUPLICATES FROM itab_jobname.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield             = 'jobname'
      PVALKEY                = ' '
         DYNPPROG              = 'sy-repid'
         DYNPNR                = '1000'
         DYNPROFIELD           = 's_jobnam-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG               = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_jobname
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_JOBNAM-HIGH
    *&      Form  F4_USER-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_USER-LOW .
      SELECT sdluname  FROM tbtco
                    INTO TABLE itab_user.
      DELETE ADJACENT DUPLICATES FROM itab_user.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'user'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_user-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_user
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_USER-LOW
    *&      Form  F4_USER-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_USER-HIGH .
      SELECT sdluname  FROM tbtco
                    INTO TABLE itab_user.
      DELETE ADJACENT DUPLICATES FROM itab_user.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'user'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_user-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_user
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_USER-HIGH
    *&      Form  F4_STATUS-LOW
          text
    -->  p1        text
    <--  p2        text
    FORM F4_STATUS-LOW .
      SELECT status  FROM tbtco
                    INTO TABLE itab_stat.
      DELETE ADJACENT DUPLICATES FROM itab_stat.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'status'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_status-low'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab            = itab_stat
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_STATUS-LOW
    *&      Form  F4_STATUS-HIGH
          text
    -->  p1        text
    <--  p2        text
    FORM F4_STATUS-HIGH .
      SELECT status  FROM tbtco
                    INTO TABLE itab_stat.
      DELETE ADJACENT DUPLICATES FROM itab_stat.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
      DDIC_STRUCTURE         = ' '
          retfield               = 'status'
      PVALKEY                = ' '
         DYNPPROG               = 'sy-repid'
         DYNPNR                 = '1000'
         DYNPROFIELD            = 's_status-high'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
      VALUE_ORG              = 'C'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
        tables
          value_tab              = itab_stat
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " F4_STATUS-HIGH
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT_DATA .
    select the entries from the table TBTCO
    as per the selection screen
      SELECT * FROM tbtco
               INTO TABLE i_tbtco
               WHERE STRTTIME IN s_lstrun AND
                     strtdate IN s_strtda AND
                     jobname  IN s_jobnam AND
                     sdluname IN s_user   AND
                     status   IN s_status.
    Get the job details for the above jobs.
      LOOP AT i_tbtco INTO s_tbtco.
        CALL FUNCTION 'ZSBB_UC4_JOB_READ_LOG'
          EXPORTING
            client                = sy-mandt
            jobcount              = s_tbtco-jobcount
            joblog                = s_tbtco-joblog
            jobname               = s_tbtco-jobname
          TABLES
            joblog_tab            = i_joblog
          EXCEPTIONS
            cant_read_joblog      = 1
            jobcount_missing      = 2
            joblog_does_not_exist = 3
            joblog_is_empty       = 4
            joblog_name_missing   = 5
            jobname_missing       = 6
            job_does_not_exist    = 7
            OTHERS                = 8.
    Write the Error handling as needed.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ELSE.
    Append entries to main table.
          s_output-STRTTIME = s_tbtco-STRTTIME.
          s_output-jobname  = s_tbtco-jobname.
          LOOP AT  i_joblog INTO s_joblog.
            s_output-line = s_joblog-text.
            APPEND s_output TO i_output.
            CLEAR s_output.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " SELECT_DATA
    *&      Form  SET_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    form SET_FIELDCAT .
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-fieldname = 'STRTTIME'.
      wa_fieldcat-seltext_m = 'Start Time'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
    wa_fieldcat-reptext = p_reptext.
      APPEND wa_fieldcat to t_fieldcat.
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-fieldname = 'JOBNAME'.
      wa_fieldcat-seltext_m = 'Job Name'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
    wa_fieldcat-reptext = p_reptext.
      APPEND wa_fieldcat to t_fieldcat.
      wa_fieldcat-col_pos = 3.
      wa_fieldcat-fieldname = 'LINE'.
      wa_fieldcat-seltext_m = 'Job Log'.
      wa_fieldcat-tabname = 'I_OUTPUT'.
      APPEND wa_fieldcat to t_fieldcat.
    endform.                    " SET_FIELDCAT
    Edited by: venkata on Aug 12, 2008 4:13 PM

    solved

  • Report ouput details should create an Attachment and it should be trigger i

    Hi,
    The requirement is like this, my Report output details should create an Attachment and it should be trigger in my workflow MailBox.

    Prabhakar,
    Are you asking a question about the SAP Business One Integration Technology for SAP NetWeaver or a question about the SAP Business One SDK.  If you question is with respect to the Business One SDK, please post your question on the SAP Business One Discussion Forum as this forum is for the SAP Business One Integration Technology for SAP NetWeaver.
    If this is a question about the SAP Business One Integration Technology for SAP NetWeaver, can you give a little more detail?
    Thank you,
    Eddy

  • Send Report output as Email attachment (PDF)

    Hi Experts,
      i am trying to send the contents of an internal table from my report as email using PDF attachment. I have coded the logic and i get the attachment in the email. When i try to open the attachement, i cannot open it.
    The message i get is "_Adobe reader could not open the attachment "attach.pdf" because it is either not a supported file type or the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded )._
    Not sure where i went wrong.
      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.                    "send_file_as_email_attachment

    Hello RnB,
    You can check the mentioned link for the same:
    [Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
    Regards,
    Uttam Agrawal

Maybe you are looking for

  • Xrandr and VGA - external display always labelled 'disconnected'

    I have an laptop and a widescreen tv that I wish to use as an external monitor. With recent Xorg updates it's been easier and easier and all I have to do now is plug in the monitor and restart X - no special xorg.conf fixing needed. Except that the t

  • Itunes downloads err time out or network reset...

    Dear Sir, I have 15 available downloads in my Id account. However, all of them can not be downloaded seccuessfully. and it feed back err 408 or err 3253. There were problems downloading some purchased items. For more information on the items that cou

  • Sending DME file to the bank using RFFOUS_T?

    Hi all, I understand that we use RFFOUS_T to create the DME file but do we use the RFFOUS_T to send the generated DME file to the bank as well? I mean the RFFOUS_T is not linked to the banking system right? Is it I should use t-code: FDTA to download

  • Defining SLD Target Systems for DEV, QAS & PRD

    In a 3 tier XI landscape (DEV, QAS, PRD) which of the following two scenarios is best? 1. In the SLD define each DEV Business System with a target of the corresponding QAS Business System and define each QAS Business System with a target of the corre

  • My mac can not open any dmg file, what  can I do?

    My computer can not open any dmg