Internal table to XLS to email

Hi,
A lot of postings here and on other SAP communities are talking about email and attachment issues. But a proper answer to my problem i haven't found yet.
Problem : i'm having an internal table (with text, amount, currencies, dates, so different formats) and i want to send it as a 'real' excel file (not as tab delimited or csv file, but as real excel with the correct formats) to an email receiver. The columns with amount and currencies should work correctly after opening the file in Excel.
The main problem is to convert the internal table to an binary internal table (max record length 255) of type excel. By the way, i also need it in background.
I don't know if the MIME format is binary, but a convert from internal table to MIME (corresponding to the excel attachment) is also possible ?
regards,
Hans
[email protected]

Sorry for the late answer.
You don't need a WAS java stack to run a java programm on your server.
Follow these steps:
1) Install a java runtime environment (jre) on the filesystem of your server (take care of rights for executing)
2) Write a java programm on your pc, that uses an excel library mentioned before. It should get a source filename as parameter. Deploy it to your server. Write a batch command to execute the program like this "java your_program your_parameter"
3) Extract your tabulary data from within abap and write it to a csv - file (comma separated value) on your server
4) Send an event from within abap (uh oh)
5) On event, call a batch command from within your server OS and run the java program with the filename you created before (uh oh).
As you can see, it's is not easy to do that, but it should work. In my opinion, it is a very ugly way to solve the problem.
I don't know, if abap supports a SPAWN routine like C or C++. This could be an easier way to call a program on your server from within abap.
On a WAS 640 there is a java stack if you to install it. There you can implement a java based utility service (servlet) that converts your data to excel.
Another opinion: Use another j2ee servlet server (i.e. apache tomcat, works fine, no license fee). You can install it on your sap server or on another maschine.
Good luck and kind regards,
Andreas

Similar Messages

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • Send internal table to pdf and then email.

    hi experts.
    i want to send my alv data or any other data like internal table in pdf through email.
    anybody help me out plz.

    Hi Harris,
    You got to use two FMs to achieve this.
    First one to get the contents in to an internal table
    Second one to send an e-mail with the content selected already.
    So, better search SDN to get more info...

  • To send an Internal Table Content as email with type 'XLS'

    Hi,
    I have an Internal Table with 1000 records and would like to send them as an email with type as EXCEL.
    Please share your experience.
    Thank You,
    Tk.
    Moderator Message: Please (re)search before posting your question.
    Edited by: Suhas Saha on Nov 11, 2011 10:44 AM

    Hi,
    Please check below link. This will give you many examples to do that.
    [http://www.google.com.au/search?q=site%3Asap.comsendexcelasattachment&ie=utf-8&oe=utf-8]
    Thanks.
    Ravi

  • Internal Table attached as Excel file to an eMail - BCS_EXAMPLE_7 for UC

    Hi forums,
    SAP provided an example report to send out internal tables attached as an Excel file to a recipients eMail address. I attached the coding of the BCS_EXAMPLE_7 programm to this thread.
    report bcs_example_7.
    This report provides an example for sending an Excel
    attachment in Unicode Systems
    constants:
      gc_tab  type c value cl_bcs_convert=>gc_tab,
      gc_crlf type c value cl_bcs_convert=>gc_crlf.
    parameters:
      mailto type ad_smtpadr
       default 'john.doe(a)crazy-company.com'.                    "#EC *
    data send_request   type ref to cl_bcs.
    data document       type ref to cl_document_bcs.
    data recipient      type ref to if_recipient_bcs.
    data bcs_exception  type ref to cx_bcs.
    data main_text      type bcsy_text.
    data binary_content type solix_tab.
    data size           type so_obj_len.
    data sent_to_all    type os_boolean.
    start-of-selection.
      perform create_content.
      perform send.
    *&      Form  send
    form send.
      try.
        -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
        -------- create and set document with attachment ---------------
        create document object from internal table with text
          append 'Hello world!' to main_text.                   "#EC NOTEXT
          document = cl_document_bcs=>create_document(
            i_type    = 'RAW'
            i_text    = main_text
            i_subject = 'Test Created By BCS_EXAMPLE_7' ).      "#EC NOTEXT
        add the spread sheet as attachment to document object
          document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with mailto.
          else.
            message s022(so).
          endif.
      ------------ exception handling ----------------------------------
      replace this rudimentary exception handling with your own one !!!
        catch cx_bcs into bcs_exception.
          message i865(so) with bcs_exception->error_type.
      endtry.
    endform.                    "send
    *&      Form  create_content
    Create Example Content
    1) Write example text into a string
    2) convert this string to solix_tab
    form create_content.
      data lv_string type string.
      data ls_t100 type t100.
    as example content we use some system messages out of t100
    get them for all installed languages from db
    and write one line for each language into the spread sheet
    columns are separated by TAB and each line ends with CRLF
      concatenate 'This Is Just Example Text!'                  "#EC NOTEXT
                  gc_crlf gc_crlf
                  into lv_string.
    header line
      concatenate lv_string
                  'MSGID'    gc_tab
                  'MSGNO'    gc_tab
                  'Language' gc_tab                             "#EC NOTEXT
                  'Text'     gc_crlf                            "#EC NOTEXT
                  into lv_string.
    data lines
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '182'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '316'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
    convert the text string into UTF-16LE binary data including
    byte-order-mark. Mircosoft Excel prefers these settings
    all this is done by new class cl_bcs_convert (see note 1151257)
      try.
          cl_bcs_convert=>string_to_solix(
            exporting
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
              iv_add_bom  = 'X'     "for other doc types
            importing
              et_solix  = binary_content
              ev_size   = size ).
        catch cx_bcs.
          message e445(so).
      endtry.
    endform.                    "create_content
    NOTES:
    UTF-16LE including the BOM (Byte order mark)
    is preferred by Microsoft Excel. If you want to create
    other binary content you may choose another codepage (e.g.
    '4110' (UTF-8) which is standard for e-mails).
    Find SAP codepage names in the drop down list
    for the codepage setting of node SMTP in transaction SCOT.
    Or: leave iv_codepage and iv_add_bom empty. Then the target
    codepage is set according to SAPconnect settings
    Important:
    SAP neither guarantees that the attachment created
    by this report can be opened by all Excel Versions nor
    that it can be opened by any 3rd party software at all
    Best regards to you
    Thorsten Hüser
    SAP CRM Senior consultant
    arvato / Bertelsmann

    Hi forums,
    SAP provided an example report to send out internal tables attached as an Excel file to a recipients eMail address. I attached the coding of the BCS_EXAMPLE_7 programm to this thread.
    report bcs_example_7.
    This report provides an example for sending an Excel
    attachment in Unicode Systems
    constants:
      gc_tab  type c value cl_bcs_convert=>gc_tab,
      gc_crlf type c value cl_bcs_convert=>gc_crlf.
    parameters:
      mailto type ad_smtpadr
       default 'john.doe(a)crazy-company.com'.                    "#EC *
    data send_request   type ref to cl_bcs.
    data document       type ref to cl_document_bcs.
    data recipient      type ref to if_recipient_bcs.
    data bcs_exception  type ref to cx_bcs.
    data main_text      type bcsy_text.
    data binary_content type solix_tab.
    data size           type so_obj_len.
    data sent_to_all    type os_boolean.
    start-of-selection.
      perform create_content.
      perform send.
    *&      Form  send
    form send.
      try.
        -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
        -------- create and set document with attachment ---------------
        create document object from internal table with text
          append 'Hello world!' to main_text.                   "#EC NOTEXT
          document = cl_document_bcs=>create_document(
            i_type    = 'RAW'
            i_text    = main_text
            i_subject = 'Test Created By BCS_EXAMPLE_7' ).      "#EC NOTEXT
        add the spread sheet as attachment to document object
          document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with mailto.
          else.
            message s022(so).
          endif.
      ------------ exception handling ----------------------------------
      replace this rudimentary exception handling with your own one !!!
        catch cx_bcs into bcs_exception.
          message i865(so) with bcs_exception->error_type.
      endtry.
    endform.                    "send
    *&      Form  create_content
    Create Example Content
    1) Write example text into a string
    2) convert this string to solix_tab
    form create_content.
      data lv_string type string.
      data ls_t100 type t100.
    as example content we use some system messages out of t100
    get them for all installed languages from db
    and write one line for each language into the spread sheet
    columns are separated by TAB and each line ends with CRLF
      concatenate 'This Is Just Example Text!'                  "#EC NOTEXT
                  gc_crlf gc_crlf
                  into lv_string.
    header line
      concatenate lv_string
                  'MSGID'    gc_tab
                  'MSGNO'    gc_tab
                  'Language' gc_tab                             "#EC NOTEXT
                  'Text'     gc_crlf                            "#EC NOTEXT
                  into lv_string.
    data lines
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '182'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '316'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
    convert the text string into UTF-16LE binary data including
    byte-order-mark. Mircosoft Excel prefers these settings
    all this is done by new class cl_bcs_convert (see note 1151257)
      try.
          cl_bcs_convert=>string_to_solix(
            exporting
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
              iv_add_bom  = 'X'     "for other doc types
            importing
              et_solix  = binary_content
              ev_size   = size ).
        catch cx_bcs.
          message e445(so).
      endtry.
    endform.                    "create_content
    NOTES:
    UTF-16LE including the BOM (Byte order mark)
    is preferred by Microsoft Excel. If you want to create
    other binary content you may choose another codepage (e.g.
    '4110' (UTF-8) which is standard for e-mails).
    Find SAP codepage names in the drop down list
    for the codepage setting of node SMTP in transaction SCOT.
    Or: leave iv_codepage and iv_add_bom empty. Then the target
    codepage is set according to SAPconnect settings
    Important:
    SAP neither guarantees that the attachment created
    by this report can be opened by all Excel Versions nor
    that it can be opened by any 3rd party software at all
    Best regards to you
    Thorsten Hüser
    SAP CRM Senior consultant
    arvato / Bertelsmann

  • Displaying the contents of internal table- in email Step of workflows

    Hello Folks,
    I wanted to display the contents of an internal table ( would contain a list of opportunites ), in an email sent throught the workflow:
    My idea was to LOOP AT <ITAB> into <WA> from an external program and then call the workflow for each content of the <WA>. This will be a problem as, if there are like 1000 records in the internal table, then workflows will be called 1000 times...sending 1000 emails..
    My requirement is that we need to send a single email to the single person, displaying the content of the internal table in the email body......
    My question
    1) Is this scenario possible through worflows ?
    2) If not, please provide an alternative ..
    Thanks
    Anand

    Do you mean to say that just by inserting the multiline element
    within the body of the 'Send email' step type, the contents
    of the multiline element is displayed automatically without
    we having to loop at it somehow ?
    Follow the below apporach,
    1. First create a multiline container element in the workflow conatiner.
    2. Populate the internla table , by using the bor methods and pass back the populated ITAB to the WF by using the binding concept.
    3. Now create a mail step in the workflow, you have the option of inserting the workflow container elements into the mail conten, so insert the multiline container element , then it prompts to select the option like a) Do you liek to display only first line b) Display the ITAB line by line c) Display ITAB lines continuously with out line break.
    4. based upon the requirement select any one of the options.
    Note: Make sure the line length of the ITAB won't excced 132 charecters, because the send mail step will consider only 132 characters.

  • XLS from Application server in background mode to internal table

    Hi,
    I need to transfer the content of an excel file in the application server to an internal table while running my program in background. My file is xls, cant use csv. For dataset bin mode, I need to know how to transfer the data to my internal table, already searched on forum but didnt find answer, at least not for background..
    ow, I am using v6 here
    about the ALSM_EXCEL_TO_INTERNAL_TABLE, I get the upload_ole error all the time, and with TEXT_CONVERT_XLS_TO_SAP, conversion_failed all the time too...
    here is the code, just the load part and data declaration:
    REPORT zbeto.
    TYPE-POOLS: truxs.
    TYPES:
    BEGIN OF y_cot,
    text1(12) TYPE c,
    text2(12) TYPE c,
    text3(12) TYPE c,
    text4(12) TYPE c,
    text5(12) TYPE c,
    END OF y_cot.
    DATA: it_datatab TYPE STANDARD TABLE OF y_cot,
    wa_datatab TYPE y_cot,
    it_raw TYPE truxs_t_text_data.
    DATA:
    v_file TYPE rlgrap-filename,
    begin_col TYPE i VALUE '1',
    begin_row TYPE i VALUE '2',
    end_col TYPE i VALUE '5',
    end_row TYPE i VALUE '102',
    t_ctmp TYPE y_cot OCCURS 0 WITH HEADER LINE,
    t_xls TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    PERFORM f_load_xls.
    FORM : f_load_xls
    FORM f_load_xls.
    v_file = '
    ZSAPDEV\SAPDEVINTERF$\COTACAO\TESTE.XLS'.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = v_file
    i_begin_col = begin_col
    i_begin_row = begin_row
    i_end_col = end_col
    i_end_row = end_row
    TABLES
    intern = t_xls
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 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.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    i_line_header = 'X'
    i_tab_raw_data = it_raw " WORK TABLE
    i_filename = v_file
    TABLES
    i_tab_converted_data = it_datatab[] "ACTUAL DATA
    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.
    t_ctmp[] = it_datatab[].
    ENDFORM. "f_load_xls
    both FM arent working, and when I try to execute in background mode, before anything, I recieve the following error:
    Message text:
    Error during import of clipboard contents
    Message class:
    ALSMEX
    Message no.:
    037
    Message type:
    A
    and without the ASLM FM, the TEXT_CONVERT give me the conversion_failed exception...
    the directories are right, that I am sure, because I just copy&paste it from CG3Z/CG3Y when I uploaded and downloaded to
    check the file in the server...
    am I missing something?
    thanks again,
    Roberto Macedo
    (PS: I made another topic because none replied the other in 4 days and wasnt solved yet)

    Hi!
    You didn't find answer for this, because it is not possible. If you run your program in background, it is running on the server, and does not have any connection to your local machine. That's why you can't upload/download in background mode.
    You might try to address somehow your local PC, with its IP or MAC address, but I don't think does this task worth so much time.
    Run your program in online mode, or if you want to run it in background, then upload your file into the SAP server.
    Regards
    Tamá

  • Upload .xls file in internal table in web dynpro abap

    Hi everyone,
    i want to upload .xls(excel file) into an internal table.....after lots of attempts i came to a conclusion that web dynpro only supports .CSV(another format of excel file) to be uploaded into internal table....i tried many ways....is there a way i can upload .xls file...kindly help me in the same. following is the code i m using
      DATA LO_EL_CONTEXT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA LS_CONTEXT TYPE WD_THIS->ELEMENT_CONTEXT.
      DATA ITEM_FILE TYPE WD_THIS->ELEMENT_CONTEXT-EXCEL_UPLOAD.
      get element via lead selection
      LO_EL_CONTEXT = WD_CONTEXT->GET_ELEMENT( ).
      @TODO handle not set lead selection
      IF LO_EL_CONTEXT IS INITIAL.
      ENDIF.
      get single attribute
      LO_EL_CONTEXT->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `EXCEL_UPLOAD`
        IMPORTING
          VALUE = ITEM_FILE ). "xstring format
    DATA S_CONT TYPE STRING.
    DATA CONVT TYPE REF TO CL_ABAP_CONV_IN_CE.
    DATA: FIELDS1 TYPE STRING_TABLE.
    1st tried this code-> using "cl_abap_conv_in_ce"
    CALL METHOD cl_abap_conv_in_ce=>create
    EXPORTING
    *encoding = c_encoding "optional
    input = ITEM_FILE
    RECEIVING
    conv = CONVT.
    CALL METHOD CONVT->read
    IMPORTING
    data = S_CONT.
    when it didnt work out...then tried followin function module
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          IN_XSTRING        = ITEM_FILE "xsrting
       IMPORTING
         OUT_STRING          = S_CONT
    TYPES: BEGIN OF TY_TAB,
           NAME_CHAR TYPE  STRING,
           DESCR_CHAR TYPE  STRING,
           NUMBER_DIGITS TYPE  STRING,
           END OF TY_TAB.
    DATA: FIELDS TYPE STRING_TABLE.
    DATA: LV_FIELD TYPE STRING.
    DATA: S_TABLE TYPE STRING_TABLE.
    DATA: ITAB TYPE TABLE OF TY_TAB.
    DATA: STR_ITAB TYPE TY_TAB.
    *splits string based on new line
    SPLIT S_CONT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE S_TABLE.
    FIELD-SYMBOLS: <WA_TABLE> LIKE LINE OF S_TABLE.
    LOOP AT S_TABLE ASSIGNING <WA_TABLE>.
    splits string on basis of tabs
      SPLIT <WA_TABLE> AT ',' INTO
                      STR_ITAB-NAME_CHAR
                      STR_ITAB-DESCR_CHAR
                      STR_ITAB-NUMBER_DIGITS.
      APPEND STR_ITAB TO ITAB.
    ENDLOOP.
    I am able to do the uploading if the file is in .CSV format and not .XLS format....
    there are lots of forums on SDN for the same....but at the end there is no solution provided.....
    experts kindly solve it this time...thanks in advance

    Hi,
    It is not possible to upload an xls file because it will be having some binary characters. better to go with .csv file format.
    Refer this [link too|Re: Excel File Uplaod] it will explain you clearly.
    Regards
    Arun.P

  • I am using GUI_DOWNLOAD FM to download my internal table entries into .xls

    Hi
    I am using GUI_DOWNLOAD FM to download my internal table entries into .xls file. but it's not download total records in final table.
    in debugging it showing total records.
    exporting:
    filename
    filetype
    field-suprater
    header
    tables
    data_tab
    fieldnames
    plz help me.
    thanks
    Sankar

    Hi
    Use as below:
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
    EXPORTING
    file_name = p_file " path offile where u need to download
    CREATE_PIVOT = 0
    DATA_SHEET_NAME = ' '
    PIVOT_SHEET_NAME = ' '
    PASSWORD = ' '
    PASSWORD_OPTION = 0
    TABLES
    PIVOT_FIELD_TAB =
    data_tab = int_data "internal table with data
    fieldnames = int_head "internal table with header
    EXCEPTIONS
    file_not_exist = 1
    filename_expected = 2
    communication_error = 3
    ole_object_method_error = 4
    ole_object_property_error = 5
    invalid_filename = 6
    invalid_pivot_fields = 7
    download_problem = 8
    OTHERS = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Sreeram

  • Upload excel file (xls) into internal table in SRM 4.0

    Hi experts!
    I need upload a xls file into internal table (in ABAP report) in EBP machine for i work with data in the sheets. Can you help me?
    Best Regard!

    Hi Zeky,
    Try GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES
    or FM ALSM_EXCEL_TO_INTERNAL_TABLE
    Please look at this threads too:
    /people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table
    Upload XLS file from Application server into internal table.
    Regards,
    Marcin Gajewski
    please reward points for helpful answers

  • Problem In Integrating 3 Internal Tables to make data for email attachment

    Hi All,
    I am facing a problem. I am having some data in 3 internal tables. Consider it Header Data, Details Data, Tail Data in 3 different Internal tables with different Fields.
    Now I want to send this data as an attachment in email. Now the problem is I am integrating the data in 3 internal tables into 1 single internal table with the help of  following code :
    loop at it1.
        concatenate it1-field1
                           it1-field2
            into itab.
            append itab.
    endloop.
    loop at it2.
        concatenate it2-field1
                           it2-field2
            into itab.
           append itab.
    endloop.
    similarly for 3rd internal table. But here it goes wrong.
    For each and every field in each record, some specific number of characters are fixed. If any field doesn't uses those characters to complete, it has to leave the remaining characters blank and should start next field from there.
    E.g.
    Like record is :
    AAA reserved chars : 10
    XXX " " : 15
    YYY " " : 8
    so it should print like :
    AAA XXX YYY .
    But in attachment it is printing like :
    AAAXXXYYY.
    This is because I am using concatenate function. Please suggest me a way to integrate the data of 3 internal tables into a single internal table including the spaces reserved for each field.
    Thanks.

    Hi Ravi,
    Did u try to use de addicion 'Separated by space'  in the concatenate function?
    If it doesn't work, try this...
    You have to do as if you want to create a text file, using de offset function.
    Creating an internal table with one field and put all the records of your tables into this internal table.
    data: wa_line(400).
    data: begin of itab_line occurs 0,
               line(400),
            endif itab_line.
    Loop at itab1.
    clear wa_line.
    write: itab1-field1 to wa_line+0(10).
    write: itab1-field2 to wa_line+10(8).
    write: itab1-fieldN to wa_line+nn(mm).
    append wa_line to itab_line.
    clear itab_line.
    endloop.
    Do the same with itab2 and itab3.
    Cheers,
    FC.

  • XLS multiple Sheet Data Upload to Internal Tables

    Hi All,
    Required one help.
    There are many FMs which are Uploading XLS to Internal Tables.
    But is there any function module, which picks up the data from All the sheets available in XLS file,
    and Upload it to Internal Table.
    Thanks,
    Jimit Vadher

    hi Vinodh,
    I m not getting any value.
    Pl. find the code.
      DATA : value TYPE string.
      DATA : e_value TYPE UAB_TEXT.
        TRY.
        CALL METHOD CL_UA_EXCEL_TOOLS=>READ_CELL_FROM_LOCAL_FILE
          EXPORTING
            ID_PATH  = 'D:\Approved BP 10-11.xls'
           ID_SHEET =
           ID_CELL  =
           ID_ALIAS =
          RECEIVING
            ED_VALUE = e_value.
         CATCH CX_UA_FORMULA_EXCEPTION .
        ENDTRY.
          WRITE : e_value.
    pl. guide.
    thanks,
    Jimit

  • Email internal table as zip file

    Hello everyone
    I spent several days to have a full example on how to convert an internal table has ZIP file than send it by email.
    I found several example to upload file from the OS and than convert it to ZIP to save it after. But nothing from the current internal email.
    So, for the benefit of everybody who that can interrest, here is the code I did. Feel free to optimize it and post the new version here.
    ===========================================
    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    ==========================================
    Regards
    dstj
    Edited by: Rob Burbank on Feb 12, 2010 2:09 PM

    Hello Daniel,
    Thank you very much for this post, it is quite helpful. However, I have followed your template very closely and my file will not send. I am not an advaned ABAP programmer, but have a good knowledge of programming in general...here's a bit of my code related to this...
    *-Create table body
      LOOP AT (internal table) INTO (structure)
      (Fill lv_line with one line of string based on structure)
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            text = lv_line
          IMPORTING
            buffer = lv_xline
        CONCATENATE lv_xcontent lv_xline INTO lv_xcontent IN BYTE MODE.
      ENDLOOP.
    *-Create zip xstring
      CREATE OBJECT lo_zipper.
      CALL METHOD lo_zipper->add
        EXPORTING
          name = 'AHReport.zip'
          content = lv_xcontent.
      CALL METHOD lo_zipper->save
        RECEIVING
          zip = lv_xzipcontent.
    *-Convert zip xstring to binary
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer = lv_xzipcontent
        TABLES
          binary_tab = lt_data.
    *-    Add attachment     
          TRY.
            CALL METHOD l_document->add_attachment
                EXPORTING
                  i_attachment_type = 'ZIP'
                  i_attachment_subject = 'Report'
                  i_att_content_hex = lt_data.
            CATCH cx_document_bcs.
          ENDTRY.
    Any help would be very much appreciated, ty.

  • Uploading data from xls file to internal table

    Hello,
         I have an excel file with just one column that has phone numbers. I want to upload these phone numbers into an internal table.
        Now my question is: What is the method/function to do this? I tried GUI_UPLOAD but after upload the values in the internal table shows lots of # signs instead of the expected phone numbers.
    Regards,
    Prafful.

    Hello Prafful,
    If you successed to upload XLS into Internal Table and the only problem you have is a # signs try to the following:
    1) instead of the XLS file try to use CSV file (it's a TEXT file - C omma S eperated V alues).
    2) Check your Encoding (your FILE Encoding should be a same as GUI_UPLOAD encoding)
    Good Luck
    Eli Steklov

  • Problem with Emailing the Internal table data as an excel attachment

    Hi Friends,
    I am facing problem with Emailing an internal table data as an excel file. I am using standard function module "SO_NEW_DOCUMENT_ATT_SEND_API1" which is using SOLI structure can have record with 255 character length. But my Internal table having each record means after concatenating all the fields it is going to be morethan 450 characters. so i t is not displaying all the data in excel file.
    Can somebody help me if there is any other function module or any other way that i need to follow.
    thanks for help
    venkat.

    You must use the the :
    CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as a field seperator and
    CL_ABAP_CHAR_UTILITIES=>CR_LF as a record seperator.
    Check this example:
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Java Stored Procedure in EXECUTE IMMEDIATE

    Hi, I need advice for the following. I'm on Oracle 11g R2. I'm testing application in Oracle 11gR1 and R2 and Oracle Express. Purpose is to generate XML reports. I have PLSQL Stored Procedure which does that, but since there is bug in Oracle11gR2 rel

  • Changing IDOC control record by XSL Mapping

    Hi, I am using scenario: legacy -> XI -> R/3. In the first step I am mapping XML -> IDOC. I have to map the field "SERIAL" in idoc control record in EDI_DC40 (idoc control record structure) with a constant. When I view the message in XI monitor. I ca

  • Transferring Voicemail and Locked texts from Samsung Alias 2 to iPhone 5

    I am about to upgrade from a samsung alias 2 to an iPhone 5 and want to transfer voicemails and locked text messages over.  Can anyone help me figure out how to do this? Thanks

  • TS2755 I cannot download my book purchases?

    I cannot download books that have been purchases, though it worked before.

  • Custom exit variable for fiscal year/period

    Hi BI Experts 1) In one of the column i just want Budget data to be displayed for the entire year..i.e even if the user enters 005/2006 for fiscal year /period that column should display 001/2006 to 012/2006 Budget. I have created a restricted KF for