SAP_CONVERT_TO_TXT_FORMAT

How can I use SAP_CONVERT_TO_TXT_FORMAT for downloading from SAP to text file??

You can copy and paste the following codes and execute..
Hope this will help you..
TYPE-POOLS: truxs.
DATA t5 LIKE t005t OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SELECT * INTO TABLE t5
FROM t005t
WHERE spras = sy-langu.
DATA wa_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
EXPORTING
i_line_header = 'X'
TABLES
i_tab_sap_data = t5
CHANGING
i_tab_converted_data = wa_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
DATA stmp(4096) TYPE c.
DATA itmp TYPE i.
LOOP AT wa_data INTO stmp.
itmp = STRLEN( stmp ).
stmp+itmp = cl_abap_char_utilities=>cr_lf.
MODIFY wa_data FROM stmp.
ENDLOOP.
PERFORM send_email.
*& Form send_email
FORM send_email .
DATA docs LIKE docs OCCURS 0 WITH HEADER LINE.
DATA excelsize TYPE i.
DATA excel LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA doc LIKE sodocchgi1.
DATA excelln TYPE i.
DATA int_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA int_objhead LIKE solisti1 OCCURS 2 WITH HEADER LINE.
DATA int_objtext LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA int_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA bodyln LIKE sy-tabix.
DATA output_data TYPE ssfcrescl.
excel[] = wa_data[].
excel table sizes
DESCRIBE TABLE excel LINES excelln.
Body Email
int_objtext-line = 'Test Body'.
APPEND int_objtext.
DESCRIBE TABLE int_objtext LINES bodyln.
READ TABLE int_objtext INDEX bodyln.
CLEAR doc.
doc-doc_size = ( bodyln - 1 ) * 255 + STRLEN( int_objtext ).
doc-obj_name = ' '.
doc-sensitivty = 'P'.
doc-proc_syst = sy-sysid.
doc-proc_clint = sy-mandt.
CLEAR: int_objpack, int_objpack[].
int_objpack-transf_bin = ' '.
int_objpack-head_start = 1.
int_objpack-head_num = 0.
int_objpack-body_start = 1.
int_objpack-body_num = bodyln.
int_objpack-doc_type = 'RAW'.
int_objpack-obj_descr = 'Test'.
APPEND int_objpack.
CLEAR: int_objhead, int_objhead[].
int_objhead = 'Attachment'.
APPEND int_objhead.
int_objpack-transf_bin = 'X'.
int_objpack-head_start = 1.
int_objpack-head_num = 0.
int_objpack-body_start = 1.
int_objpack-body_num = excelln.
int_objpack-doc_size = excelsize.
int_objpack-doc_type = 'XLS'.
int_objpack-obj_name = 'excel'.
int_objpack-obj_descr = 'test.xls'. "File name
APPEND int_objpack.
Set Receiver
int_reclist-receiver = 'SAPUSER'.
int_reclist-rec_type = 'B'.
int_reclist-notif_del = 'X'.
int_reclist-notif_read = 'X'.
int_reclist-notif_ndel = 'X'.
int_reclist-express = 'X'.
APPEND int_reclist.
doc-obj_descr = 'Report in Excel'.
Sending Email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = int_objpack
object_header = int_objhead
contents_bin = excel
contents_txt = int_objtext "Body
receivers = int_reclist
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.
ENDFORM. " send_email

Similar Messages

  • SAP_CONVERT_TO_TXT_FORMAT problem

    Hi;
    I'm trying to create a TXT file separated by '!', i found this example below in this forum but it doesn´t create the .TXT file in C:. ¿what am i doing wrong?.
    I already tryied GUI_DOWNLOAD and creates the .TXT file, but it's not what i really need because can´t separete the data by '!',  and the data appears separated by long spaces.
    Example:
    TYPE-POOLS: truxs.
    DATA: itab_txt TYPE truxs_t_text_data,
    itab_line LIKE LINE OF itab_txt.
    DATA: test TYPE kna1 OCCURS 0 WITH HEADER LINE.
    DATA: e_file LIKE rlgrap-filename VALUE 'c:     est2.txt'.
    SELECT * FROM kna1 INTO TABLE test UP TO 10 ROWS.
    CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
      EXPORTING
        i_field_seperator    = '!'
        i_line_header        = 'X'
        i_filename           = e_file
        i_appl_keep          = 'X'
      TABLES
        i_tab_sap_data       = test
      CHANGING
        i_tab_converted_data = itab_txt
      EXCEPTIONS
        conversion_failed    = 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.
    OPEN DATASET e_file
    FOR OUTPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    LOOP AT itab_txt INTO itab_line.
    TRANSFER itab_line TO e_file.
    ENDLOOP.
    CLOSE DATASET e_file.
    Thanks on advance.
    David Fúnez
    Corp. Mandofer
    Tegucigalpa, Honduras

    Hi;
    I'm trying to create a TXT file separated by '!', i found this example below in this forum but it doesn´t create the .TXT file in C:. ¿what am i doing wrong?.
    I already tryied GUI_DOWNLOAD and creates the .TXT file, but it's not what i really need because can´t separete the data by '!',  and the data appears separated by long spaces.
    Example:
    TYPE-POOLS: truxs.
    DATA: itab_txt TYPE truxs_t_text_data,
    itab_line LIKE LINE OF itab_txt.
    DATA: test TYPE kna1 OCCURS 0 WITH HEADER LINE.
    DATA: e_file LIKE rlgrap-filename VALUE 'c:     est2.txt'.
    SELECT * FROM kna1 INTO TABLE test UP TO 10 ROWS.
    CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
      EXPORTING
        i_field_seperator    = '!'
        i_line_header        = 'X'
        i_filename           = e_file
        i_appl_keep          = 'X'
      TABLES
        i_tab_sap_data       = test
      CHANGING
        i_tab_converted_data = itab_txt
      EXCEPTIONS
        conversion_failed    = 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.
    OPEN DATASET e_file
    FOR OUTPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    LOOP AT itab_txt INTO itab_line.
    TRANSFER itab_line TO e_file.
    ENDLOOP.
    CLOSE DATASET e_file.
    Thanks on advance.
    David Fúnez
    Corp. Mandofer
    Tegucigalpa, Honduras

  • Need to Add Field Name to the Downloaded XLS file

    Im using the function SAP_CONVERT_TO_TXT_FORMAT
    and downloading the contents by sending them as attachements in email.
    I need to add field names(column name) to excel fields.
    So that when fields are displayed in excel file they are displayed by their column names..
    How do I do this.? Any ideas.
    Answers will be rewarded with points..

    Hi
    You can manually insert the column names as the first row in your internal table to have them in .xls file as headers.
    Regards,
    Raj

  • Forward excel attachment  to  the  user-defined  mail id

    Hello  Everybody
    i  hv  collect all data into the ITAB and want to transfer that data to  excel format and send that  excel file as an attachment to  the   user-defined  mail id  .
    Input  on selection-screen 
    SELECTION-SCREEN : BEGIN OF BLOCK B1 .
    PARAMETERS  :  MAILID(255)  TYPE C .
    SELECTION-SCREEN : END OF BLOCK B1 .
    plz suggest me 
    ASAP

    Hi Sandeep,
    EMAIL as EXCEL ATTACJEMENTS
    Refer the following codes ..
    Hope this will help you..
    TYPE-POOLS: truxs.
    DATA t5 LIKE t005t OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    SELECT * INTO TABLE t5
    FROM t005t
    WHERE spras = sy-langu.
    DATA wa_data TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
    EXPORTING
    i_line_header = 'X'
    TABLES
    i_tab_sap_data = t5
    CHANGING
    i_tab_converted_data = wa_data
    EXCEPTIONS
    conversion_failed = 1
    OTHERS = 2.
    DATA stmp(4096) TYPE c.
    DATA itmp TYPE i.
    LOOP AT wa_data INTO stmp.
    itmp = STRLEN( stmp ).
    stmp+itmp = cl_abap_char_utilities=>cr_lf.
    MODIFY wa_data FROM stmp.
    ENDLOOP.
    PERFORM send_email.
    *& Form send_email
    FORM send_email .
    DATA docs LIKE docs OCCURS 0 WITH HEADER LINE.
    DATA excelsize TYPE i.
    DATA excel LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA doc LIKE sodocchgi1.
    DATA excelln TYPE i.
    DATA int_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA int_objhead LIKE solisti1 OCCURS 2 WITH HEADER LINE.
    DATA int_objtext LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA int_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA bodyln LIKE sy-tabix.
    DATA output_data TYPE ssfcrescl.
    excel[] = wa_data[].
    excel table sizes
    DESCRIBE TABLE excel LINES excelln.
    Body Email
    int_objtext-line = 'Test Body'.
    APPEND int_objtext.
    DESCRIBE TABLE int_objtext LINES bodyln.
    READ TABLE int_objtext INDEX bodyln.
    CLEAR doc.
    doc-doc_size = ( bodyln - 1 ) * 255 + STRLEN( int_objtext ).
    doc-obj_name = ' '.
    doc-sensitivty = 'P'.
    doc-proc_syst = sy-sysid.
    doc-proc_clint = sy-mandt.
    CLEAR: int_objpack, int_objpack[].
    int_objpack-transf_bin = ' '.
    int_objpack-head_start = 1.
    int_objpack-head_num = 0.
    int_objpack-body_start = 1.
    int_objpack-body_num = bodyln.
    int_objpack-doc_type = 'RAW'.
    int_objpack-obj_descr = 'Test'.
    APPEND int_objpack.
    CLEAR: int_objhead, int_objhead[].
    int_objhead = 'Attachment'.
    APPEND int_objhead.
    int_objpack-transf_bin = 'X'.
    int_objpack-head_start = 1.
    int_objpack-head_num = 0.
    int_objpack-body_start = 1.
    int_objpack-body_num = excelln.
    int_objpack-doc_size = excelsize.
    int_objpack-doc_type = 'XLS'.
    int_objpack-obj_name = 'excel'.
    int_objpack-obj_descr = 'test.xls'. "File name
    APPEND int_objpack.
    Set Receiver
    int_reclist-receiver = 'SAPUSER'.
    int_reclist-rec_type = 'B'.
    int_reclist-notif_del = 'X'.
    int_reclist-notif_read = 'X'.
    int_reclist-notif_ndel = 'X'.
    int_reclist-express = 'X'.
    APPEND int_reclist.
    doc-obj_descr = 'Report in Excel'.
    Sending Email
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = doc
    put_in_outbox = 'X'
    commit_work = 'X'
    TABLES
    packing_list = int_objpack
    object_header = int_objhead
    contents_bin = excel
    contents_txt = int_objtext "Body
    receivers = int_reclist
    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.
    ENDFORM. " send_email
    Note:
    - If you are using FM SAP_CONVERT_TO_TXT_FORMAT you will not be able to execute this program in the background.
    - dont forget to change 'SAPUSER' to your SAP user ID
    - you can check the email by using tcode 'SBWP'.
    Reward points if this Helps.
    Manish

  • Unable to read excel attachment received thru email using function module ?

    Hi...
    I am using the function module 'SO_DOCUMENT_SEND_API1' to send an email attachement in EXCEL format.
    The email is getting received along with the attachment, but when i try to open the excel file, i am getting an error stating "Unable to Read File"......
    What could be the reason behind this error.......
    Plz Help......

    Hi,
    Firstly, convert Excel Format with FM: SAP_CONVERT_TO_TXT_FORMAT ,
    " Format convert(Excel content)
      CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
        EXPORTING
          I_LINE_HEADER        =  'X'
        TABLES
          I_TAB_SAP_DATA      = GIT_DATA                     "Before convert
        CHANGING
          I_TAB_CONVERTED_DATA = GIT_EXCEL           "After convert
      LOOP AT GIT_EXCEL INTO LFC_STMP.
        LI_ITMP = STRLEN( LFC_STMP ).
        LFC_STMP+LI_ITMP = CL_ABAP_CHAR_UTILITIES=>CR_LF.
        MODIFY GIT_EXCEL FROM LFC_STMP.
      ENDLOOP.
    Then, send Email with .xls attachment via FM: SO_DOCUMENT_SEND_API1.
    Best Regards
    Lily

  • Download chinese text from internal table to PC text file

    Hi Experts,
      Iam downloading internal table (which is having records in chinese text) on to PC file. But the iam not getting correct text in the pc file. Iam getting some garbage values text.
    Iam using GUI_download FM to donwload the text.
    Iam using internal table
    Begin of itab occurs 0,
    text type string,
    end of itab.
    and passing paramters.
    Filename
    codepage
    table.
    Can you please tell me how can I achive this and what are the parameter need to pass for this.
    Thank In Advance.

    Hi,
    You can use follwoing  funtion modules instead of GUI_DOWNLOAD. It will be more easier.
    SAP_CONVERT_TO_CSV_FORMAT
    SAP_CONVERT_TO_TEX_FORMAT
    SAP_CONVERT_TO_TXT_FORMAT
    SAP_CONVERT_TO_XLS_FORMAT
    SAP_CONVERT_TO_XML_FORMAT.
    I hope this will help you out.
    Help children of U.N World Food Program by rewarding  points and encourage others to answer your queries.

  • Use of i_tab_raw_data parameter in FM ''TEXT_CONVERT_XLS_TO_SAP''

    Hello Experts,
    I have usesd above Fm in my program and passing i_tab_raw_data parameter as blank.
    But don't know the reason of passing i_tab_raw_data parameter.
    Can some1 suggest why do we need to pass this param / blank......
    Thanks,
    Anoop Bhandari

    Hi,
    It is part of the fixed parameter interface of the functions : SAP_CONVERT_TO_*_FORMAT where * can be CSV,XML,TXT,XLS.
    It is used only in SAP_CONVERT_TO_TXT_FORMAT.
    The parameter interface is kept same for all such FMs to maintain central logic and dynamicity, therefore it is found in SAP_CONVERT_TO_XLS_FORMAT although never used there.
    Regards,
    Ashish

  • Convert structure into single field in string  in unicode system .

    Hi all
    i need to convert whole structure in single fields which is string format
    plese refer this code .....this is structure which i want to use in concatenate statement
    statement is
    CONCATENATE EXPORTSTRING HFTP_ZSD_RKFR  CR_LF INTO EXPORTSTRING.
    where data are ...
    EXPORTSTRING type xstring
    CR_LF              type x
    structure HFTP_ZSD_RKFR having follwing fields
    MANDT     MANDT     CLNT     3     0
    VBELN_VL     VBELN_VL     CHAR     10     0
    LFDNUM     LFDNUM     NUMC     3     0
    VKORG     VKORG     CHAR     4     0
    VSTEL     VSTEL     CHAR     4     0
    VSBED     VSBED     CHAR     2     0
    KUNAG     KUNAG     CHAR     10     0
    KUNWE     KUNWE     CHAR     10     0
    SPDNR     SPDNR     CHAR     10     0
    LFDAT     LFDAT     DATS     8     0
    LFUHR     LFUHR     TIMS     6     0
    WADAT     WADAT     DATS     8     0
    TRAID     TRAID     CHAR     20     0
    ROUTE     ROUTE     CHAR     6     0
    WERKS     WERKS_D     CHAR     4     0
    MATNR     MATNR     CHAR     18     0
    LFIMG     LFIMG     QUAN     13     3
    MEINS     MEINS     UNIT     3     0
    ANZPK     ANZPK     NUMC     5     0
    ANZPK     ANZPK     NUMC     5
    KBETR     KBETR     CURR     11
    KPEIN     KPEIN     DEC     5
    KMEIN     KMEIN     UNIT     3
    KWAER     KWAER     CUKY     5
    KWERT     KWERT     CURR     13
    BELNR     BELNR_FI     CHAR     10
    GJAHR     GJAHR     NUMC     4
    MWSKZ     MWSKZ     CHAR     2
    SAKNR     SAKNR     CHAR     10
    BUKRS     BUKRS     CHAR     4
    BUDAT     BUDAT     DATS     8
    KOSTL     KOSTL     CHAR     10
    AUFNR     AUFNR     CHAR     12
    PRCTR     PRCTR     CHAR     10
    BRGEW     BRGEW     QUAN     13
    GEWEI     GEWEI     UNIT     3
    XBILL     ZSD_XBILL     CHAR     1
    XPARK     ZSD_XPARK     CHAR     1
    XPARK     ZSD_XPARK     CHAR     1
    XBLNR     XBLNR     CHAR     16
    KHERK     ZSD_KHERK     CHAR     1
    LIFEX     LIFEX     CHAR     35
    SDABW     SDABW     CHAR     4
    KBETR_MAUT     KBETR     CURR     11
    KPEIN_MAUT     KPEIN     DEC     5
    KMEIN_MAUT     KMEIN     UNIT     3
    KWERT_MAUT     KWERT     CURR     13
    KBETR_OEL     KBETR     CURR     11
    KPEIN_OEL     KPEIN     DEC     5
    KMEIN_OEL     KMEIN     UNIT     3
    KWERT_OEL     KWERT     CURR     13
    KBETR_PAL     KBETR     CURR     11
    KPEIN_PAL     KPEIN     DEC     5
    KMEIN_PAL     KMEIN     UNIT     3
    KWERT_PAL     KWERT     CURR     13
    KBETR_VAT     KBETR     CURR     11
    KPEIN_VAT     KPEIN     DEC     5
    KPEIN_VAT     KPEIN     DEC     5
    KMEIN_VAT     KMEIN     UNIT     3
    KWERT_VAT     KWERT     CURR     13
    BLDAT     BLDAT     DATS     8
    MWS_BETRG     WRBTR     CURR     13
    KURSF     KURSF     DEC     9
    UVK06          CHAR     1

    I have used this FM
    SAP_CONVERT_TO_TXT_FORMAT
    There's also a method in cl_abap_char_utilities to convert a structure to a C container, look for it, I only have 4.6C here and that class is only in ECC

  • Email Excel attachment with a BOLD row

    hi!
    My requirement is that data in an internal table should be sent as an attachment in an email. There are a few records in the internal table which needs to be in bold(i have the logic to figure out whichones). I am using the below FM  .
    CALL FUNCTION 'SO_OBJECT_SEND'
       EXPORTING
         object_hd_change                 = wa_object_hd
         object_type                       = 'RAW'
       TABLES
         objcont                          = i_text
         receivers                        = i_recv
         packing_list                     = i_packing_list
         att_cont                         = i_att
    Does any body have any idea how to bold a few records in the excel attachment?
    I appreciate your suggestions.
    Thanks,
    manasa
    Message was edited by:
            manasa

    Hi Manasa,
    The Code below is for sending Excel attachment in email. Not sure for BOLD...
    You can copy and paste the following codes and execute..
    Hope this will help you..
    TYPE-POOLS: truxs.
    DATA t5 LIKE t005t OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    SELECT * INTO TABLE t5
    FROM t005t
    WHERE spras = sy-langu.
    DATA wa_data TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
    EXPORTING
    i_line_header = 'X'
    TABLES
    i_tab_sap_data = t5
    CHANGING
    i_tab_converted_data = wa_data
    EXCEPTIONS
    conversion_failed = 1
    OTHERS = 2.
    DATA stmp(4096) TYPE c.
    DATA itmp TYPE i.
    LOOP AT wa_data INTO stmp.
    itmp = STRLEN( stmp ).
    stmp+itmp = cl_abap_char_utilities=>cr_lf.
    MODIFY wa_data FROM stmp.
    ENDLOOP.
    PERFORM send_email.
    *& Form send_email
    FORM send_email .
    DATA docs LIKE docs OCCURS 0 WITH HEADER LINE.
    DATA excelsize TYPE i.
    DATA excel LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA doc LIKE sodocchgi1.
    DATA excelln TYPE i.
    DATA int_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA int_objhead LIKE solisti1 OCCURS 2 WITH HEADER LINE.
    DATA int_objtext LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA int_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA bodyln LIKE sy-tabix.
    DATA output_data TYPE ssfcrescl.
    excel[] = wa_data[].
    excel table sizes
    DESCRIBE TABLE excel LINES excelln.
    Body Email
    int_objtext-line = 'Test Body'.
    APPEND int_objtext.
    DESCRIBE TABLE int_objtext LINES bodyln.
    READ TABLE int_objtext INDEX bodyln.
    CLEAR doc.
    doc-doc_size = ( bodyln - 1 ) * 255 + STRLEN( int_objtext ).
    doc-obj_name = ' '.
    doc-sensitivty = 'P'.
    doc-proc_syst = sy-sysid.
    doc-proc_clint = sy-mandt.
    CLEAR: int_objpack, int_objpack[].
    int_objpack-transf_bin = ' '.
    int_objpack-head_start = 1.
    int_objpack-head_num = 0.
    int_objpack-body_start = 1.
    int_objpack-body_num = bodyln.
    int_objpack-doc_type = 'RAW'.
    int_objpack-obj_descr = 'Test'.
    APPEND int_objpack.
    CLEAR: int_objhead, int_objhead[].
    int_objhead = 'Attachment'.
    APPEND int_objhead.
    int_objpack-transf_bin = 'X'.
    int_objpack-head_start = 1.
    int_objpack-head_num = 0.
    int_objpack-body_start = 1.
    int_objpack-body_num = excelln.
    int_objpack-doc_size = excelsize.
    int_objpack-doc_type = 'XLS'.
    int_objpack-obj_name = 'excel'.
    int_objpack-obj_descr = 'test.xls'. "File name
    APPEND int_objpack.
    Set Receiver
    int_reclist-receiver = 'SAPUSER'.
    int_reclist-rec_type = 'B'.
    int_reclist-notif_del = 'X'.
    int_reclist-notif_read = 'X'.
    int_reclist-notif_ndel = 'X'.
    int_reclist-express = 'X'.
    APPEND int_reclist.
    doc-obj_descr = 'Report in Excel'.
    Sending Email
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = doc
    put_in_outbox = 'X'
    commit_work = 'X'
    TABLES
    packing_list = int_objpack
    object_header = int_objhead
    contents_bin = excel
    contents_txt = int_objtext "Body
    receivers = int_reclist
    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.
    ENDFORM. " send_email
    Note:
    - If you are using FM SAP_CONVERT_TO_TXT_FORMAT you will not be able to execute this program in the background.
    - dont forget to change 'SAPUSER' to your SAP user ID
    - you can check the email by using tcode 'SBWP'.
    Reward points if this Helps.
    Manish

Maybe you are looking for

  • Aligning the end of a cutaway

    Hi iMovie '11 How does one go about aligning the end of a cutaway (and it's corresponding audio) such that a transition can be added to the end?  No matter how I cut it, the transition is ghosted (and doesn't work). Wisdom appreciated!  Thanks!

  • Can I use a shortcut to mark/unmark all my books in Itunes prior to synchronizing?

    I have more than 3.000 books on my Ipad. What is the quickest way to remove them from the Ipad, but not from ITunes?

  • Import folder and automatically create a playlist

    I've have a folder which contains about 100 songs. I want to import this folder into iTunes and also have iTunes create a playlist for me at the same time I import. Is this possible? I didn't want all the songs to get imported into the Music Library

  • SOLVED: modprobing powernow-k8 fails

    Hello, Since I updated the linux-kernel to 3.2.8-1 modprobing the kernel module powernow-k8 fails with: ERROR: could not insert 'powernow_k8': Exec format error /var/log/messages.log: mperf: disagrees about version of symbol module_layout Could anyon

  • DIME format for handling SOAP attachments

    Hi all, There is a proposal (I think by Microsoft) called the Direct Internet Message Encapsulation (DIME) format to handle SOAP attachments. This is a binary format which defines how to construct a single message with multiple payloads and it is sup