Send an attachment in email with length more than 255 char per line

Hi All,
I have to send an attachment in email with length more than 255 char per line. I dont want to break the line after 255 char and add it in another line.
Please suggest me any function module which can perform this.
Thank you all.

I looked at all threads in the forum, there was about 5 or 6 identical questions, but surprise, nobody knows! It seems that SO_NEW_DOCUMENT_ATT_SEND_API1 function module does not allow more than 255 characters by line.
It would surprise me a lot if there is no workaround !
As it is very easy to add any binary attachment which is like a very long line, PDF for example (several kilobytes), via the function module above (lots of examples in the forum), I would advise you to try to use the same way, i.e. use the contents_bin parameter instead of the contents_txt parameter (convert the text into binary) and add the line feeds yourself (okay I know, it's not very smart).
Last thing, this function module is deprecated, and we should use BCS classes, maybe they work better.

Similar Messages

  • How can i send an email with subject more than 50 char.

    Hi
    Can you please explain How can i send an email with subject more than 50 char?? I am using Cl_BCS=>SET_MESSAGE_SUBJECT but it is throwing an error " An exception of the type CX_SY_REF_IS_INITIAL has occured which is not caught" .
    Regards
    Alok

    Try using the following FM
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = i_mail_data
            put_in_outbox              = c_x
          TABLES
            packing_list               = i_objpack[]
            object_header              = i_objhead[]
            contents_bin               = i_objbin[]
            contents_txt               = i_objtxt[]
            receivers                  = i_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.
    Regards
    Avinash
    Edited by: Avinash Jagtap on Dec 2, 2009 7:00 AM
    Edited by: Avinash Jagtap on Dec 2, 2009 7:02 AM

  • How can i see the URL which has  length more than 255 chars in fucnction

    Hello Every body....
      I am facing one problem....I have a function module which returns URL in one table
      but in the function module display i am able to see only 255 characters,but the URL is more than 255 Characters..How can i see the URL which has the length more than 255 characters..
    In the Table the fields url length is 4000 chars.....
    but display it is showing only 255 chars.....
    Please Help me...??????????

    Hello,
    Have you tried breaking your structure into 255 chunks? I don't know what the structure you are moving from looks like, but you should be able break it back up into the SOLI structure. The end of a line in SOLI doesn't create a Carriage Return/Line Break. You have to insert these yourself like in the following:
    * Create document
          clear mail_line.
          move 'This is a test E-Mail'(d01) to mail_line.
          concatenate mail_line
                      cl_abap_char_utilities=>newline
                      into mail_line.
          append mail_line to l_mailtext.
    What kind of attachment are you wanting to create - a text tab delimited file for reading in a spreadsheet application such as excel? You might try reassembling your data table into a single string with newlines where you need them. Then use function module SCMS_STRING_TO_FTEXT to turn it back into SOLI. This is what I have done in the past. I'm afraid without knowing more about your source structure and attachment type, this is about all I can tell you.
    Vasanth

  • Sending Emails with Attachments greater than 255 chars in 4.6C

    Hi,
    I have a requirement in which i have to send mails with attachments greater than 255 characters. The attachment would be a tab-delimited .TXT file. Since i am working on 4.6C, i don't have the luxury of using the FM 'SCMS_STRING_TO_FTEXT'.
    It's very urgent. So any help in this regards would be greatly appreciated.
    Thank you.
    Balaji

    Hi,
    Internal table to be passed to SOLIST1 type int, table and then compress this table using fm "table_compress" with the compressed table then call fm "table_decompress" and pass this to function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    Keep in mind the following variable
    i_packing_list-transf_bin = 'X'.
    aRs

  • Attach xls file with more than  255 chars

    Hi all,
    I'm trying to send an .xls file as attachement whose row contains more than 255 chars with FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    When preparing the attached table, I tried to separate the tables like this:
    loop at itab.
      concatenate itab-col_1 itab-col_2 itab-col_3 into it_attach
        separted by cl_abap_char_utilities=>horizontal_tab.
      append it_attach.
      concatenate itab-col_4 itab-col_5 itab-col_6 into it_attach
        separted by cl_abap_char_utilities=>horizontal_tab.
      append it_attach.
      concatenate IT_ATTACH cl_abap_char_utilities=>newline into it_attach.
      append it_attach.
    endloop.
    I am able to send this xls as attachment, but when open it in excel/notepad,
    it is so strange that there are so many spaces before the contents itab-col_4 which is unexpected.
    It is expected that the file is tab-delimited with continuous column 1-6.
    Any things went wrong?
    Many Thanks!

    Thanks.
    I tried the first method to convert the byte to string, but a short dumps is resulted,
    DATA: con_tab TYPE x,
               sep TYPE string.
    con_tab = '09'.
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
                EXPORTING
                  in_xstring = con_tab
                IMPORTING
                  out_string = sep.
    so I use back my original method to concatenate the columns as suggested, i.e.
    concatenate itab-col_1 tab itab-col_2 tab itab-col_3 tab into it_attach
    append it_attach.
    concatenate itab-col_4 tab itab-col_5 tab itab-col_6 into it_attach.
    append it_attach.
    concatenate it_attach cl_abap_char_utilities=>newline into it_attach.
    append it_attach.
    but the outcome is still the same, i.e. ...many leading space before itab-col_4
    any more ideas? Many Thanks

  • Uploading excel file into internal table with field length more than 255

    I am trying to upload the data from an excel file through function module 'TEXT_CONVERT_XLS_TO_SAP'.
    I have tested by changing the field type from string, and char2000.
    But it is accepting only 255 chars from the cell content.
    How to get the total content of the field if it is more than 255 char.

    hi,
      you can use any of the following procedures:
    For uploading data from excel to internal table refer standard report  RC1TCG3Z  in se38 :
                                               or
    You can use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' itself. Please check if you have done it this way . But,  this FM can be a little time consuming if the excel has large data, so you can use the FM u2018GUI_UPLOADu2019.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
            EXPORTING
              filename                = p_file1
              i_begin_col          = l_b1
              i_begin_row        = l_c1
             i_end_col               = l_b2
             i_end_row             = l_c2
           TABLES
              intern                  = lt_data
            EXCEPTIONS
             inconsistent_parameters = 1
            upload_ole              = 2
              OTHERS                  = 3.
          IF sy-subrc <> 0.
            MESSAGE e018 DISPLAY LIKE 'i'.
         ENDIF.
    *---Removing the first heading fields from the file.
          IF NOT lt_data[] IS INITIAL.
            LOOP AT lt_data INTO lwa_data WHERE row = '0001'.
              DELETE lt_data.
              CLEAR lwa_data.
            ENDLOOP.
    *---Inserting the data from file the internal table
            LOOP AT lt_data INTO lwa_data.
              CASE lwa_data-col.
                WHEN 1.
                  wa_file_wicopa-serial = lwa_data-value.
                WHEN 2.
                  wa_file_wicopa-blart = lwa_data-value.
                WHEN 3.
                  wa_file_wicopa-bldat = lwa_data-value.
                WHEN 4.
                  wa_file_wicopa-budat = lwa_data-value.
              ENDCASE.
              AT END OF row.
                APPEND wa_file_wicopa TO gt_file_wicopa.
                CLEAR wa_file_wicopa.
              ENDAT.
              CLEAR lwa_data.
            ENDLOOP.
          ENDIF.
        ENDIF.
                                                or
    DATA: it_test TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE.
    DATA :v_start_col TYPE i VALUE '1',
          v_start_row TYPE i VALUE '1',
          v_end_col TYPE i VALUE '256',
          v_end_row TYPE i VALUE '65536',
          v_text TYPE repti.
    * Funtion Module to upload values from excel to the Internal table
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = v_start_col
          i_begin_row             = v_start_row
          i_end_col               = v_end_col
          i_end_row               = v_end_row
        TABLES
          intern                  = it_test
        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.
                             Or
    You can use FM u201CTEXT_CONVERT_XLS_TO_SAPu201D.
    DATA : i_raw TYPE truxs_t_text_data.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator          = 'X'
          i_tab_raw_data             = i_raw
          i_filename                 = p_path
        TABLES
          i_tab_converted_data       = itab
    EXCEPTIONS
       conversion_failed          = 1
       OTHERS                     = 2
    hope it will help u
    regards
    rahul

  • Hlp reqd: Urgent!!!! An Excel attachment Having recs more than 255 char len

    Hi.. I am using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1" for sending a outlook mail with excel sheet as an attachment.
    The records having length upto 255 chars are coming properly in diff rows(which means the carriage return is considered).
      But when records have more than 255 chars, then the chars exceeding 255 length are coming in a single row of excel sheet which means the carraige returns are not considered.
    Hope my issue is explained clearly....request every one to provide the solution as early as possible.
    Regards
    Nanda

    Hi Nanda,
    build your XLS internal table X as usual (more then 255 char). Then format the table
    X to a new one Y with line size 255. (You can do your own routine or use the FM SWA_STRING_FROM_TABL  and  SWA_STRING_TO_TABLE in sequence; sorry but I'm on 4.6C and didn't find a FM in order to format directly the internal table from line size XXXX to the desired line size).
    sample code:
    t_att_tab with line size 4000 containing the excell data with carriage return and so on
    objbin with line size 255 used in FM SO_NEW_DOCUMENT_ATT_SEND_API1
        data: d_string type string.
        call function 'SWA_STRING_FROM_TABLE'
          exporting
            character_table                  = t_att_tab
      NUMBER_OF_CHARACTERS             =
            line_size                        = 4000
      KEEP_TRAILING_SPACES             = ' '
      CHECK_TABLE_TYPE                 = ' '
         importing
           character_string                 = d_string
         exceptions
           no_flat_charlike_structure       = 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.
        call function 'SWA_STRING_TO_TABLE'
          exporting
            character_string                 = d_string
      APPEND                           = ' '
            line_size                        = 255
      CHECK_TABLE_TYPE                 = ' '
         importing
           character_table                  = objbin
      TOTAL_LENGTH                     =
      LINE_SIZE_USED                   =
      LINES_FILLED                     =
      LAST_LINE_LENGTH                 =
         exceptions
           no_flat_charlike_structure       = 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.
    It works!!!
    Paolo

  • How to display more than 255 chars in background job with ALV Grid ????

    Hi All,
    I am using ALV grid with OO.
    I have used call screen for ALV grid display. I have to display more than 255 characters in width. While running it, I can see the list perfectly.
    But in background mode, the list is truncated after 255 chars.
    Can anybody help how to send complete list(width more than 255 chars) to spool.
    Thanks and Regards,
    Neha

    Hi SAP fan,
    <b>YES you can run the ALV report in background mode.
    To run the report in background do F9 instead of F8, then give immediate and save.
    Now goto Sm35 goto job overview and view the job listed
    Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.
    To see this the job should be in the finished status.
    How to define Periodic Jobs
    1.Execute transaction SM36
    2.Define Job name, Job class, Target server
    3.Click on 'START CONDITION' button
    4.Click on 'Date/Time' button
    5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
    6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
    7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
    8.Click on 'Job overview' button or execute SM37 transaction.
    9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
    10.You will now see all your scheduled JOBS.
    <b>Case: 2</b>
    You can Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
                    RECEIVING e_offline = off.
        IF off IS INITIAL.
          CREATE OBJECT g_custom_container
                 EXPORTING container_name = g_container.
        ENDIF.
    <b>Case: 3</b>
    if you are using OO ALV.
    Just before creating the custom container check for the following condition.
    Batch or Web Reporting
    IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    CREATE OBJECT o_custcontainer
    EXPORTING
    container_name = lc_custcontrol
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6
    ENDIF.
    You can see the output in Spool in transaction SP01.</b>
    Good Luck and thanks
    AK

  • A field to be displayed in portal legth of 3 and r/3 more than 255 char

    Hi all,
    Kindly give me reply, I need to display one structure in portal, in this one field is of length 255 char.
    Need to change it to more than 255 characters but it should be display in portal as 3 or 5 char length only, can accept more than 255 char lengtjh.
    thanks & regards,
    Chandra sekhar.

    Hi Chandra sekhar,
    A similar kind of a probelm is explained in the link below:
    Link:
    The other requirement of displaying it as 3 - 5 chararcter field in portal can be done by creating the iView as required.
    Regards,
    Pranav.

  • How to transfer data more than 255 char from excel sheet to internal table.

    Hello Experts,
    I have a requirement where i have a text field in the excel sheet of more than 255 char and need to be updated in the text element. To do that i need to transfer the excel sheet data to an internal table where one of the field is more than 255 char.
    in the standard function module it works only upto 255 char. Can you help me if we have some other way to get more than 255 char in the internal table from excel sheet.
    Thanks in Advance.
    BR,
    RaJ.

    Using .xls, it is not possible transfer data more than 255 characters from excel sheet. However if the excel sheet is saved as Comma Delimited format or Tab Delimited format, then using GUI_DOWNLOAD function module data more than 255 characters can be transferred.
    File name should be : .csv (Comma Delimited format)  or .txt (Tab Delimited format)
    File Type would still remain 'ASC' while calling function module GUI_DOWNLOAD
    Also In the internal table declare the field type as String or LCHAR.
    Eg:
    TYPES: begin of ty_file,
            col_a TYPE string,
          end of ty_file.
    DATA: i_file type standard table
                   of ty_file
                 with header line
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      =  'C:\test.csv'
      TABLES
        DATA_TAB                      = i_file

  • Is it possible to create a Large Text Field in OCOD, more than 255 Char?

    Is it possible to Create a Long Text Field (more than 255 Char Long) as like Description field in OCOD?

    Not at this time.

  • Is it possible to Create a Long Text Field (more than 255 Char Long)?

    Is it possible to Create a Long Text Field (more than 255 Char Long) as like Description field in Service Request Object??
    Thanks!

    Hi
    User can only create custom Long text field (255 Charcter) . Currently system does not support custom note creation

  • Sending mail with excel  more than 255 character in a line

    Dears,
    In my program , I use SO_NEW_DOCUMENT_ATT_SEND_API1  to send email with EXCEL attacment.
    But when i want output a line more than 255 characters  in the excel I met the problem, it only appeared 255 characters
    describe table mailbin lines tab_lines.
        mailpack-transf_bin = c_checked.
        mailpack-head_start = 1.
        mailpack-head_num = 1.
        mailpack-body_start = 1.
        mailpack-body_num = tab_lines.
        mailpack-doc_type = c_xls.
        mailpack-obj_name = space.
        mailpack-obj_descr = lv_mail_title. "the excel file name
        mailpack-doc_size = tab_lines * 255.
        append mailpack.
    * Sending the document
          call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            exporting
              document_data              = maildata
              put_in_outbox              = space
              commit_work                = c_checked
            tables
              packing_list               = mailpack
              object_header              = mailhead
              contents_bin               = mailbin
              contents_txt               = mailtxt
              receivers                  = mailrec
            exceptions
              too_many_receivers         = 1
              document_not_sent          = 2
              operation_no_authorization = 4
              others                     = 99.
    But i have to output those characters in one line.
    Anyone could help me?
    Thanks a lot.
    Sincerely,
    Julie

    data: objpack    like sopcklsti1 occurs 2 with header line.
    data: objhead    like solisti1 occurs 1 with header line.
    data: objbin     like solisti1 occurs 10 with header line,
            is_objbin  type  solisti1 .
    data: objtxt     like solisti1 occurs 10 with header line,
            is_objtxt  type solisti1 .
      data: l_tab(1)   type c value cl_abap_char_utilities=>horizontal_tab,
           con_cret   type c value cl_abap_char_utilities=>cr_lf.
    data: tab_lines  like sy-tabix,
            : tab_lines1 like sy-tabix.
      data : lenth_string type string,
            s_string     type string.
    data : L type i, i type i,cplen type i, balance type i,
    before describe table mailbin lines tab_lines ... Use below logic.
    Loop at your_internaltable.
    concatenate field_1
                field_2
                field_3
           into lenth_string separated by l_tab.
    concatenate  lenth_string con_cret into lenth_string.  
    concatenate s_string lenth_string into s_string.
    endloop.
           L = strlen( s_string ).
           i = 0.
           cplen = 255.
           balance = l.
        do.
          if balance <= 0.
            exit.
          endif.
          if balance < 255.
            cplen = balance.
          else.
            cplen = 255.
          endif.
          objbin = s_string+i(cplen).
          i = i + cplen.
          balance = balance - cplen.
          append objbin.
        enddo. 
    ...... after this use ur exesting code....describe table mailbin lines tab_lines and so
        describe table objbin lines tab_lines1.
        clear objpack-transf_bin.
        objpack-transf_bin = ' '.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines1.
        objpack-obj_langu = 'E'.
        objpack-doc_type = 'XLS'.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        exporting
    -tables
          packing_list               = objpack
          object_header              = objhead
          contents_bin               = objbin
          receivers                  = reclist
    Regards,
    Sri.
    Edited by: sridhar arjunan on Jul 28, 2009 4:22 PM
    Edited by: sridhar arjunan on Jul 28, 2009 4:23 PM

  • @ FM to send email with width greater than 128 chars

    Hi
    Is there a FM which would send an e-mail with width greater than 128 chars.
    Z-Send_email_attachemnt would limit the witdth to 128 char due to table EMAIL_TEXT LIKE table BTCXPGLOG.
    BTCXPGLOG- field- Message(128)
    Thanks.

    Hi,
    look in SE38 with BCS_EXAMPLE_*
    I can use 255 char.
    Regards, Dieter

  • LINK TO URL FOR SENDING MAIL Doesnot work if more than 255 chars

    Hi Experts ,
    I am Using Link to URL to open the mail browser with details passed as below
    lv_refr = mailto:<mail_addr>?Subject=<subjectof mail>&body=<text of the mail>.
    Above one works fine as long as  length is LE 255 chars
    if length lv_refr GE 255 does not work any more . I have body (Mail text) more than 500 chars . How can go about this issue ?
    Please reply
    Patil

    >
    Matt Ferguson wrote:
    > Hi Thomas
    >
    > Got a guestion! pertaining to this URL cutting off in emails.
    >
    > The situation is that we have a workflow in which a task sends out email, in the email the URL does not display the whole link.
    > Can you help me display the whole URL when the workflow send out the EMAIL. 
    >
    > regards
    > MAtt
    The same solution that I suggested above applies here. Build your email message as a single string.  Line lenght won't matter.  Then convert the string to the binary table.  The binar table won't be restricted to 255 character line lenghts - and in fact wont' care about line lenghts at all.  Your long URL in your hyperlink will be fine.

Maybe you are looking for

  • Why Photos in "Events from my Mac" are not in order?

    I am currently running iOS 8.1.1 on an iPhone 6 with 128GB on AT&T.  My iMac is running OS X 10.10.1 and iPhoto is at version 9.6 (everything up to date). As you might be able to see, when I go to "Events from My Mac" in the Photos app on my iPhone,

  • How to modify a flash document

    Can someone give me any guidance on how to modify an existing flash document? We need to be able to change the images that are associated with the buttons. Also, we need to be able to add new buttons to the document and link images to them. Any help

  • Http Get + Timeout Functionailty?

    Hi all, I am planning to do a HTTP/S POST and GET and wondered if there is a way of specifiying a timeout on the GET. So I do the Get and if after x minutes no value has been returned from the webserver then the timeout says ok move onto the next Get

  • Safari History does not clear

    I can't seen to clear URL history in Safari. I have clicked "clear history" in the history menu, and also "reset safari" in the safari menu. History appears cleared, but entering a part of a URL brings up URL history! Powerbook G4   Mac OS X (10.4.5)

  • Observable and ActionListener.. help

    Is there anyway to pause update method and continue after I click the �Add Student� button? The update method is called automatically when my observable object is changed, so I can�t display previous observable information via the button�s ActionList