<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SO_new_document_send_api1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086200#M433258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;just go through this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sending a confidential RAW document to an internal user and an Internet address. The new document is also placed in the sender's outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.

DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.

DATA: DOC_CHNG LIKE SODOCCHGI1.

DATA: ENTRIES LIKE SY-TABIX.

DATA: NAME(15).


* Fill the document

DOC_CHNG-OBJ_NAME = 'URGENT'.

DOC_CHNG-OBJ_DESCR = 'Read at once !'.

DOC_CHNG-SENSITIVTY = 'P'.

OBJCONT = 'Hey guys, time for lunch !!!'.

APPEND OBJCONT.

OBJCONT = 'Lets get going !'.

APPEND OBJCONT.

DESCRIBE TABLE OBJCONT LINES ENTRIES.

READ TABLE OBJCONT INDEX ENTRIES.

DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).

* Fill the receiver list

CLEAR RECLIST.

RECLIST-RECEIVER = SY-UNAME.  " replace with &amp;lt;login name&amp;gt;

RECLIST-REC_TYPE = 'B'.

RECLIST-EXPRESS = 'X'.

APPEND RECLIST.

CLEAR RECLIST.

RECLIST-RECEIVER = 'ned.neighbour@next.door.com'.

RECLIST-REC_TYPE = 'U'.

APPEND RECLIST.

* Send the document

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

     EXPORTING

          DOCUMENT_TYPE  = 'RAW'

          DOCUMENT_DATA  = DOC_CHNG

          PUT_IN_OUTBOX  = 'X'

     TABLES

          OBJECT_CONTENT = OBJCONT

          RECEIVERS      = RECLIST

     EXCEPTIONS

          TOO_MANY_RECEIVERS         = 1

               DOCUMENT_NOT_SENT          = 2

              OPERATION_NO_AUTHORIZATION = 4

               OTHERS                     = 99.

    CASE SY-SUBRC.

      WHEN 0.

        LOOP AT RECLIST.

          IF RECLIST-RECEIVER = SPACE.

            NAME = RECLIST-REC_ID.

          ELSE.

            NAME = RECLIST-RECEIVER.

          ENDIF.

          IF RECLIST-RETRN_CODE = 0.

            WRITE: / NAME, ': succesfully sent'.

          ELSE.

            WRITE: / NAME, ': error occured'.

          ENDIF.

        ENDLOOP.

      WHEN 1.

        WRITE: / 'Too many receivers specified !'.

      WHEN 2.

        WRITE: / 'No receiver got the document !'.

      WHEN 4.

        WRITE: / 'Missing send authority !'.

      WHEN OTHERS.

        WRITE: / 'Unexpected error occurred !'.

    ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;To send an existing document, you must use the function module SO_OLD_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the active user is still to be able to process the document after it has been sent, it must be moved to the outbox when sent using the flag PUT_IN_OUTBOX. You can use the function module SO_FOLDER_READ_API1 to read the contents of the outbox and the object ID to find the document sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to use a user address name as the recipient since this may not be unique. To get around this problem, you can use the function module SO_NAME_CONVERT_API1. This provides a hit list in response to a specified name, for which a dialog is constructed with a choice of required values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2007 13:13:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-24T13:13:35Z</dc:date>
    <item>
      <title>SO_new_document_send_api1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086197#M433255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I to be confronted with a problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I execute the Transaktion QM02 and the output is claim as Document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I  want to send this Document to sapoffice with the &lt;/P&gt;&lt;P&gt;FB    SO_NEW_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possibe to make it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;our system is  6.20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me  to this problem?&lt;/P&gt;&lt;P&gt;I'd appreciate it very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bertram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2007 13:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086197#M433255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-12T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: SO_new_document_send_api1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086198#M433256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Bertram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out the following code :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'SO_NEW_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;document_data = maildata&lt;/P&gt;&lt;P&gt;document_type = 'RAW'&lt;/P&gt;&lt;P&gt;put_in_outbox = 'X'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;object_header = mailtxt&lt;/P&gt;&lt;P&gt;object_content = mailtxt&lt;/P&gt;&lt;P&gt;receivers = mailrec&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;others = 8.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should work&lt;/P&gt;&lt;P&gt;just correct syntax errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If helpful reward points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2007 05:26:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086198#M433256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-13T05:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: SO_new_document_send_api1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086199#M433257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But  now a question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don&amp;#146;t know how to fill  Field maildata and  Table mailtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; call function 'SO_NEW_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;document_data = maildata   &amp;amp;#61664;    ( fill  ???  )&lt;/P&gt;&lt;P&gt;document_type = 'RAW'&lt;/P&gt;&lt;P&gt;put_in_outbox = 'X'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;object_header = mailtxt        &amp;amp;#61664;   ( fill  ??? )&lt;/P&gt;&lt;P&gt;object_content = mailtxt&lt;/P&gt;&lt;P&gt;receivers = mailrec&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;others = 8.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bertram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 12:52:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086199#M433257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T12:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: SO_new_document_send_api1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086200#M433258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;just go through this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sending a confidential RAW document to an internal user and an Internet address. The new document is also placed in the sender's outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.

DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.

DATA: DOC_CHNG LIKE SODOCCHGI1.

DATA: ENTRIES LIKE SY-TABIX.

DATA: NAME(15).


* Fill the document

DOC_CHNG-OBJ_NAME = 'URGENT'.

DOC_CHNG-OBJ_DESCR = 'Read at once !'.

DOC_CHNG-SENSITIVTY = 'P'.

OBJCONT = 'Hey guys, time for lunch !!!'.

APPEND OBJCONT.

OBJCONT = 'Lets get going !'.

APPEND OBJCONT.

DESCRIBE TABLE OBJCONT LINES ENTRIES.

READ TABLE OBJCONT INDEX ENTRIES.

DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).

* Fill the receiver list

CLEAR RECLIST.

RECLIST-RECEIVER = SY-UNAME.  " replace with &amp;lt;login name&amp;gt;

RECLIST-REC_TYPE = 'B'.

RECLIST-EXPRESS = 'X'.

APPEND RECLIST.

CLEAR RECLIST.

RECLIST-RECEIVER = 'ned.neighbour@next.door.com'.

RECLIST-REC_TYPE = 'U'.

APPEND RECLIST.

* Send the document

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

     EXPORTING

          DOCUMENT_TYPE  = 'RAW'

          DOCUMENT_DATA  = DOC_CHNG

          PUT_IN_OUTBOX  = 'X'

     TABLES

          OBJECT_CONTENT = OBJCONT

          RECEIVERS      = RECLIST

     EXCEPTIONS

          TOO_MANY_RECEIVERS         = 1

               DOCUMENT_NOT_SENT          = 2

              OPERATION_NO_AUTHORIZATION = 4

               OTHERS                     = 99.

    CASE SY-SUBRC.

      WHEN 0.

        LOOP AT RECLIST.

          IF RECLIST-RECEIVER = SPACE.

            NAME = RECLIST-REC_ID.

          ELSE.

            NAME = RECLIST-RECEIVER.

          ENDIF.

          IF RECLIST-RETRN_CODE = 0.

            WRITE: / NAME, ': succesfully sent'.

          ELSE.

            WRITE: / NAME, ': error occured'.

          ENDIF.

        ENDLOOP.

      WHEN 1.

        WRITE: / 'Too many receivers specified !'.

      WHEN 2.

        WRITE: / 'No receiver got the document !'.

      WHEN 4.

        WRITE: / 'Missing send authority !'.

      WHEN OTHERS.

        WRITE: / 'Unexpected error occurred !'.

    ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;To send an existing document, you must use the function module SO_OLD_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the active user is still to be able to process the document after it has been sent, it must be moved to the outbox when sent using the flag PUT_IN_OUTBOX. You can use the function module SO_FOLDER_READ_API1 to read the contents of the outbox and the object ID to find the document sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to use a user address name as the recipient since this may not be unique. To get around this problem, you can use the function module SO_NAME_CONVERT_API1. This provides a hit list in response to a specified name, for which a dialog is constructed with a choice of required values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 13:13:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/so-new-document-send-api1/m-p/2086200#M433258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T13:13:35Z</dc:date>
    </item>
  </channel>
</rss>

