<?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 Printer in tcode SOST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655356#M290904</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any parameter in FM SO_DOCUMENT_SEND_API1 that I can put the printers name and can see in tcode SOST when I need to print?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Nov 2006 15:43:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-22T15:43:37Z</dc:date>
    <item>
      <title>Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655356#M290904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any parameter in FM SO_DOCUMENT_SEND_API1 that I can put the printers name and can see in tcode SOST when I need to print?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 15:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655356#M290904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655357#M290905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;+FU SO_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;SAPoffice: Send new document with attachments using RFC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;This function module enables you send a new document including any existing attachments. The document and the attachments are transferred in the same table. They are created when sent and can also be placed in the sender's outbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is necessary to distinguish between the document and its folder entries. The document itself only exists in the database once. It is a template for the folder entries and can be addressed via its object ID. Any number of folder entries can belong to the document. The folder entries contain the attributes of the document as well as some additional attributes relating to the folder entry itself. (Send priority and expiry date of the entry, for example.) Folder entries are created when a document is resubmitted, referenced or sent as well as when a new document is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters&lt;/P&gt;&lt;P&gt;PUT_IN_OUTBOX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Default = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the newly created document is also placed in the outbox of the active user when it is sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT_WORK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Default = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this flag is set ('X'), an explicit Commit Work is sent at the end of the function module SO_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOCUMENT_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This structure must contain the attributes of the document to be sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_NAME&lt;/P&gt;&lt;P&gt;Name of document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_DESCR&lt;/P&gt;&lt;P&gt;Title (short description) of document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_LANGU&lt;/P&gt;&lt;P&gt;Language of document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_SORT&lt;/P&gt;&lt;P&gt;Sort field of document. You can search for this term using attribute search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_EXPDAT&lt;/P&gt;&lt;P&gt;Expiration date of document. The document itself cannot expire, but each time the document is entered in a folder, this date is used as the default for the expiration date of the entry (field EXPIRY_DAT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SENSITIVTY&lt;/P&gt;&lt;P&gt;Document sensitivity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A personal document can have the following levels of sensitivity:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'O' : Standard, normal sensitivity&lt;/P&gt;&lt;P&gt;'F' : Functional, can be forwarded functionally&lt;/P&gt;&lt;P&gt;'P' : Confidential, not visible to substitutes&lt;/P&gt;&lt;P&gt;For documents in shared folders, only sensitivity level 'O' is permitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_PRIO&lt;/P&gt;&lt;P&gt;Recipient priority. The document itself does not have a priority level, but each time the document is entered in a folder, this value is used as the default for recipient priority for the entry (field PRIORITY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO_CHANGE&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), documents in shared folders can only be changed by the author. The author can change documents in private folders after they have been sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PRIORITY&lt;/P&gt;&lt;P&gt;Recipient priority for the folder entry. This value gives the priority, which was assigned to the document by the owner, after receipt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPIRY_DAT&lt;/P&gt;&lt;P&gt;Expiration date of the folder entry. When the expiration date has been reached or passed, the entry is placed in private trash and can be retrieved from there if needed, up until the next time the trash is emptied. A new folder entry is initially given the expiration date of the document from field OBJ_EXPDT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC_TYPE&lt;/P&gt;&lt;P&gt;If this field does not contain the default value (default is ' '), the document can be processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following entries are permitted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'D' : Dialog module&lt;/P&gt;&lt;P&gt;'F' : Function module&lt;/P&gt;&lt;P&gt;'R' : Report&lt;/P&gt;&lt;P&gt;'S' : Report with transfer of values to global memory&lt;/P&gt;&lt;P&gt;'T' : Transaction&lt;/P&gt;&lt;P&gt;'U' : Transaction with transfer of values to global memory&lt;/P&gt;&lt;P&gt;PROC_NAME&lt;/P&gt;&lt;P&gt;Processing element. You must enter the name of the dialog module, function module, report or transaction in accordance with the entry in the field PROC_TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC_SYST&lt;/P&gt;&lt;P&gt;Name of sytem in which the document is to be processed. If no system is specified or '*' is entered, processing is possible in all systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC_CLINT&lt;/P&gt;&lt;P&gt;Client in which the document is to be processed. If no client is specified or '*' is entered, processing is possible in all clients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SKIP_SCREN&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the first screen is skipped during processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_DO_OUT&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the document cannot be processed from the SAPoffice interface. You must use the API function module SO_DOCUMENT_SET_STATUS_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE_DEL&lt;/P&gt;&lt;P&gt;Wenn dieses Flag gesetzt ('X') wird, kann das Dokument über die API auch in fremden Mappen gelöscht werden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_SIZE&lt;/P&gt;&lt;P&gt;Size of the document in bytes. For PC documents, the size of the relevant file should be entered, for RAW  and SCR documents the size is the "length of the last line" + "number of other lines multiplied by 255".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Export parameters&lt;/P&gt;&lt;P&gt;NEW_OBJECT_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object ID of the document created during the send process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SENT_TO_ALL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the document was sent to all specified recipients or, in the case of external forwarding, the corresponding send requests were delivered to the subsystem. If sending or delivery failed in one or more cases, the flag is not activated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table parameters&lt;/P&gt;&lt;P&gt;PACKING_LIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table requires information about how the data in the tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to be distributed to the documents and its attachments. The first row is for the document, the following rows are each for one attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSF_BIN&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the table entry describes an object stored in binary format. The content of the object is in the table CONTENTS_BIN. If the flag is not activated, the object content is in the table CONTENTS_TXT in ASCII format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HEAD_START&lt;/P&gt;&lt;P&gt;Requires the start row of the table OBJECT_HEADER, as of which the specific header data of the object is stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HEAD_NUM&lt;/P&gt;&lt;P&gt;Requires the number of rows in the table OBJECT_HEADER that contain specific header data for the object. The relevant rows are arranged in a block and defined uniquely together with the entry in HEAD_START.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BODY_START&lt;/P&gt;&lt;P&gt;Requires the start row of the table dependent on the TRANSF_BIN flag as of which the object content is stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BODY_NUM&lt;/P&gt;&lt;P&gt;Requires the number of rows of the table dependent on the flag TRANSFER_BIN, which contain the object content. The relevant rows are arranged in a block and defined uniquely together with the entry in HEAD_START.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_TYPE&lt;/P&gt;&lt;P&gt;Attachment type. In the first row of the table, this field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_NAME&lt;/P&gt;&lt;P&gt;Attachment name. In the first row of the table, this field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_DESCR&lt;/P&gt;&lt;P&gt;Attachment title (short description). In the first row of the table, this field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJ_LANGU&lt;/P&gt;&lt;P&gt;Attachment language. In the first row of the table, this fiels is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_SIZE&lt;/P&gt;&lt;P&gt;Attachment size in bytes. For PC objects, the size of the relevant file should be entered here. For RAW and SCR objects, the size is the "length of the last page" + "number of other rows multiplied by 255". In the first row of the table, this field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESS_TYPE&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECT_HEADER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table must contain the summarized data dependent on each object type. SAPscript objects store information here about forms and styles, for example. Excel list viewer objects store the number of rows and columns amongst other things and PC objects store their original file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE&lt;/P&gt;&lt;P&gt;Requires the type-dependent data of the object line by line. The fields HEAD_START and HEAD_NUM in the table PACKING_LIST define which section belongs to which object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTENTS_BIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table must contain the summarized content of the objects identified as binary objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE&lt;/P&gt;&lt;P&gt;Requires the object content line by line. The fields BODY_START and BODY_NUM in the table PACKING_LIST define which section belongs to which object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTENTS_TXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table must contain the summarized content of the objects identified as ASCII objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE&lt;/P&gt;&lt;P&gt;Requires the object content line by line. The fiels BODY_START and BODY_NUM in the table PACKING_LIST define which section belongs to which object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECT_PARA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is only needed if the document to be sent is to be processed. The table must contain SET/GET parameters that are transferred to the processing element during processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to transfer processing parameters to the document attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;P&gt;Name of SET/GET parameter. Only the first three characters are used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPTION&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOW&lt;/P&gt;&lt;P&gt;Contains the value of the parameter in NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIGH&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECT_PARB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table is only used by documents to which a particular processing type is assigned. The meaning of the table depends on the processing type. If the processing element is a report, or transaction with transfer of values to the global memory, the table content is interpreted as the quantity of parameters with the relevant values and exported to the memory ID taken from the first row. If the processing element is a function module or a dialog module, the table is transferred to this as table parameter MSGDIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to transfer processing parameters to the document attachments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;P&gt;If the processing element is a report or a transaction with transfer of values to the global memory, the field of the first row of the table must contain the name of the memory ID used for the export. The fields of the other rows accommodate the parameter names. If the processing element is a function module or a dialog module, the fields must contain values corresponding to the use of the module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VALUE&lt;/P&gt;&lt;P&gt;If the processing element is a report or a transaction with transfer of values to the global memory, the field for the first row of the table must remain empty. The fields for the other rows accommodate the values belonging to the parameters in NAME. If the processing element is a function or dialog module, the fields must contain values corresponding to the use of the modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECEIVERS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table must contain the document recipients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECEIVER&lt;/P&gt;&lt;P&gt;Name of recipient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following entry categories are possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP use name of the recipient&lt;/P&gt;&lt;P&gt;SAPoffice name of the recipient&lt;/P&gt;&lt;P&gt;Shared distribution list&lt;/P&gt;&lt;P&gt;Fax number in the form of structure SADRFD&lt;/P&gt;&lt;P&gt;Internet address in the form of structure SADRUD&lt;/P&gt;&lt;P&gt;Remote SAP name in the form of structure SADR7D&lt;/P&gt;&lt;P&gt;X.400 address in the form of structure SADR8D&lt;/P&gt;&lt;P&gt;ADR_TYPE&lt;/P&gt;&lt;P&gt;Type of RECEIVER entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following values are permitted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'B' : SAP user name&lt;/P&gt;&lt;P&gt;' ' : SAPoffice name&lt;/P&gt;&lt;P&gt;'C' : Shared distribution list&lt;/P&gt;&lt;P&gt;'F' : Fax number&lt;/P&gt;&lt;P&gt;'U' : Internet address&lt;/P&gt;&lt;P&gt;'R ' : Remote SAP name&lt;/P&gt;&lt;P&gt;'X' : X.400 address&lt;/P&gt;&lt;P&gt;REC_ID&lt;/P&gt;&lt;P&gt;If the recipient is a SAPoffice user, the user ID, instead of the recipient name in RECEIVER, can be entered in this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLY_DOC&lt;/P&gt;&lt;P&gt;If there is a value in this field, the document is a reply to the folder entry identified by the specified ID. A correspondance history is automatically created/continued.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REC_DATE&lt;/P&gt;&lt;P&gt;The date on which the document is to reach the recipient. This date cannot be guaranteed for external recipients, as it depends on connected products.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROXY_ID&lt;/P&gt;&lt;P&gt;If automatic forwarding is active in the recipient's system, this field contains the SAP user ID or the address ID of the external address, to which the document was ultimately sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RETRN_CODE&lt;/P&gt;&lt;P&gt;When the recipient has received the document, the function module enters the value '0' in this field. If the document is not successfully recieved, a value unequal to '0' is entered in the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPRESS&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the document is sent with the attribute 'express'. If the recipient is a logged-on SAPoffice user, he or she receives a message immediately, saying that he or she has received an express mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COPY&lt;/P&gt;&lt;P&gt;Wenn dieses Flag gesetzt ('X') wird, dann wird das Dokument mit dem Attribut 'Kopie' versendet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BLIND_COPY&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the document is sent with the attribute 'secret copy'. If the recipient is a SAPoffice user, he or she can neither print nor forward the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO_FORWARD&lt;/P&gt;&lt;P&gt;If this flag is activated ('X') and the recipient is a SAPoffice user, he or she cannot forward the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO_PRINT&lt;/P&gt;&lt;P&gt;If this flag is activated ('X') and the recipient is a SAPoffice user, he or she cannot print the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_ANSWER&lt;/P&gt;&lt;P&gt;If this flag is activated ('X') and the recipient is a SAPoffice user, the user must reply to the document before he or she can delete it from his or her inbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_DO_EXPL&lt;/P&gt;&lt;P&gt;If this flag is activated ('X') and the recipient is a SAPoffice user, the user must process the document before he or she can delete it from his or her inbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TO_DO_GRP&lt;/P&gt;&lt;P&gt;If this field contains a value between '1' and '9', a SAPoffice user in the recipient group indicated by this number must process the document, before the recipients can delete it from their inboxes. If the value '0' is entered, the document does not need to be processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COM_TYPE&lt;/P&gt;&lt;P&gt;Communication type used to send the document. This field is only relevant if the recipient is an address number, that is, if the document is sent externally via address management. If the field is empty, the standard communication type specified in address management is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following values are permitted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'INT' : Send via Internet&lt;/P&gt;&lt;P&gt;'FAX' : Send as a fax&lt;/P&gt;&lt;P&gt;'X40' : Send via X.400&lt;/P&gt;&lt;P&gt;'RML' : Send in another SAP system&lt;/P&gt;&lt;P&gt;LFDNR&lt;/P&gt;&lt;P&gt;Current number from address management. This field is only relevant if the recipient is an address number, that is, if the document is sent via address management. If the field is empty, the default current number in address management is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FAX&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNTRY&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPOOL_ID&lt;/P&gt;&lt;P&gt;This field is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTIF_DEL&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the sender receives confirmation when the recipient receives the document. He or she also receives a message if the document could not be delivered. This flag should only be activated for external sending, since internal sending is synchronous. Confirmation is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTIF_READ&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the sender is notified as soon as the recipient has read the document. This flag should only be activated for external sending, since internal sending is synchronous. Read notification is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTIF_NDEL&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), the recipient receives a message if the document could not be delivered to the recipient. This flag should only be activated for external sending, since internal sending is synchronous. The message is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP_BODY&lt;/P&gt;&lt;P&gt;If this flag is activated ('X'), SAP specific data is transferred to the document in an external body part when sending via X.400. This flag should only be activated if the target system is an SAP System.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions&lt;/P&gt;&lt;P&gt;TOO_MANY_RECEIVERS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Too many recipients were specified. The active user does not have authorization to send to this number of recipients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOCUMENT_NOT_SENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The document could not be sent. It was not delivered to any of the specified recipients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOCUMENT_TYPE_NOT_EXIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A document class assigned to the document or an attachment does not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPERATION_NO_AUTHORIZATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The document was not allowed to be sent, because one of the required authorizations did not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER_ERROR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The combination of parameter values transferred to the function module was not a permitted combination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X_ERROR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am internal error or a data base inconsistency has occurred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENQUEUE_ERROR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A lock required for the send process could not be set. It is probable that another user is processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Sending a new RAW document with a BMP attachment to an Internet address and a private distribution list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZSSO_DOCUMENT_SEND_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS  2 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: OBJHEAD LIKE SOLISTI1   OCCURS  1 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: OBJBIN  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RECLIST LIKE SOMLRECI1  OCCURS  5 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: DOC_CHNG LIKE SODOCCHGI1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TAB_LINES LIKE SY-TABIX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the document to be sent&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_CHNG-OBJ_NAME = 'OFFER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_CHNG-OBJ_DESCR = 'Auction of a Picasso jr'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJTXT = 'Reserve price : $250000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND OBJTXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJTXT = 'A reproduction of the painting to be auctioned'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND OBJTXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJTXT = 'is enclosed as an attachment.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND OBJTXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE OBJTXT LINES TAB_LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE OBJTXT INDEX TAB_LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the entry for the compressed document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR OBJPACK-TRANSF_BIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-HEAD_START = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-HEAD_NUM   = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-BODY_START = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-BODY_NUM   = TAB_LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-DOC_TYPE   = 'RAW'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND OBJPACK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the document attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;(Assume the data in OBJBIN are given in BMP format)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJBIN = ' O/ '. APPEND OBJBIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJBIN = '  |  '. APPEND OBJBIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJBIN = ' /  '. APPEND OBJBIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE OBJBIN LINES TAB_LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJHEAD = 'picasso.bmp'. APPEND OBJHEAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the entry for the compressed attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-TRANSF_BIN = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-HEAD_START = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-HEAD_NUM   = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-BODY_START = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-BODY_NUM   = TAB_LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-DOC_TYPE   = 'BMP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-OBJ_NAME   = 'ATTACHMENT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-OBJ_DESCR = 'Reproduction object 138'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJPACK-DOC_SIZE   = TAB_LINES * 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND OBJPACK..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entering names in the distribution list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECLIST-RECEIVER = 'guido.geldsack@money.com'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECLIST-REC_TYPE = 'U'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND RECLIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECLIST-RECEIVER = 'DLI-NEUREICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECLIST-REC_TYPE = 'P'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND RECLIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sending the document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DOCUMENT_DATA = DOC_CHNG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          PUT_IN_OUTBOX = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          COMMIT_WORK   = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          PACKING_LIST  = OBJPACK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OBJECT_HEADER = OBJHEAD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CONTENTS_BIN  = OBJBIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CONTENTS_TXT  = OBJTXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          RECEIVERS     = RECLIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          TOO_MANY_RECEIVERS = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DOCUMENT_NOT_SENT  = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OPERATION_NO_AUTHORIZATION = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OTHERS = 99.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE: / 'Result of the send process:'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT RECLIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WRITE: / RECLIST-RECEIVER(48), ':'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF RECLIST-RETRN_CODE = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        WRITE 'sent successfully'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        WRITE 'not sent'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE: / 'no authorization to send to the specified number of'              'recipients!'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE: / 'document could not be sent to any of the recipients!'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE: / 'no authorization to send !'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN OTHERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WRITE: / 'error occurred during sending !'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;DOCUMENT_DATA&lt;/P&gt;&lt;P&gt;PUT_IN_OUTBOX&lt;/P&gt;&lt;P&gt;SENDER_ADDRESS&lt;/P&gt;&lt;P&gt;SENDER_ADDRESS_TYPE&lt;/P&gt;&lt;P&gt;COMMIT_WORK&lt;/P&gt;&lt;P&gt;SENT_TO_ALL&lt;/P&gt;&lt;P&gt;NEW_OBJECT_ID&lt;/P&gt;&lt;P&gt;SENDER_ID&lt;/P&gt;&lt;P&gt;PACKING_LIST&lt;/P&gt;&lt;P&gt;OBJECT_HEADER&lt;/P&gt;&lt;P&gt;CONTENTS_BIN&lt;/P&gt;&lt;P&gt;CONTENTS_TXT&lt;/P&gt;&lt;P&gt;CONTENTS_HEX&lt;/P&gt;&lt;P&gt;OBJECT_PARA&lt;/P&gt;&lt;P&gt;OBJECT_PARB&lt;/P&gt;&lt;P&gt;RECEIVERS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions&lt;/P&gt;&lt;P&gt;TOO_MANY_RECEIVERS&lt;/P&gt;&lt;P&gt;DOCUMENT_NOT_SENT&lt;/P&gt;&lt;P&gt;DOCUMENT_TYPE_NOT_EXIST&lt;/P&gt;&lt;P&gt;OPERATION_NO_AUTHORIZATION&lt;/P&gt;&lt;P&gt;PARAMETER_ERROR&lt;/P&gt;&lt;P&gt;X_ERROR&lt;/P&gt;&lt;P&gt;ENQUEUE_ERROR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Group&lt;/P&gt;&lt;P&gt;SOI1+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 15:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655357#M290905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T15:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655358#M290906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any sample programs to solve the problems?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 15:50:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655358#M290906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T15:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655359#M290907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZTEST_AUTHORITY_CHECK.
TABLES: EKKO.

PARAMETERS: P_EMAIL TYPE SOMLRECI1-RECEIVER
DEFAULT 'test@sapdev.co.uk'.

TYPES: BEGIN OF T_EKPO,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
AEDAT TYPE EKPO-AEDAT,
MATNR TYPE EKPO-MATNR,
END OF T_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF T_EKPO INITIAL SIZE 0,
WA_EKPO TYPE T_EKPO.

TYPES: BEGIN OF T_CHAREKPO,
EBELN(10) TYPE C,
EBELP(5) TYPE C,
AEDAT(8) TYPE C,
MATNR(18) TYPE C,
END OF T_CHAREKPO.
DATA: WA_CHAREKPO TYPE T_CHAREKPO.

DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.

DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1,
GD_ERROR TYPE SY-SUBRC,
GD_RECIEVER TYPE SY-SUBRC.


************************************************************************
*START_OF_SELECTION
START-OF-SELECTION.
* Retrieve sample data from table ekpo
PERFORM DATA_RETRIEVAL.

* Populate table with detaisl to be entered into .xls file
PERFORM BUILD_XLS_DATA_TABLE.


************************************************************************
*END-OF-SELECTION
END-OF-SELECTION.
* Populate message body text
PERFORM POPULATE_EMAIL_MESSAGE_BODY.

* Send file by email as .xls speadsheet
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESSAGE
IT_ATTACH
USING P_EMAIL
'Example .xls documnet attachment'
'XLS'
'filename'
' '
' '
' '
CHANGING GD_ERROR
GD_RECIEVER.

* Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form DATA_RETRIEVAL
*&amp;amp;---------------------------------------------------------------------*
* Retrieve data form EKPO table and populate itab it_ekko
*----------------------------------------------------------------------*
FORM DATA_RETRIEVAL.
SELECT EBELN EBELP AEDAT MATNR
UP TO 10 ROWS
FROM EKPO
INTO TABLE IT_EKPO.
ENDFORM. " DATA_RETRIEVAL


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form BUILD_XLS_DATA_TABLE
*&amp;amp;---------------------------------------------------------------------*
* Build data table for .xls document
*----------------------------------------------------------------------*
FORM BUILD_XLS_DATA_TABLE.
CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
CON_TAB TYPE X VALUE '09'. "OK for non Unicode

*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
* con_tab type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB,
* con_cret type c value cl_abap_char_utilities=&amp;gt;CR_LF.


CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO IT_ATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.

LOOP AT IT_EKPO INTO WA_CHAREKPO.
CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
INTO IT_ATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form SEND_FILE_AS_EMAIL_ATTACHMENT
*&amp;amp;---------------------------------------------------------------------*
* Send email
*----------------------------------------------------------------------*
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
PIT_ATTACH
USING P_EMAIL
P_MTITLE
P_FORMAT
P_FILENAME
P_ATTDESCRIPTION
P_SENDER_ADDRESS
P_SENDER_ADDRES_TYPE
CHANGING P_ERROR
P_RECIEVER.


DATA: LD_ERROR TYPE SY-SUBRC,
LD_RECIEVER TYPE SY-SUBRC,
LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
LD_EMAIL LIKE SOMLRECI1-RECEIVER,
LD_FORMAT TYPE SO_OBJ_TP ,
LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
LD_ATTFILENAME TYPE SO_OBJ_DES ,
LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
LD_RECEIVER LIKE SY-SUBRC.

LD_EMAIL = P_EMAIL.
LD_MTITLE = P_MTITLE.
LD_FORMAT = P_FORMAT.
LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
LD_ATTFILENAME = P_FILENAME.
LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.


* Fill the document data.
W_DOC_DATA-DOC_SIZE = 1.

* Populate the subject/generic message attributes
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
W_DOC_DATA-SENSITIVTY = 'F'.

* Fill the document data and get size of attachment
CLEAR W_DOC_DATA.
READ TABLE IT_ATTACH INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
W_DOC_DATA-SENSITIVTY = 'F'.
CLEAR T_ATTACHMENT.
REFRESH T_ATTACHMENT.
T_ATTACHMENT[] = PIT_ATTACH[].

* Describe the body of the message
CLEAR T_PACKING_LIST.
REFRESH T_PACKING_LIST.
T_PACKING_LIST-TRANSF_BIN = SPACE.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 0.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = 'RAW'.
APPEND T_PACKING_LIST.

* Create attachment notification
T_PACKING_LIST-TRANSF_BIN = 'X'.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 1.
T_PACKING_LIST-BODY_START = 1.

DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.

* Add the recipients email address
CLEAR T_RECEIVERS.
REFRESH T_RECEIVERS.
T_RECEIVERS-RECEIVER = LD_EMAIL.
T_RECEIVERS-REC_TYPE = 'U'.
T_RECEIVERS-COM_TYPE = 'INT'.
T_RECEIVERS-NOTIF_DEL = 'X'.
T_RECEIVERS-NOTIF_NDEL = 'X'.
APPEND T_RECEIVERS.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_DATA
PUT_IN_OUTBOX = 'X'
SENDER_ADDRESS = LD_SENDER_ADDRESS
SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = W_SENT_ALL
TABLES
PACKING_LIST = T_PACKING_LIST
CONTENTS_BIN = T_ATTACHMENT
CONTENTS_TXT = IT_MESSAGE
RECEIVERS = T_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.

* Populate zerror return code
LD_ERROR = SY-SUBRC.

* Populate zreceiver return code
LOOP AT T_RECEIVERS.
LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
ENDLOOP.
ENDFORM.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form INITIATE_MAIL_EXECUTE_PROGRAM
*&amp;amp;---------------------------------------------------------------------*
* Instructs mail send program for SAPCONNECT to send email.
*----------------------------------------------------------------------*
FORM INITIATE_MAIL_EXECUTE_PROGRAM.
WAIT UP TO 2 SECONDS.
SUBMIT RSCONN01 WITH MODE = 'INT'
WITH OUTPUT = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form POPULATE_EMAIL_MESSAGE_BODY
*&amp;amp;---------------------------------------------------------------------*
* Populate message body text
*----------------------------------------------------------------------*
FORM POPULATE_EMAIL_MESSAGE_BODY.
REFRESH IT_MESSAGE.
IT_MESSAGE = 'Please find attached a list test ekpo records'.
APPEND IT_MESSAGE.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 15:59:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655359#M290907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T15:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655360#M290908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which part to move printers name in SO_DOCUMENT_SEND_API1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 16:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655360#M290908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T16:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655361#M290909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code sends an email. The table t_receivers should take the printer parameters in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 16:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655361#M290909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T16:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Printer in tcode SOST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655362#M290910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TQ Naren.&lt;/P&gt;&lt;P&gt;The RECEIVERS structure equal to SOMLRECI1, so which field I need to fill up? my printers name is ABC1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 16:19:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/printer-in-tcode-sost/m-p/1655362#M290910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T16:19:31Z</dc:date>
    </item>
  </channel>
</rss>

