Report output as an attachment in.XLS format via email.

Hi all,
When i run my report in back ground, my alv report output is to be sent as an email attachment in excel (.XLS) format. The issue i am facing is that i have around 40 fields in the output and i need to create a Header line with the Field Description in the Excel file. I am using the FM 'SO_DOCUMENT_SEND_API1', and passing the  report output in to the table CONTENTS_BIN     LIKE     SOLISTI1 which is of Char 255. but my report output header is exceeding that length.
Kindly suggest me on how to acheive this.
Regards,
Jose

Hi Jose,
As for your first question you may place cl_abap_char_utilities=>horizontal_tab between contetaned fields' values. It will place then a tab mark between each two fields, which will be considered by excel as new column.
Using cl_abap_char_utilities=>newline is also correct. I will probably only result in one extra line at the end as after you append your last line to BIN table, also newline will be placed. cl_abap_char_utilities=>lf on the other hand should be placed in front of each line as this denotes Carriage Return so it simply means: "place the cursor at the beginning of each line just before writing this line".
Regards
Marcin

Similar Messages

  • Sending a smartform output as an attachment in RTF format via E-mail

    Hi all,
         I have a scenario in which the output displayed using smartforms is to be sent as a e-mail attachment. Also, the attachment should be a word doc(RTF format). Can you please me with this.
    Warm Regards,
    Abhijeet

    HI,
    See the call to function 'LF_FM_NAME' in standard print program <b>RLB_INVOICE</b>. Notice the preceding call to function WFMC_PREPARE_SMART_FORM? This function does the heavy lifting for you; here, no additional work is needed in either the form or the print program. To generate e-mail output.
    See the below link
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
    Thanks
    Sudheer

  • Convert the spool to xls format and email through attachment to the user

    Hi all,
    When I execute a report in background, I get spool. I need to convert the spool to xls format and email through attachment to the user.The xls file should not be saved on local system.
    If I use the Spool Recepient tab in SM37 it mails the spool list as .txt file to the mail receipient. But I need to send it as an .xls file.
    Can any one help me on this

    Did you get the solution? i have the same problem.

  • My e-mail attachment in xls format appears on PC's as infected and I'm unable to open it. What can I do?, My e-mail attachment in xls format appears on PC's as infected and I'm unable to open it. What can I do?

    My e-mail attachment in xls format appears on PC's as infected and I'm unable to open it. What can I do?, My e-mail attachment in xls format appears on PC's as infected and I'm unable to open it. What can I do?

    What does it have to do in iPad forum?

  • How to save current output page as pdf or xls format?

    hello expert,
    i have  make 2D line graph . now i am trying to save current output page as pdf or xls format.
    how can i do this?
    please reply soon
    thanks in advance

    I have a similar problem with Firefox on android. When saving a page as PDF, often the PDF page size isn't big enough and just shows part of the full web page. Is there any way to set the PDF page size and make it bigger,say A4 or some other size?

  • Send report output as pdf attachment (without collecting spool )

    I used to do this requirement by collecting the spool and then convert it to pdf. But in this case we should use the report output ( NOT FROM SPOOL )  and convert it to PDF and send it as email attachment.
    Please help.
    Thanks!

    Hi,
    I can think of these options. Please explore on the possibilities.
    1) Create one MAIN Report , which will submit your report. Get the List output from memory. Convert the Data to PDF and send the PDF as attachment in mail.
    2)  Create a smartform which will be called in your report. Convert the returned data to PDF and then send the PDF as attachment in mail.
    3) Create one MAIN Report , which will submit your report thorugh a JOB. Wait for the JOB to be completed. Convert the ABAP Spool data to PDF and send the PDF as attachment in mail.
    Regards,
    Abhishek

  • Sending attached pdf format via email

    Hi,
    i got one requirement. i have one program. When i execute the program it has to send the
    Employee1, Employee2,employee3 data to Manager1 email id via email. The employee1, employee2, employee3 data should be stored in one folder and send it via email. I can send it individually like employee1 data manager1,again employee2 data to manager1 and again employee3 data to manager1.
    But what i want is i have to store all these three pdf data  in one folder and send at one time.
    similarly i have manager2,manager3...under managers some employess are there?
    is it possible? if yes, could you please help me in this regard? Thanks in advance.

    HI,
    Please find below sample code..it may help you..but you need to do bit modification
    DATA : LS_DOCDATA LIKE SODOCCHGI1,
             LT_DOCDATA TYPE STANDARD TABLE OF SODOCCHGI1,        " Table for subject
             LS_CONTENTS_MSG LIKE SOLISTI1,
             LT_CONTENTS_MSG TYPE STANDARD TABLE OF SOLISTI1,     " table for attachement
             LS_PACKING_LIST LIKE SOPCKLSTI1,
             LT_PACKING_LIST TYPE STANDARD TABLE OF SOPCKLSTI1,   " Table for Document type and length
             LS_OBJECT_HEADER LIKE SOLISTI1,
             LT_OBJECT_HEADER TYPE STANDARD TABLE OF SOLISTI1,     " Table for Header
             LS_CONTENTS_TXT LIKE SOLISTI1,
             LT_CONTENTS_TXT TYPE STANDARD TABLE OF SOLISTI1,      " Table for mail contents
             LS_RECEIVERS LIKE SOMLRECI1,
             LT_RECEIVERS TYPE STANDARD TABLE OF SOMLRECI1,        " Table for receiver,
    Subject line
      LS_DOCDATA-OBJ_LANGU = sy-langu.
      LS_DOCDATA-OBJ_NAME = text-002.
      LS_DOCDATA-OBJ_DESCR = 'bunu'.
      LS_CONTENTS_MSG-LINE = 'BUNOO' .
      APPEND LS_CONTENTS_MSG TO LT_CONTENTS_MSG.
    LS_CONTENTS_TXT-LINE = text-009.
      APPEND LS_CONTENTS_TXT TO LT_CONTENTS_TXT.
      clear LS_CONTENTS_TXT.
    BREAK-POINT.
    Content structure
      LS_PACKING_LIST-TRANSF_BIN = space.
      LS_PACKING_LIST-HEAD_START = 1.
      LS_PACKING_LIST-HEAD_NUM = 0.
      LS_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE LT_CONTENTS_TXT LINES LS_PACKING_LIST-BODY_NUM .
      LS_PACKING_LIST-DOC_TYPE = 'RAW'.
      append LS_PACKING_LIST to Lt_PACKING_LIST.
    Create attachment notification
      LS_PACKING_LIST-TRANSF_BIN = 'X'.
      LS_PACKING_LIST-HEAD_START = 1.
      LS_PACKING_LIST-HEAD_NUM   = 1.
      LS_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE LT_CONTENTS_MSG LINES LS_PACKING_LIST-BODY_NUM.
      LS_PACKING_LIST-DOC_TYPE   =  'PDF'.
      LS_PACKING_LIST-OBJ_DESCR  =  'PDF ATTACHEMENT'.
      LS_PACKING_LIST-OBJ_NAME   =  'DEMO'.
      LS_PACKING_LIST-DOC_SIZE   =  LS_PACKING_LIST-BODY_NUM * 255.
      APPEND LS_PACKING_LIST TO Lt_PACKING_LIST.
      LS_RECEIVERS-RECEIVER = 'WRITE THE MAIL ID HERE'.
      LS_RECEIVERS-REC_TYPE = 'U'.
      APPEND LS_RECEIVERS TO LT_RECEIVERS.
      LS_RECEIVERS-RECEIVER = 'WRITE THE MAIL ID HERE' TO SEND IN CC FIELD'  .
      LS_RECEIVERS-REC_TYPE = 'U'.
      LS_RECEIVERS-COPY = 'X'.
      APPEND LS_RECEIVERS TO LT_RECEIVERS.
    Send mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                    = LS_DOCDATA
         PUT_IN_OUTBOX                    = 'X'
         COMMIT_WORK                      = 'X'
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
        TABLES
          PACKING_LIST                     = Lt_PACKING_LIST
      OBJECT_HEADER                    =
       CONTENTS_BIN                     = LT_CONTENTS_MSG
         CONTENTS_TXT                     = LT_CONTENTS_TXT
      CONTENTS_HEX                     =
      OBJECT_PARA                      =
      OBJECT_PARB                      =
          RECEIVERS                        = LT_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
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards
    Ansumesh

  • Creating a PDF attachment and send it via Email

    Hi,
    I have following problem.
    I want to send a Purchase Order via Mail to email inbox.
    I already read in the forum that I should use the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    Could anyone please provide me with some information about that. So how can I insert my PO into this function module (PO-Document is based on smartform and not stored in the database as a pdf-file so far)  -  so do I need to use another FM first to create a PDF file or how is it working?
    Thanks for your help,
    Christoph

    this code will help you
    *& Report  YSMARTFORM_EMAIL
    REPORT  YSMARTFORM_EMAIL.
    TABLES: VBAK.
    Constants                                                            *
    CONSTANTS:
      C_X        TYPE C VALUE 'X',         " Value X
      C_0        TYPE C VALUE '0',                              " Value 0
      C_1        TYPE C VALUE '1'.                              " Value 1
    Work Variables declaration                                           *
    DATA:
       W_UCOMM  LIKE SY-UCOMM,             " Function code
       W_TABLN  TYPE I,                    " Lines
       W_LINE   TYPE SO_TEXT255,           " Line of text
       W_EADDR(60) TYPE C.                 " FieldLength for Email
    DATA: VBAP_TAB LIKE VBAP OCCURS 0 WITH HEADER LINE.
    DATA: W_FUNMOD TYPE RS38L_FNAM.
    Structure to hold the Attributes of new Document
    DATA: FS_DOCDATA TYPE SODOCCHGI1.
    Internal table for storing OTF data form Smart-Form
    DATA: BEGIN OF FS_OTF_DATA.
            INCLUDE STRUCTURE ITCOO.
    DATA: END OF FS_OTF_DATA,
          T_OTF_DATA LIKE STANDARD TABLE OF FS_OTF_DATA.
    Internal table for storing PDF data form Smart-Form
    DATA: BEGIN OF FS_PDF_DATA.
            INCLUDE STRUCTURE TLINE.
    DATA: END OF FS_PDF_DATA,
          T_PDF_DATA LIKE STANDARD TABLE OF FS_PDF_DATA.
    Internal table to hold the attachment data text of the email
    DATA: BEGIN OF FS_ATTACH_DATA.
            INCLUDE STRUCTURE SOLISTI1.
    DATA: END OF FS_ATTACH_DATA,
          T_ATTACH_DATA LIKE STANDARD TABLE OF FS_ATTACH_DATA.
    Internal table to hold Message body of the email
    DATA: BEGIN OF FS_MESSBODY.
            INCLUDE STRUCTURE SOLISTI1.
    DATA: END OF FS_MESSBODY,
          T_MESSBODY LIKE STANDARD TABLE OF FS_MESSBODY.
    Internal table for packing list for main document
    DATA: BEGIN OF FS_OBJPACK.
            INCLUDE STRUCTURE SOPCKLSTI1.
    DATA: END OF FS_OBJPACK,
          T_OBJPACK LIKE STANDARD TABLE OF FS_OBJPACK.
    Internal table for header text of the attachment
    DATA: BEGIN OF FS_OBJHEAD.
            INCLUDE STRUCTURE SOLISTI1.
    DATA: END OF FS_OBJHEAD,
          T_OBJHEAD LIKE STANDARD TABLE OF FS_OBJHEAD.
    Internal table receiver information
    DATA: BEGIN OF FS_RECEIVER.
            INCLUDE STRUCTURE SOMLRECI1.
    DATA: END OF FS_RECEIVER,
          T_RECEIVER LIKE STANDARD TABLE OF FS_RECEIVER.
    *Internal table to store data upto 255 lines
    DATA: BEGIN OF FS_OBJCONT.
            INCLUDE STRUCTURE SOLI.
    DATA: END OF FS_OBJCONT,
          T_OBJCONT LIKE STANDARD TABLE OF FS_OBJCONT.
    *DATA : P_VBELN LIKE VBAK-VBELN.
    DATA: P_EADDR(60) TYPE C
         VALUE '[email protected]'.
    PARAMETERS : P_VBELN LIKE VBAK-VBELN.
    *PARAMETERS:
    P_EADDR(60) TYPE C.     " Email address
    SELECT SINGLE *
      FROM VBAK
    WHERE VBELN EQ P_VBELN.
    SELECT *
      FROM VBAP
      INTO TABLE VBAP_TAB
    WHERE VBELN EQ P_VBELN.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'YSMARTFORM_EMAIL'
       VARIANT                  = ' '
       DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = W_FUNMOD
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3      .
    IF SY-SUBRC <> 0.
    Do nothing
    ENDIF.
    DATA: FS_CONT_PARM TYPE SSFCTRLOP,
          T_JOB_INFO    TYPE SSFCRESCL.
    CLEAR FS_CONT_PARM.
    FS_CONT_PARM-GETOTF    = 'X'.
    FS_CONT_PARM-NO_DIALOG = 'X'.
    FS_CONT_PARM-PREVIEW   = ''.
    CALL FUNCTION W_FUNMOD
      EXPORTING
       ARCHIVE_INDEX              =
       ARCHIVE_INDEX_TAB          =
       ARCHIVE_PARAMETERS         =
         CONTROL_PARAMETERS         = FS_CONT_PARM
       MAIL_APPL_OBJ              =
       MAIL_RECIPIENT             =
       MAIL_SENDER                =
       OUTPUT_OPTIONS             =
       USER_SETTINGS              = 'X'
        VBAK                       = VBAK
      IMPORTING
       DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = T_JOB_INFO
       JOB_OUTPUT_OPTIONS         =
      TABLES
        VBAP                       = VBAP_TAB
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 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.
    PERFORM CONVERT_OTF_TO_PDF.
    *&      Form  convert_otf_to_pdf
          text
    -->  p1        text
    <--  p2        text
    FORM CONVERT_OTF_TO_PDF .
      DATA: LV_BYTES TYPE P.
      IF FS_CONT_PARM-GETOTF EQ 'X'.
        REFRESH T_OTF_DATA.
        CLEAR FS_OTF_DATA.
        LOOP AT T_JOB_INFO-OTFDATA INTO FS_OTF_DATA.
          APPEND FS_OTF_DATA TO T_OTF_DATA.
          CLEAR FS_OTF_DATA.
        ENDLOOP.                           " LOOP AT t_outtab-otfdata
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            FORMAT                = 'PDF'
            MAX_LINEWIDTH         = 255
          IMPORTING
            BIN_FILESIZE          = LV_BYTES
          TABLES
            OTF                   = T_OTF_DATA
            LINES                 = T_PDF_DATA
          EXCEPTIONS
            ERR_MAX_LINEWIDTH     = 1
            ERR_FORMAT            = 2
            ERR_CONV_NOT_POSSIBLE = 3
            OTHERS                = 4.
        IF SY-SUBRC EQ 0 AND LV_BYTES IS NOT INITIAL.
          PERFORM TABLE_SHIFT.
    To send the output by email
          PERFORM SET_UP_EMAIL.
          PERFORM SEND_MAIL.
        ENDIF.                             " IF sy-subrc EQ space.
      ENDIF.                               " IF gs_control_pars-getotf
    ENDFORM.                               " convert_otf_to_pdf
    Form  set_up_email                                                   *
    This subroutine is used to set mail attributes                       *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SET_UP_EMAIL .
    To setup attributes of the document
      PERFORM SET_EMAIL_HEADER.
    To set body of email
      PERFORM SET_EMAILBODY.
    To convert output table data with tab delimiter
      PERFORM PREPARE_OUTPUT_DATA_FOR_ATTACH.
    To set the Receipents
      PERFORM SET_RECEIPENTS.
    ENDFORM.                               " Set_up_email
    Form  set_email_header                                               *
    This subroutine is used to Setup the attributes of the Document      *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SET_EMAIL_HEADER.
      CONSTANTS :
        LC_P TYPE C   VALUE 'P',             " Production system name
        LC_F TYPE C   VALUE 'F',             " Sensitivity
        LC_OBJNAME(6) TYPE C                 " Object name
                      VALUE 'SAPRPT'.
      CLEAR FS_DOCDATA.
    Populate the subject/generic message attributes
      FS_DOCDATA-DOC_SIZE   = 1.
      FS_DOCDATA-OBJ_LANGU  = SY-LANGU.
      FS_DOCDATA-OBJ_NAME   = LC_OBJNAME.
      FS_DOCDATA-SENSITIVTY = LC_F.
      IF SY-SYSID+0(1) NE LC_P.
        CONCATENATE 'Test mail'(003)
                    'Sales Order Details'(002)
               INTO FS_DOCDATA-OBJ_DESCR
          SEPARATED BY SPACE.
      ELSE.
        MOVE TEXT-002 TO FS_DOCDATA-OBJ_DESCR.
      ENDIF.                               " IF sy-sysid+0(1)...
    ENDFORM.                               " Set_email_header
    Form  set_emailbody                                                  *
    This subroutine is used to set body of an email                      *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SET_EMAILBODY.
      CONSTANTS:
        LC_DOC_TYPE(3) TYPE C VALUE 'RAW'. " Document type
      REFRESH : T_OBJPACK,
                T_MESSBODY.
      CLEAR : FS_OBJPACK,
              FS_MESSBODY.
      MOVE:
        'Hi,'(004) TO FS_MESSBODY-LINE.
      APPEND FS_MESSBODY TO T_MESSBODY.
      CLEAR FS_MESSBODY.
      MOVE:
      'The attachment contains sales order details.'(005)
       'www.google.com'
        TO FS_MESSBODY-LINE.
      APPEND FS_MESSBODY TO T_MESSBODY.
      CLEAR W_TABLN.
      DESCRIBE TABLE T_MESSBODY LINES W_TABLN.
      CLEAR FS_MESSBODY.
      READ TABLE T_MESSBODY INTO FS_MESSBODY INDEX W_TABLN.
      FS_DOCDATA-DOC_SIZE = ( W_TABLN - 1 ) * 255 + STRLEN( W_LINE ).
      MOVE:
        SPACE    TO FS_OBJPACK-TRANSF_BIN,
        C_1      TO FS_OBJPACK-HEAD_START,
        C_0      TO FS_OBJPACK-HEAD_NUM,
        C_1      TO FS_OBJPACK-BODY_START,
        W_TABLN  TO FS_OBJPACK-BODY_NUM,
        LC_DOC_TYPE TO FS_OBJPACK-DOC_TYPE.
      APPEND FS_OBJPACK TO T_OBJPACK.
    ENDFORM.                               " Set_emailbody
    Form  prepare_output_data_for_attach                                 *
    To convert the output table data with comma delimiter                *
    There are no interface parameters to be passed to this subroutine.   *
    FORM PREPARE_OUTPUT_DATA_FOR_ATTACH.
      CONSTANTS:
        LC_DOC_TYPE(3) TYPE C VALUE 'PDF', " Document type
        LC_OBJNAME(6)  TYPE C VALUE 'SAPRPT'. " Object name
      REFRESH T_OBJHEAD.
      REFRESH T_ATTACH_DATA[].
      CLEAR   FS_ATTACH_DATA.
      T_ATTACH_DATA[] = T_OBJCONT[].
      DESCRIBE TABLE T_ATTACH_DATA LINES W_TABLN.
      FS_DOCDATA-DOC_SIZE   = ( W_TABLN - 1 ) * 255 + STRLEN( W_LINE ).
      FS_OBJPACK-BODY_NUM   = W_TABLN.
      FS_OBJPACK-DOC_SIZE   = W_TABLN * 255.
      FS_OBJPACK-TRANSF_BIN = C_X.
      FS_OBJPACK-HEAD_START = C_1.
      FS_OBJPACK-HEAD_NUM   = C_1.
      FS_OBJPACK-BODY_START = C_1.
      FS_OBJPACK-DOC_TYPE   = LC_DOC_TYPE.
      FS_OBJPACK-OBJ_NAME   = 'Attachment'.
      FS_OBJPACK-OBJ_DESCR  = 'Sales Order Details.PDF'(007).
      APPEND FS_OBJPACK TO T_OBJPACK.
    ENDFORM.                               " Prepare_output_data_for_attach
    Form  set_receipents                                                 *
    This subroutine is used to set the Receipents                        *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SET_RECEIPENTS .
      CONSTANTS
       LC_REC_TYPE TYPE C VALUE 'U'.      " Receipent type
      REFRESH T_RECEIVER.
      IF P_EADDR IS NOT INITIAL.
        MOVE:
          P_EADDR TO FS_RECEIVER-RECEIVER,
          LC_REC_TYPE TO FS_RECEIVER-REC_TYPE.
        APPEND FS_RECEIVER TO T_RECEIVER.
      ENDIF.                               " IF P_EMAIL IS NOT.....
    ENDFORM.                               " Set_receipents
    Form  send_mail                                                      *
    This subroutine is used to send output by email                      *
    There are no interface parameters to be passed to this subroutine.   *
    FORM SEND_MAIL.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                   = FS_DOCDATA
          PUT_IN_OUTBOX                   = C_X
        SENDER_ADDRESS                   = SY-UNAME
        SENDER_ADDRESS_TYPE              = 'B'
          COMMIT_WORK                     = C_X
        TABLES
          PACKING_LIST                    = T_OBJPACK
          OBJECT_HEADER                   = T_OBJHEAD
          CONTENTS_BIN                    = T_ATTACH_DATA
          CONTENTS_TXT                    = T_MESSBODY
          RECEIVERS                       = T_RECEIVER
       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.
      IF SY-SUBRC NE 0.
        MESSAGE I007(CLAIM).
      ELSE.
        MESSAGE S592(EI).
      ENDIF.                               " IF sy-subrc NE 0.
    ENDFORM.                               " Send_mail
    *&      Form  table_shift
    The PDF file that is generated out of the above function module
    cannot be transported as it needs to be of 255 chars.Hence
    converting the file to get a 255 char single line,internal table.
    *There are no interface parameters to be passed to this subroutine
    FORM TABLE_SHIFT .
      CONSTANTS:
        CNV_HEXCONST_ZERO TYPE X VALUE '00'.
      DATA:
        LV_BIG_LINES(268) TYPE C
                          OCCURS 0 WITH HEADER LINE.
      DATA:
        LFL_FLAG          TYPE C,
        LV_LEFT_T(268)    TYPE C,
        LV_LEFT_I         TYPE I,
        TV_LEFT_I         TYPE I,
        LV_CURR_I         TYPE I.
      FIELD-SYMBOLS: <F>.
    Get the lines into a table of 268 char as the first step to put it in
    the pdf file of 255 chars
      CLEAR LFL_FLAG.
      LOOP AT T_PDF_DATA INTO FS_PDF_DATA.
        IF LFL_FLAG EQ ' '.
          CLEAR LV_BIG_LINES WITH CNV_HEXCONST_ZERO.
          ASSIGN LV_BIG_LINES(134) TO <F>.
          <F> = FS_PDF_DATA.
          LFL_FLAG = 'X'.
        ELSE.
          LV_BIG_LINES+134 = FS_PDF_DATA.
          APPEND LV_BIG_LINES.
          CLEAR: LFL_FLAG.
        ENDIF.                             " If lfl_flag = ''..
      ENDLOOP.                             " Loop at t_pdf
      IF LFL_FLAG EQ 'X'.
        APPEND LV_BIG_LINES.
      ENDIF.                               " If lflf_flag eq 'X'..
    Next fill it into a 255 char table
      CLEAR: LV_LEFT_T, LV_LEFT_I, TV_LEFT_I.
      LV_CURR_I = 255.
      LOOP AT LV_BIG_LINES.
        IF LV_LEFT_I NE 0.
          IF LV_CURR_I NE 0.
            FS_OBJCONT(LV_LEFT_I)           = LV_LEFT_T(LV_LEFT_I).
            FS_OBJCONT+LV_LEFT_I(LV_CURR_I) = LV_BIG_LINES(LV_CURR_I).
          ELSE.
            FS_OBJCONT = LV_LEFT_T(LV_LEFT_I).
          ENDIF.                           " IF lv_curr_i NE 0
        ELSE.
          FS_OBJCONT = LV_BIG_LINES(LV_CURR_I).
        ENDIF.                             " IF lv_left_i NE 0
        APPEND FS_OBJCONT TO T_OBJCONT.
        TV_LEFT_I = 268 - LV_CURR_I.
        IF TV_LEFT_I > 255.
          FS_OBJCONT = LV_BIG_LINES+LV_CURR_I(255).
          APPEND FS_OBJCONT TO T_OBJCONT.
          LV_LEFT_I = TV_LEFT_I - 255.
          TV_LEFT_I = 255 + LV_CURR_I.
          LV_CURR_I = 255 - LV_LEFT_I.
          LV_LEFT_T = LV_BIG_LINES+TV_LEFT_I.
        ELSE.
          LV_LEFT_T = LV_BIG_LINES+LV_CURR_I.
          LV_LEFT_I = 268 - LV_CURR_I.
          LV_CURR_I = 255 - LV_LEFT_I.
        ENDIF.                             " IF tv_left_i > 255
      ENDLOOP.                             " LOOP AT lv_big_lines.
      CLEAR FS_OBJCONT WITH CNV_HEXCONST_ZERO.
      ASSIGN FS_OBJCONT(LV_LEFT_I) TO <F>.
      <F> = LV_LEFT_T(LV_LEFT_I).
      APPEND FS_OBJCONT TO T_OBJCONT.
    ENDFORM.                               " Table_shift

  • HTML Format via Email

    When sending output via email in HTML format (from rtf template), all the formating is lost, layout just expands horizontally.
    Output is correct when displayed in pdf format.
    Also occurs when previewing the output.
    Further information:
    This is purely a custom rtf template created for remittance report. In the rtf template we have used the filler, we have kept many conditions like if the data spills over to next page based on number of lines,and if the number of data lines is less then also it should align and fit to the table /page etc.
    If we remove the filler the output will shrink to half page in HTML page and WE DO NOT want this kind of report output. We need the report output in HTML which should fir to paper size(A4 size) even we have less number of data rows.
    Any assistance would be appreciated.
    Thanks
    Sarah

    Thanks for your response.
    The customer has updated with the following:
    The problem here is the standard program "IBY_FD_SRA_FORMAT module: Send Separate Remittance Advices" sets the output type to HTML if the remittance advice delivery method is "MAIL". Below is the extract from the log file of the program "IBY_FD_SRA_FORMAT module: Send Separate Remittance Advices"
    ******** EXTRACT BEGIN ********
    Since the delivery method is EMAIL, the XML Publisher output type is set to be html.
    ********* EXTRACT END *********
    This causes the following issue: -
    The concurrent program ends without generating a pdf output and hence cannot be emailed out as a pdf document.
    Action required from you: -
    [1] Ensure that the standard program does not default the output type to HTML for email. This should be PDF instead.
    [2] Ensure that IBY XDO Delivery, sends the PDF output as an attachment.

  • PDF attachment not getting sent via email. This occurs intermittently.

    Hi All,
    There is a concurrent program which sends report on Purchase Orders. The report is sent as a PDF attachment via email.
    The report is getting attached sometimes and not getting attached sometimes giving an empty email. Checked the log files and output files of the program and couldnt find any issue. There is no specific time/PO/vendor pattern wherein the program fails.
    Please let me know what needs to be done to get this resolved.
    Regards,
    Radhika.

    Hi,
    I am facing this issue with Oracle 11i - US Purchasing SuperUser responsiblity.
    There is a concurrent program which generates a report and then sends the report to printer. The report is not getting stored in a temp file in any directory. It is directly emailed as a PDF attachment.
    Sometimes the attachment is getting sent while sometimes it is not getting attached.
    Please let me know if any other information is required.
    Regards,
    Radhika.

  • I cannot send a Pages document, Word format via email from my ipad if it has a picture in the the doc.  I can send a Word doc if it does not have a pic in it or pdf with a pic.  Any thoughs why a word doc with a pic in it won't email in Pages?  thanks

    I cannot send a Pages document, Word via email if the doc contains a picture.  If I email a Pages doc without a pic in Word format or pdf with a pic it with go through to sender?  Not sure why Pages won't send Word doc with a picture in it.  I check the security on the email recipient and the email doesn't get blocked or throw in the junk box?
    thanks,
    drainguy41

    If you have upgraded to Mountain Lion, Save As… has returned to the File menu when you hold down the Option/alt key. But you don't really "save" as other file types, you translate & export as Word or RTF or text or PDF & that is easily done by going to File > Export or Share > Export.
    Also, please do us all a favor & don't use all capitals in your posts, either the body of the post or the title. All caps is the internet equivalent of shouting & is very hard to read.

  • Send Attachment Files Of MM03 via email

    Dear Experts,
    I have requirement of send Attachment files of MM03 transaction Via Email.
    Example.
    Go to TCODE MM03.
    Select Views:  Basic Data1 and Basic Data 2.
    Click on GOS (Generic Object Services) where you find Attachment List.
    I want to send that PDF files Via Email.
    Please tell me how I can read that file and send via Email as attachment.
    Thank you

    Hi
    1. Readout the GOS  FM: BDS_GOS_CONNECTIONS_GET  > make list of Attachments...
    2. Read the object:    FM: SO_OBJECT_READ 
    3. Download it into a Temp directory:   FM: SO_OBJECT_DOWNLOAD
    4. Upload into itab:    cl_gui_frontend_services=>gui_upload
    5. Put Table with text into Email.. & send... FM: SO_NEW_DOCUMENT_ATT_SEND_API1
    6. delete Temp file
    that was my way....
    Robert

  • Email report output as an attachment

    hi all,
    i am trying to send the output of a report to an external email as an attachment using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    when i use the document type as RAW it is working fine.
    now my requirement is to send it as an excel attachment.
    i tried using the document type as both XLS and XXL separately.though i am getting the mail with an excel attachment, all the data appears in a single column whereas it should appear fieldwise in each column.
    is this possible?
    any help would be appreciated.
    thanks in advance
    sandeep

    Hi Ravi/Anurag
    i tried the FM SO_NEW_DOCUMENT_ATT_SEND_API1 and it is working fine when i send the mail(with an excel attachment) to SAP inbox.when i open the attachemnt with excel the data format is correct.but when i send it as an external mail and open the attachement in excel,all the data appears in one row only.
    what could be the problem?
    Can anyone of you please help me out in this regard?
    Reward points guaranteed.
    thanks
    Sandeep

  • E-mailing report output as an attachment

    Hi Experts,
    My requirement is to automatically e-mail the output of a report. I want my program to e-mail whatever appears on the output screen as an attachment(pdf or html), when the report is executed.
    Thanks,
    Rakesh.

    hi rakesh,
    you can check this program.
    here you can replace
    1. your internal table
    2. body message
    3. attatchment.
    4. receivers
    please debug this one you will get clear idea where you can have correct replacement.
    please check this.
    report y_cr17_mail.
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
       PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    EXCEPTIONS
       USER_NOT_EXIST                  = 1
       PARAMETER_ERROR                 = 2
       X_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.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'sap-img.com testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'sap-img.com testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
      FOLMEM_DATA        =
      RECEIVE_DATA       =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.
    One more code:
    REPORT ZSAP_EMAIL MESSAGE-ID Z001.
    *TABLES: rlgrap, btcxpm." zlookup.
    DATA:
    V_ZCODE(3) TYPE C,
    *svrname LIKE zlookup-zdesc,
    WA_ERROR(80) TYPE C,
    GLOBAL_FILEMASK_ALL(80).
    DATA: T_SOUD LIKE SOUD.
    DATA: P_INFOLDER LIKE SOFDK.
    DATA: P_OUTFOLDER LIKE SOFDK.
    DATA: OBJECT_HD_DISPLAY LIKE SOOD2.
    DATA: OBJECT_ID LIKE SOODK.
    DATA: DOCUMENT LIKE SOOD4.
    DATA: HEADER_DATA LIKE SOOD2.
    DATA: LINK_FOLDER_ID LIKE SOODK.
    DATA: FOLDER_SELECTIONS LIKE SOFDS.
    DATA: FOLDER_LIST LIKE SOXLI OCCURS 0 WITH HEADER LINE.
    DATA: RECEIVERS LIKE SOOS1 OCCURS 0 WITH HEADER LINE.
    DATA: OBJCONT LIKE SOLI OCCURS 0 WITH HEADER LINE.
    DATA: OBJHEAD LIKE SOLI OCCURS 0 WITH HEADER LINE.
    DATA: OBJECT_CONTENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA: OBJECT_HD_CHANGE LIKE SOOD1.
    DATA: BEGIN OF FILES OCCURS 0,
    LINE(200) TYPE C,
    END OF FILES.
    DATA: LISTOBJECT LIKE ABAPLIST OCCURS 1 WITH HEADER LINE.
    *Email to addresses
    SELECTION-SCREEN: BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.
    PARAMETERS: P_MAILTO(240) TYPE C.
    *PARAMETERS:P_MAILTO TYPE SOLI-LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN COMMENT 10(2) TEXT-001.
    *Use zlookup-ztype as group to define multiple email to addresses
    *SELECT-OPTIONS: s_mailto FOR zlookup-ztype.
    SELECTION-SCREEN: END OF BLOCK BL1.
    *Subject
    SELECTION-SCREEN: BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-BL2.
    PARAMETERS: P_SUBJ LIKE DOCUMENT-OBJDES.
    SELECTION-SCREEN: END OF BLOCK BL2.
    *Body
    SELECTION-SCREEN: BEGIN OF BLOCK BL3 WITH FRAME TITLE TEXT-BL3.
    PARAMETERS: P_BODY1 LIKE SOLISTI1-LINE LOWER CASE.
    PARAMETERS: P_BODY2 LIKE SOLISTI1-LINE LOWER CASE.
    PARAMETERS: P_BODY3 LIKE SOLISTI1-LINE LOWER CASE.
    PARAMETERS: P_BODY4 LIKE SOLISTI1-LINE LOWER CASE.
    PARAMETERS: P_BODY5 LIKE SOLISTI1-LINE LOWER CASE.
    PARAMETERS: P_BODY6 LIKE SOLISTI1-LINE LOWER CASE.
    SELECTION-SCREEN: END OF BLOCK BL3.
    *Attachments
    SELECTION-SCREEN: BEGIN OF BLOCK BL4 WITH FRAME TITLE TEXT-BL4.
    PARAMETERS: P_FNAME1 LIKE FILES-LINE.
    PARAMETERS: P_FNAME2 LIKE FILES-LINE.
    PARAMETERS: P_FNAME3 LIKE FILES-LINE.
    PARAMETERS: P_FNAME4 LIKE FILES-LINE.
    PARAMETERS: P_FNAME5 LIKE FILES-LINE.
    PARAMETERS: P_FNAME6 LIKE FILES-LINE.
    SELECTION-SCREEN: END OF BLOCK BL4.
    AT SELECTION-SCREEN.
    PERFORM CHK_SELECTION.
    IF NOT WA_ERROR IS INITIAL.
    MESSAGE E001 WITH WA_ERROR.
    ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
    PERFORM SEND_EMAIL.
    FORM chk_selection
    FORM CHK_SELECTION.
    CLEAR WA_ERROR.
    *Loop only once ???
    *If more checkings to be done.
    *Think about it and if not clear.
    *Let it sink in for a couple of minutes.
    *Still doesn't make sence? Go home and sleep on it.
    DO 1 TIMES.
    *Check Email to
    IF P_MAILTO IS INITIAL .
    *AND s_mailto IS INITIAL.
    WA_ERROR = 'Invalid or no EMAIL TO selection'.
    EXIT.
    ENDIF.
    ENDDO.
    ENDFORM. "chk_selection
    *& Form send_email
    *text
    *--> p1 text
    *<-- p2 text
    FORM SEND_EMAIL.
    PERFORM GET_FOLDER_INFO.
    PERFORM FILL_BODY.
    PERFORM INS_NEW_OBJECT.
    PERFORM CRT_ATTACHMENTS.
    PERFORM FILL_RECEIVERS_INFO.
    PERFORM SND_EMAIL.
    ENDFORM. " send_email
    *--+--
    *FORM Get_folder_info
    FORM GET_FOLDER_INFO.
    CLEAR T_SOUD.
    *Small so should be quick.
    SELECT * FROM SOUD
    INTO T_SOUD
    WHERE SAPNAM = SY-UNAME.
    P_INFOLDER-FOLTP = 'FOL'.
    P_INFOLDER-FOLYR = T_SOUD-INBYR. "inbox
    P_INFOLDER-FOLNO = T_SOUD-INBNO.
    P_OUTFOLDER-FOLTP = 'FOL'.
    P_OUTFOLDER-FOLYR = T_SOUD-OUTYR. "outbox
    P_OUTFOLDER-FOLNO = T_SOUD-OUTNO.
    ENDSELECT.
    ENDFORM. "get_folder_info
    *FORM fill_body *
    FORM FILL_BODY.
    OBJECT_CONTENT-LINE = P_BODY1.
    APPEND OBJECT_CONTENT.
    OBJECT_CONTENT-LINE = P_BODY2.
    APPEND OBJECT_CONTENT.
    OBJECT_CONTENT-LINE = P_BODY3.
    APPEND OBJECT_CONTENT.
    OBJECT_CONTENT-LINE = P_BODY4.
    APPEND OBJECT_CONTENT.
    OBJECT_CONTENT-LINE = P_BODY5.
    APPEND OBJECT_CONTENT.
    OBJECT_CONTENT-LINE = P_BODY6.
    APPEND OBJECT_CONTENT.
    ENDFORM. "fill_body
    *FORM ins_new_object *
    FORM INS_NEW_OBJECT.
    OBJECT_HD_CHANGE-OBJNAM = 'Notes'.
    OBJECT_HD_CHANGE-OBJDES = P_SUBJ.
    CALL FUNCTION 'SO_OBJECT_INSERT'
    EXPORTING
    FOLDER_ID = P_OUTFOLDER
    OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
    OBJECT_TYPE = 'RAW'
    OWNER = SY-UNAME
    IMPORTING
    OBJECT_HD_DISPLAY = OBJECT_HD_DISPLAY
    OBJECT_ID = OBJECT_ID
    TABLES
    OBJCONT = OBJECT_CONTENT
    OBJHEAD = OBJHEAD
    EXCEPTIONS
    ACTIVE_USER_NOT_EXIST = 1
    COMMUNICATION_FAILURE = 2
    COMPONENT_NOT_AVAILABLE = 3
    DL_NAME_EXIST = 4
    FOLDER_NOT_EXIST = 5
    FOLDER_NO_AUTHORIZATION = 6
    OBJECT_TYPE_NOT_EXIST = 7
    OPERATION_NO_AUTHORIZATION = 8
    OWNER_NOT_EXIST = 9
    PARAMETER_ERROR = 10
    SUBSTITUTE_NOT_ACTIVE = 11
    SUBSTITUTE_NOT_DEFINED = 12
    SYSTEM_FAILURE = 13
    X_ERROR = 14
    OTHERS = 15.
    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. "ins_new_object
    *FORM crt_attachments *
    *--> P_SUBJ *
    FORM CRT_ATTACHMENTS.
    DOCUMENT-FOLTP = P_OUTFOLDER-FOLTP.
    DOCUMENT-FOLYR = P_OUTFOLDER-FOLYR.
    DOCUMENT-FOLNO = P_OUTFOLDER-FOLNO.
    DOCUMENT-OBJTP = OBJECT_ID-OBJTP.
    DOCUMENT-OBJYR = OBJECT_ID-OBJYR.
    DOCUMENT-OBJNO = OBJECT_ID-OBJNO.
    DOCUMENT-OBJNAM = 'Notes'.
    DOCUMENT-OBJDES = P_SUBJ.
    DOCUMENT-OKCODE = 'CHNG'.
    DOCUMENT-FILE_EXT = 'TXT'.
    LINK_FOLDER_ID = OBJECT_ID.
    HEADER_DATA-OBJLA = 'EN'.
    HEADER_DATA-OBJNAM = DOCUMENT-OBJNAM.
    HEADER_DATA-OBJDES = DOCUMENT-OBJDES.
    HEADER_DATA-OBJPRI = '5'.
    HEADER_DATA-OBJSNS = 'O'.
    HEADER_DATA-FILE_EXT = 'TXT'.
    REFRESH FILES.
    CLEAR FILES.
    IF NOT P_FNAME1 IS INITIAL.
    FILES-LINE = P_FNAME1.
    APPEND FILES.
    ENDIF.
    IF NOT P_FNAME2 IS INITIAL.
    FILES-LINE = P_FNAME2.
    APPEND FILES.
    ENDIF.
    IF NOT P_FNAME3 IS INITIAL.
    FILES-LINE = P_FNAME3.
    APPEND FILES.
    ENDIF.
    IF NOT P_FNAME4 IS INITIAL.
    FILES-LINE = P_FNAME4.
    APPEND FILES.
    ENDIF.
    IF NOT P_FNAME5 IS INITIAL.
    FILES-LINE = P_FNAME5.
    APPEND FILES.
    ENDIF.
    IF NOT P_FNAME6 IS INITIAL.
    FILES-LINE = P_FNAME6.
    APPEND FILES.
    ENDIF.
    IF NOT FILES[] IS INITIAL.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING
    METHOD = 'ATTCREATEFROMPC'
    TABLES
    FILES = FILES
    CHANGING
    DOCUMENT = DOCUMENT
    HEADER_DATA = HEADER_DATA.
    IF SY-SUBRC = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDFORM. "crt_attachments
    *FORM fill_receivers_info *
    FORM FILL_RECEIVERS_INFO.
    DATA: BEGIN OF RECLIST OCCURS 0,
    REC LIKE RECEIVERS-RECEXTNAM,
    END OF RECLIST.
    *Build reclist
    REFRESH RECLIST.
    IF NOT P_MAILTO IS INITIAL.
    RECLIST-REC = P_MAILTO.
    APPEND RECLIST.
    ENDIF.
    *IF NOT s_mailto IS INITIAL.
    *SELECT zdesc
    *INTO reclist-rec
    *FROM zlookup
    *WHERE ztype IN s_mailto.
    *APPEND reclist.
    *ENDSELECT.
    *ENDIF.
    REFRESH RECEIVERS.
    LOOP AT RECLIST.
    FOLDER_SELECTIONS-FOLNAM = 'INBOX'.
    CALL FUNCTION 'SO_FOLDER_LIST_READ'
    EXPORTING
    FOLDER_SELECTIONS = FOLDER_SELECTIONS
    OWNER = SY-UNAME
    REGION = 'P'
    TABLES
    FOLDER_LIST = FOLDER_LIST
    EXCEPTIONS
    COMPONENT_NOT_AVAILABLE = 1
    OPERATION_NO_AUTHORIZATION = 2
    OWNER_NOT_EXIST = 3
    PARAMETER_ERROR = 4
    X_ERROR = 5
    OTHERS = 6.
    IF SY-SUBRC = 0.
    CLEAR RECEIVERS.
    MOVE: SY-DATUM TO RECEIVERS-RCDAT,
    SY-UZEIT TO RECEIVERS-RCTIM,
    ' ' TO RECEIVERS-RECESC,
    P_MAILTO TO RECEIVERS-RECNAM,
    'X' TO RECEIVERS-SNDEX.
    APPEND RECEIVERS.
    u2022     RECEIVERS-RCDAT = SY-DATUM.
    u2022     RECEIVERS-RCTIM = SY-UZEIT.
    u2022     RECEIVERS-RECNAM = RECLIST-REC.
    u2022     RECEIVERS-RECNO = FOLDER_LIST-PARNO.
    u2022     RECEIVERS-RECTP = FOLDER_LIST-PARTP.
    u2022     RECEIVERS-RECYR = FOLDER_LIST-PARYR.
    u2022     RECEIVERS-SNDTP = FOLDER_LIST-PARTP.
    u2022     RECEIVERS-SNDYR = FOLDER_LIST-PARYR.
    u2022     RECEIVERS-SNDNO = FOLDER_LIST-PARNO.
    u2022     RECEIVERS-SNDNAM = SY-UNAME.
    u2022     RECEIVERS-SNDPRI = '1'.
    u2022     RECEIVERS-MSGID = 'SO'.
    u2022     RECEIVERS-MSGNO = '619'.
    u2022     RECEIVERS-DELIVER = 'X'.
    u2022     RECEIVERS-NOT_DELI = 'X'.
    u2022     RECEIVERS-READ = 'X'.
    u2022     RECEIVERS-MAILSTATUS = 'E'.
    **receivers-ADR_NAME
    u2022     RECEIVERS-RESEND = ' '.
    u2022     RECEIVERS-SORTFIELD = ' '. "'USER WF_BATCH INDIGO BATCH'.
    u2022     RECEIVERS-SORTCLASS = '5'.
    u2022     APPEND RECEIVERS.
    ELSE.
    CLEAR RECEIVERS.
    RECEIVERS-SEL = 'X'.
    RECEIVERS-RECESC = 'U'.
    RECEIVERS-RECNAM = 'U-'.
    RECEIVERS-RECEXTNAM = RECLIST-REC.
    RECEIVERS-DELIVER = 'X'.
    RECEIVERS-NOT_DELI = 'X'.
    RECEIVERS-READ = 'X'.
    RECEIVERS-MAILSTATUS = 'E'.
    RECEIVERS-ADR_NAME = RECLIST-REC.
    RECEIVERS-SORTFIELD = RECLIST-REC.
    RECEIVERS-SORTCLASS = '5'.
    APPEND RECEIVERS.
    ENDIF.
    ENDLOOP.
    ENDFORM. "fill_receivers_info
    *FORM snd_email *
    FORM SND_EMAIL.
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    FOLDER_ID = P_OUTFOLDER
    OBJECT_ID = OBJECT_ID
    OUTBOX_FLAG = 'X'
    OWNER = SY-UNAME
    CHECK_SEND_AUTHORITY = 'X'
    ORIGINATOR_TYPE = 'J'
    LINK_FOLDER_ID = LINK_FOLDER_ID
    TABLES
    OBJCONT = OBJECT_CONTENT
    RECEIVERS = RECEIVERS
    EXCEPTIONS
    ACTIVE_USER_NOT_EXIST = 1
    COMMUNICATION_FAILURE = 2
    COMPONENT_NOT_AVAILABLE = 3
    FOLDER_NOT_EXIST = 4
    FOLDER_NO_AUTHORIZATION = 5
    FORWARDER_NOT_EXIST = 6
    NOTE_NOT_EXIST = 7
    OBJECT_NOT_EXIST = 8
    OBJECT_NOT_SENT = 9
    OBJECT_NO_AUTHORIZATION = 10
    OBJECT_TYPE_NOT_EXIST = 11
    OPERATION_NO_AUTHORIZATION = 12
    OWNER_NOT_EXIST = 13
    PARAMETER_ERROR = 14
    SUBSTITUTE_NOT_ACTIVE = 15
    SUBSTITUTE_NOT_DEFINED = 16
    SYSTEM_FAILURE = 17
    TOO_MUCH_RECEIVERS = 18
    USER_NOT_EXIST = 19
    ORIGINATOR_NOT_EXIST = 20
    X_ERROR = 21
    OTHERS = 22.
    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. "snd_email
    reward me if it is useful.
    thanks
    AM

  • Need report output to be display in 'XML' format.

    Hi ALL,
    I have a requirement to generate a report in different format like 'PDF','EXCEL' AND 'XML' in my OAF page. for 'PDF' i am able to generate report after selecting the output fromat from my choicebox through below code :
    DocumentHelper.exportDocument(pageContext, reportOutput, "CustomerQuote","PDF");
    for 'XML' and 'EXCEL' i am not able to generate through documentHelper method please suggest me how can i process.
    Regards
    Deb

    balaji,
    Using web.show_doc u can only display the reports. If you want it to be stored in the server, you can use run_report_object.
    Rajesh Alex

Maybe you are looking for

  • Setting up Snow Leopard Server with Address Book, iCal for Small Business

    Hello Folks, I have a small business with 2-3 people and I want to setup Snow Leopard Server on a Mac Mini. I have everything in place, RAID, Backup drive etc. What I need is a guide on how to setup the server correctly and how to setup Address Book

  • How do I change the email address linked to iCloud

    When I open icloud on my devices using my apple ID, my ID/ email address shows as the user but the email address listed in the advanced tab is a me.com address. This would be fine but it is a mid-spelt version of my name at me.com. I can log in to th

  • Retrieval performance become poor with dynamic calc members with formulas

    We are facing the retrieval performance issue on our partititon cube. It was fine before applying the member formulas for 4 of measures and made them dynamic calc. The retrieval time has increased from 1sec to 5 sec. Here is the main formula on a mem

  • Using an iTunes Server

    Does any one know how one can get apple support for iTunes 10 and its iTunes server issues or is there no support at all because it is free? !!!! I bought the following: A NAS drive sold with an "iTunes Server" for that sepecific feature, I paid for

  • Tree in oracle 10g

    i want a tree node at run time i have this query select 1, level, e.ename , null, e.empno from emp e connect by prior e.empno = e.mgr start with mgr is null in this query the king is first node after that jones under the jones node the scott node lay