Carriage Returns in Message Area

Hi,
I am using a hidden field "P6_SUBMIT_MESSAGE" to store a message that gets generated from a PL/SQL process. I then use the following trick to display that same message in the message area at the top of my page
Process success message
&P6_SUBMIT_MESSAGE.
How can I get carriage returns into this message. I have tried adding chr(10), chr(13) and even '<'br'>' in the PL/SQL process but no luck. If I use chr(13) and my P6_SUBMIT_MESSAGE is a Textarea (not a Hidden field) I can see the desired results in that text area but even then, the carriage returns are not propagated to the message area at the top of the page.
Thanks

I know this is not my thread but i just wanted to say, thanks scott! this works! i'm having the same problem as Robert and tried every possible way like he did with the ch(10) and < b r >... but did not realize to change the page item type, i had it as text area also. Now i changed it to display text (does not save state) and used < b r > for carriage return... it works like a charm!
Thanks again,
Marilyn

Similar Messages

  • How to remove carriage returns in message mapping

    Hi Experts,
    I am getting carriage returns in one of the source field, i need to remove those carriage returns and i need to pass it to target field, can anyone suggest me how can i achieve this.

    Hello,
    Are you getting only CR or CR+LF (line feed) ?
    In this case - CRLF - you can use content conversion in your sender adapter:
    <recordset_structure>.fieldSeparator = 'nl'
    So in your receiver adapter you can replace any special char by 'nl' again.
    Check these links.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
    Regards,
    Diego Estanguini Gabriel

  • Carriage Return for text area

    Hello All,
    I have a text area that I am pre-populating from a column in a database and I need to do a carriage return. When inserting the information into the column I put 'chr( 10 )|| chr( 13 )||' after each place where I need to do a carriage return, for some reason it is not being saved in the database that way.
    The sql I used to insert the information into the column looks like:
    update 456.xyz
    set 123 = a || chr( 10 )|| chr( 13 )||
    b || chr( 10 )|| chr( 13 )||
    c || chr( 10 )|| chr( 13 )||
    where abc=def;
    I need the output in the text area to be:
    a
    b
    c
    But it populates as:
    abc
    Any help would greatly be appreciated!

    I just tested this code:
    select 'The date '||sysdate||chr(10)||'is a '||to_char(sysdate, 'DAY')||chr(10)||chr(13)||'Week :'||to_char(sysdate, 'WW') from dual;The output was:
    The date 03.06.2010
    is a TORSDAG
    Week :22I put this in the source of the textarea and set it to update and replace content ( source used always )
    Edited by: Olav Alexander Mjelde on Jun 3, 2010 1:17 PM

  • Carriage returns are replaced by blank space in SOAP message.

    Hi,
    i am using SOAP request based website. i am using the weblogic webservices. when we sent any SOAP request to the server, if the SOAP xml message contains any carriage returns(new lines) are replaced by a single balnk space.
    i have a requirement where user can enter details in multiple lines. but by the time when it readched server, the SOAP xml message has changed. all the carriage returns are repalced by a blank space.
    Can you please help how to solve this issue.
    Thanks
    subba.

    What are your trying to accomplish?
    I'm thinking you are trying to get a several 'fields' together as a single 'string'. In which case I'd simply concat the fields together like
    SELECT a, b||' '||c ...
    to create a single string with "contents of b space contents of c"
    If you are trying to get one hundred and one blanks, of make a field 101 characters wide with blank padding, then you want to look in the SQL Reference manual for things like lpad, rpad and trim.

  • Write to spreadsheet adds carriage return

    I am using build array function to put together a number of strings and build an array of strings.  The build array is in a while loop.  A new line is added to the array every loop.  I am using write to spread sheet function to save the spreadsheet to a file with xls extension.  For some reason, a carriage return is inserted within the array.  The array has 9 columns and a carriage return is put after the fourth column.  I have not added this carriage return.  Does anyone know why write to spreadsheet might automatically add a carriage return and how to remove it?  
    Thank you!
    Solved!
    Go to Solution.

    Hi,
    I took your posted VI and compiled it to an exe.  I do not see the carriage return problem you are describing?
    If you compile the VI you attached, do you see the problem or is it only in the original main application (that you cannot share)?
    If the compiled exe works on your PC, does it also work on the 'different' computer where you see the issue with your original code?  
    -If it does work, then the issue must be in the source code for your original code.  Sometimes, if you re-size string constants, for example, it can be hard to see carriage return's.
    Another thing it could be perhaps, is if you are calling the "write spreadsheet" in two different places in your main code, then the way it works is it will write your two (different) input arrays to separate lines.  If it is as in your example VI though, there should be no carriage return in the "middle" of the array.
    For debug purposes, you could consider making a VI that takes a 1D string array input, iterates over each element in the array and searches for the carriage return character and gives an error/message on what iteration it found it, then you can back-track from there to see in the code responsible for making the string that went into that index.
    QFang
    CLD LabVIEW 7.1 to 2013

  • What is escape character for for Carriage Return, Line Feed, Form Feed

    Hi
    I need to a text file which should have following characters
    Carriage Return, Line Feed, Form Feed
    How do i insert them in a string
    i know "\f" is carriage return,
    but what are characters for line feed and form feed
    Ashish

    uncle_alice wrote:
    jverd wrote:
    remus.dragos wrote:
    I forgot that it does not exist in Java. A good thing
    from my point of view.Running the following makes my computer beep.
    public class Bell {
    public static void main(String... args) {
    System.out.println("\u0007");
    Sure, sending a BEL character to the console rings the bell, but that has nothing to do with Java. Anyway, I think he meant Java doesn't support the \a escape sequence in string and char literals.
    >
    >
    >I forgot that it does not exist in Java. A good thing
    from my point of view.
    Running the following makes my computer beep.
    public class Bell {
    public static void main(String... args) {
    System.out.println("\u0007");
    } Sure, sending a BEL character to the console rings the bell, but that has nothing to do with Java. Anyway, I think he meant Java doesn't support the \a escape sequence in string and char literals.
    Ah, I thought he was saying Java doesn't support ringing the bell.

  • Carriage Return ignored in ABAP Created HTML?

    We are in the pre-production box for an upgrade.
    We have ABAP source code that generates HTML logic. It worked fine in 4.6.
    The carriage return/line feeds are being ignored.
    I have already tried all the cl_abap_char_utilities=>NEWLINE
                                              cl_abap_char_utilities=>CR_LF
                                              cl_abap_char_utilities=>FORMFEED.....and more
    I've tried the conversion utilities also.
    When we look in the debugger we see the cr_lf values as ##, and 0d000a00 in hex, which should work, right?
    But, when we view the source code on the web page - where arrays are not being built because the crlfs are being ignored- we can see that when the html is being written, the crlfs are ignored and the html is all over the place, unformatted.
    I am thinking there must be a another HTML Function Module that might be available to format the html table before sending it out thru WWW_HTML_MERGER. Again, even in debug everything look good, but when it writes it to the URL the crlfs are ignored?
         Any suggestions?

    Becuase you enter your patterns as expressions where some characters are used as control characters, and then have to esacpe some of the control characters in the expressions when you enter them as java strings.
    So the expression is actually \r\n if you let a user enter it into a textfield, but you have to escape the \ if you write it as a String in the source code (since \ is an escape characters in strings)
    /Kaj

  • How can i put three carriage returns (ENTERs) in this script's output?

    I have a script like
    begin
    select tablename list;
    dbms_output.put_line(q'[Altering selected tables' datalength]' );
    for i in 1..x loop
       execute immediate v_sql;
    end;While executing this in SQL*Plus, the output currently looks like
    Altering selected tables' datalength
    ALTER TABLE EMP MODIFY (ENAME VARCHAR2(30 CHAR ))
    ALTER TABLE DEPT MODIFY (DEPTNO VARCHAR2(30 CHAR ))
    ALTER TABLE ARCHIVE_CNG  MODIFY (TMAT_ENABLED CHAR(30 CHAR ))
    .But i need three ENTERs (Carriage Returns) after the text Altering selected tables' datalength.
    ie the output should look like
    Altering selected tables' datalength
    ALTER TABLE EMP MODIFY (ENAME VARCHAR2(30 CHAR ))
    ALTER TABLE DEPT MODIFY (DEPTNO VARCHAR2(30 CHAR ))
    ALTER TABLE ARCHIVE_CNG  MODIFY (TRIGGER_ENABLED CHAR(30 CHAR ))
    ALTER TABLE ARCHIVE_CONFIG MODIFY (USER_ID VARCHAR2(30 CHAR ))
    .

    user659394 wrote:
    What is the difference between a carriage return and a newline ? Aren't they both the same?
    Edited by: user659394 on May 13, 2009 10:28 AMThey are different characters, one is chr(13) and the other is chr(10). Many editors will treat them the same but by default, when you hit the Enter key on your keyboard the character generated depends on your operating system
    Mac chr(13), unix chr(10), windows chr(13)||chr(10)
    That's basically the difference between an ascii and a binary transfer between machines with different operating systems. In a binary transfer nothing is changed in the transfer. In an ascii transfer carriage return/newline characters are converted to the default for the operating system.

  • Carriage returns in OAException message

    Hi,
    I am creating an OAException message based on a String;
    String exceptionMessage = "";
                if (pageContext.getParameter("OrgId").isEmpty()) {
                    exceptionMessage = "Please select a valid Organisation";
                if (pageContext.getParameter("BankAccountNum").isEmpty()) {
                    exceptionMessage =
                            exceptionMessage + "\nPlease select a valid Bank Account";
    throw new OAException(exceptionMessage, OAException.ERROR);
    Is it possible to have carriage returns in an exception message? I have added /n within the String, however it is not showing a carriage return when running it?
    Kind Regards
    Carl

    If you are using message dictionary you can put carriage returns easily.(Whenever you are raising any error message, as per standards you should use message dictionary. You can change the message text without touching the java code).
    Here are the steps
    1) Create a message named XXX_YOUR_MESSAGE using Application Developer responsibility with your custom message. Make sure you set the application(as per below example I am using Human Resources) of the message properly as it needs to be referred in your java code
    2) Just write below code where ever you want.
                OAException myOAException = new OAException("PER", "XXX_YOUR_MESSAGE", null, OAException.ERROR, null); //You can even use OAException.ERROR or OAException.WARNING etc. Just explore the class OAException for further options.
                throw myOAException;
    So as per the message you set, it will display carriage returns. You can even use HTML tags I guess but I never tried.
    If you want to set tokens in your message you can use below code
           MessageToken[] arrayOfMessageToken = new MessageToken[] { new MessageToken("MY_TOKEN", "My Token Text") };
           OAException myOAException = new OAException("PER", "XXX_YOUR_MESSAGE", arrayOfMessageToken, OAException.ERROR, null);
           throw myOAException;
    Regards,
    Peddi.

  • Ignore carriage return in a text area

    Hi
    I've a JTextArea of 3 rows on an applet screen.
    I want to disable the carriage return key on the text area.
    Thanx in advance

    Look at the API documentation for JTextField; it contains an example of a class called UpperCaseField. You could modify this code to ignore line-end characters; the concept works with JTextArea as well as JTextField. This code would prevent people from pasting line-end characters as well as from keying them.

  • Carriage return  in a HTML AREA

    i have an HTML where i have put some line of text.
    But in the BOX of creation AREA i vie the line feed (carriage return =, but whe i see it on running it write all without carriage return .
    There ia way to soove this problem ??
    Thank's !

    ok, work very well !!
    Thank's'!

  • Carriage Returns, Line Feeds, and Tabs in Text Area

    I am having users copy and paste data from an Excel spreadsheet into a textarea on a BSP page.  When they submit this, since there are tabs and line feeds in the data, the BSP does not recognize the data.  The value in the field comes through as blank. When I manually type something into this field, with out any carriage returns, tabs, etc., the value does not come through as blank?  Does anybody know how to get around this?

    HI
    Iam uploading the data from application server(AL11) to other server.
    In the GLPCA-SGTXT(Table) iam having some text like 'This is good ##'.i was downloded some other data with this text('This is good ##') by using report program in to aplicationserver(AL11) and from there iam uploading that data into other server.
    But here the problem is in the UNIX, it was showing some problem.
    That is actually it need to show the format like:
    001 256 786 This is good## 459786
    But here it was showing like:
    001 256 786 This is good^M
    459786
    So here '459786' is coming to next line. But i need this '459786' also in the same line.
    I am not sure if it is possible to remove CR and LF's using the code the program is written in, but that is what we need to do.   In Unix  ^M is the CR (Carriage return), but I am not sure what LF is?

  • How does one replace carriage returns (enter key) in text areas

    I have an address text area in one of my pages where end users are hitting enter after each part of the address. I want to replace the carriage return hex('0A') with spaces. How can I do that?

    If you're manually saving your data, you can just change your insert/update code as below:
    insert into myTable
    (myCol)
    values
    (replace(:PXX_MY_TEXT_AREA, Chr(10), ' '))
    where ...If you're building a page where you aren't directly saving your data, you can add an "on Submit/Before Computation" process that does something like:
    :PXX_MY_TEXT_AREA := replace(:PXX_MY_TEXT_AREA, Chr(10), ' ');

  • Carriage returns in a textarea are not being stored ??

    Hello developers,
    Ive been looking a couple hours for a solution but cant find it.
    In my app users enter text into a textbox like im doing now.
    When i want to display the text it has lost the carriage returns.
    Im using tomcat and mysql here.
    A solution to deal with the returns ?

    Super thanx, kinda stupid of me i once used that <pre> a couple years ago..
    Its working fine now execpt for the fact tha i have one space before the text starts
    Like this
    sfslfj
    sfsafa
    afsasff
    produced by this code
    <sql:query var="empList" scope="session">
              SELECT * FROM vragen
              ORDER BY vraagnr ASC
         </sql:query>     
         <table width="90%" border="1">
         <c:forEach items="${empList.rows}" var="row">
    <tr>      
    <td border ="0"><c:out value="${row.vraagnr}"/> <td/></tr>
    <tr><td> <pre> <c:out value="${row.vraag}"/> </pre>
         </td>
         </tr>
         </c:forEach>
         </table>

  • Help needed with Carriage Return in Unicode system

    Hi Experts,
    we have an issue with one of our programs regarding the carriage return that is used when creating a csv file. This issue has only came about because of the recent upgrade to ECC6.
    The main change to the program was the redefinition of the line feed variable.
    Existing statement was --> DATA: v_lf TYPE x VALUE '0D'.
    This was then replaced with
    New statement --> DATA: v_lf type c VALUE cl_abap_char_utilities=>cr_lf.
    Since this change has been implemented, the csv file that is created and sent on as an attachment via the function SO_NEW_DOCUMENT_ATT_SEND_API1 is now not displayed correctly.
    When looking at the attachment in trn SOST, a message is also displayed saying the file is not in a recognizable format when selecting the file to view.
    The hex value for cl_abap_char_utilities=>cr_lf is 000D000A and this seems to be causing the issue.
    I've also tried using Function FI_DME_CHARATERS as I only really want to use the CR. However, the hex value for this is 000D and not 0D.
    Is there any way of converting this to have a hex value of 0D?
    Thanks in advance,
    Chris

    HI,
    Sorry it is not the CONTENTS_TXT it is CONTENTS_BIN. Instead of CONTENTS_BIN you need to pass to CONTENTS_HEX
    Check my Code..i have used the CONTENTS_HEX instead of CONTENTS_BIN
    DATA: l_tab_lines TYPE i,
            l_string TYPE char300,
            l_line TYPE string.
      CONSTANTS : l_c_255(255)  TYPE c VALUE '255',
                  l_c_txt(3)    TYPE c VALUE 'TXT'.
      DATA: lt_reclist  TYPE STANDARD TABLE OF somlreci1,       "Recipients
            lt_objpack  TYPE STANDARD TABLE OF sopcklsti1,
            lt_objhead  TYPE STANDARD TABLE OF solisti1,
            lt_objtxt   TYPE STANDARD TABLE OF solisti1,     "Body of EMail
            lt_objbin   TYPE STANDARD TABLE OF solisti1."Attachment of EMail
      DATA: l_doc_chng TYPE sodocchgi1,     "attributes of document to send
            l_reclist  LIKE LINE OF lt_reclist,
            l_objpack  LIKE LINE OF lt_objpack,
            l_obj      LIKE LINE OF lt_objhead.
      DATA :
        l_hex LIKE solix,
        lt_contents_hex LIKE STANDARD TABLE OF solix ,
        conv TYPE REF TO cl_abap_conv_out_ce,
        l_buffer TYPE xstring,
        l_hexa(510) TYPE x.
    * Completing the recipient list
      l_reclist-receiver = p_emailid.
      l_reclist-express  = 'X'.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist TO lt_reclist.
      CLEAR  l_reclist.
    * Body of Email Message
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      l_obj-line = '<html>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '<body>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<p><code>Hello,</p></code>'(t04).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      CONCATENATE
       '<p><code>'(f01)
       'Please click the link to access the Confirmation Form.'(t01)
       'Kindly complete the same and return it to the HR contact 15 days' &
       ' prior to the date of confirmation of the employee.'(t02)
       '</p></code>'(f02) INTO l_obj-line SEPARATED BY space.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      CONCATENATE '<a href="' text-l01 text-l02 '">'
             INTO l_obj-line.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      CONCATENATE  '<p><code>'(f01)
                   'Link to Confirmation Forms'(034)
                   '</p></code>'(f02)
                   '</a>'
             INTO l_obj-line.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      l_obj-line = '<p><code>The details of the employees ' &
                   'are as follows:</p></code>'(017).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
    * Table headings in the Mail Body
      l_obj-line =  '<table border="1">'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<tr>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =   '<th><p><code>Name</p></code></th>'(030).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>Department</p></code></th>'(031).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>DOJ</p></code></th>'(032).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>Confirmation Date</p></code></th>'(033).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '</tr>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
    ** Body of Email Message
    * Email Attachment
    * Append headings
      CONCATENATE 'Employee No.'(002)
                  'Employee Group'(016)
                  'Employee Name'(001)
                  'Designation'(003)
                  'Joining Date'(004)
                  'Department'(005)
                  'Branch/Location'(006)
                  'Unit'(007)
                  'Confirmation Due'(008)
                  'Form sent on'(009)
                  'Form Return by'(010)
                  'Employee Group'(016)
                  'Qualification'(012)
                  'Trainee Category'(013)
                INTO l_string
           SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      APPEND l_string TO lt_objbin.
      CLEAR l_string.
      APPEND INITIAL LINE TO lt_objbin.
      LOOP AT p_emp_details INTO i_emp_details_line.
        CONCATENATE i_emp_details_line-pnalt
                    i_emp_details_line-egroup
                    i_emp_details_line-ename
                    i_emp_details_line-stext
                    i_emp_details_line-srvdt
                    i_emp_details_line-ltext
                    i_emp_details_line-pbtxt
                    i_emp_details_line-btrtx
                    i_emp_details_line-mndat
                    i_emp_details_line-fsdate
                    i_emp_details_line-frdate
                    i_emp_details_line-egroup
                    i_emp_details_line-ptext
                    i_emp_details_line-ftext
               INTO l_string
          SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        APPEND l_string TO lt_objbin.
        CLEAR l_string.
        l_obj-line =  '<tr>'.
        APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
        CONCATENATE '<td>' '<p><code>'(f01)
                     i_emp_details_line-ename '</p></code>'(f02) '</td>'
                     INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-ltext '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-srvdt '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-mndat '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        l_obj-line =  '</tr>'.
        APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      ENDLOOP.
      l_obj-line = '  </table>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '</body>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '</html>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      IF r_cprob EQ 'X'.
        l_string = 'Completion of probation List'(018).
      ELSE.
        l_string = 'Completion of extension of probation List'(035).
      ENDIF.
      APPEND l_string TO lt_objhead.
    * APPEND object_header.
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = lt_objbin
          objcont_new = lt_objbin.
      LOOP AT lt_objbin INTO l_line.
       conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' endian = 'B').
        CALL METHOD conv->write( data = l_line ).
        l_buffer = conv->get_buffer( ).
        MOVE l_buffer TO l_hexa.
        MOVE l_hexa TO l_hex-line.
        APPEND l_hex TO lt_contents_hex.
      ENDLOOP.
    * File name for attachment
      CONCATENATE 'Completion of probation List'(018)
                   sy-datum '.XLS' INTO l_obj SEPARATED BY space.
      APPEND l_obj TO lt_objhead.
    * Email Body Details
      CLEAR l_tab_lines.
      DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
      l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 +
                              STRLEN( l_string ).  "size of doc in bytes
      l_doc_chng-obj_name = sy-repid.
      l_doc_chng-obj_langu = sy-langu.
      l_doc_chng-obj_descr = l_string.
      l_doc_chng-sensitivty = 'P'.          "  Send mail as a confidential
      l_objpack-head_start = 1.
      l_objpack-head_num   = 1.
      l_objpack-body_start = 1.
      l_objpack-body_num   = l_tab_lines.
      l_objpack-doc_type   = 'HTML'. "l_c_txt.
      APPEND l_objpack TO lt_objpack.
      CLEAR  l_objpack.
    * Email Attachment Details
      CLEAR l_tab_lines.
      DESCRIBE TABLE lt_objbin LINES l_tab_lines.
    * Creation of the entry for the compressed attachment
      l_objpack-transf_bin = 'X'.
      l_objpack-head_start = 1.
      l_objpack-head_num   = 1.
      l_objpack-body_start = 1.
      l_objpack-doc_type   = 'XLS'.
      l_objpack-obj_name   = l_obj.
      l_objpack-obj_descr  = l_obj.
      l_objpack-body_num   = l_tab_lines.
      l_objpack-doc_size   = l_tab_lines * l_c_255.
      APPEND l_objpack TO lt_objpack.
      CLEAR  l_objpack.
    * Send the document
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = l_doc_chng
          put_in_outbox              = ' '
          commit_work                = 'X'
        TABLES
          packing_list               = lt_objpack
          object_header              = lt_objhead
    *      contents_bin               = lt_objbin
          contents_txt               = lt_objtxt
          contents_hex               = lt_contents_hex
          receivers                  = lt_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.

Maybe you are looking for