Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2800

Re: Need to send email by reading container attachment

$
0
0

Hello Rick.

 

I am able to attachment but not able to open in my outlook mali.

 

below is the code i am using.

 

DATA: attachments TYPE TABLE OF swr_object,

         ls_attachments LIKE LINE OF attachments.

   CALL FUNCTION 'SAP_WAPI_GET_ATTACHMENTS'

     EXPORTING

       workitem_id    = lv_wid "workitemid

       user           = sy-uname

       language       = sy-langu

     IMPORTING

       return_code    = return_code

     TABLES

       attachments    = attachments

       message_lines  = message_lines

       message_struct = message_struct.

   IF attachments is NOT INITIAL.

   READ TABLE attachments INTO ls_attachments INDEX 1.

   ENDIF.

   lfs_pack-transf_bin = 'X'.

   lfs_pack-head_start = 1.

   lfs_pack-head_num = 1.

   lfs_pack-body_start = 1.

   DESCRIBE TABLE  lint_content LINES loc_lines.

   lfs_pack-doc_type   = 'PDF'.

   lfs_pack-obj_name = ls_attachments-def_attrib.

   lfs_pack-obj_descr = ls_attachments-descript.

   lfs_pack-doc_size = loc_lines * 255.

   APPEND lfs_pack TO gint_pack.

   CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

     EXPORTING

          document_data              = lv_doc_data

          put_in_outbox              = 'X'

          sender_address             = 'WF-BATCH'

          sender_address_type        = 'B'

          commit_work                = 'X'

*       importing

*            sent_to_all                = sent_to_all

*            new_object_id              = new_object_id

     TABLES

          packing_list               = gint_pack

*            object_header              = object_header

          contents_bin               = lint_content

*         CONTENTS_TXT               = LINT_CONTENT

*            contents_hex               = contents_hex

*            object_para                = object_para

*            object_parb                = object_parb

          receivers                  = lint_receiver

              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.


Thank you.


Regards

Suresh Nadella


Viewing all articles
Browse latest Browse all 2800

Trending Articles