Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

so_object_send

Former Member
0 Kudos

Hi experts,

I need to send a mail using the FM so_object_send.

Please suggest what are the mandatory parameters to pass to this FM.

If sample code sent very help full

Thanks

sai

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please try searching.

It may surprise you to find out you aren't the first person in the world to want to do this.

6 REPLIES 6

Former Member
0 Kudos

Please try searching.

It may surprise you to find out you aren't the first person in the world to want to do this.

0 Kudos

Hi Gareth,,

I tried there is no proper sample code for this.

Can you send the sample code ?

0 Kudos

Hi,

in this forum are a lot of examples. Try searching.

You can also search in SE38 for BCS_EXAMPLE_*.

If you tried it and get problems post it here.

Regards, Dieter

0 Kudos

>

> Hi Gareth,,

>

> I tried there is no proper sample code for this.

>

> Can you send the sample code ?

But i can say there is sampal code in your SAP system as well

Please don't say now

@Amit There is no sampal code in my SAP.

0 Kudos

Hi Sai,

I sugest u to use FM SO_NEW_DOCUMENT_ATT_SEND_API1 which internally calls ur FM. But usage of this FM is very easy. U can get number of sample code for this FM in SDN.

Check below sample code for ur FM.


    REFRESH i_objcont[].                 
    CLEAR: i_maildata.

    LOOP AT i_maildata.
      CLEAR:wa_objcont,w_menge.
    "Populate the mail body data into this i_objcont table
        APPEND wa_objcont TO i_objcont.
     ENDLOOP.

          MOVE:c_dlname  TO wa_receivers-recnam,
               c_x       TO wa_receivers-snddr,
               c_x       TO wa_receivers-sndex,
               c_c       TO wa_receivers-recesc.
          APPEND wa_receivers TO i_receivers.


  CLEAR:i_objhead[], i_objpara[], i_objparb[], i_objhead,
        i_objpara,   i_objparb,   i_raw_head,  wa_folder_id,
        w_forwarder, wa_object_fl_change, wa_object_id,
        w_store_flag, w_count.

  DESCRIBE TABLE i_objcont LINES w_count.
  MOVE: w_count    TO i_raw_head-rawsiz,
        i_raw_head TO i_objhead.
  APPEND i_objhead.


  CALL FUNCTION 'SO_OBJECT_SEND'
       EXPORTING
            folder_id                  = wa_folder_id
            forwarder                  = w_forwarder
            object_fl_change           = wa_object_fl_change
            object_hd_change           = wa_object_hd_change
            object_id                  = wa_object_id
            object_type                = w_object_type
            outbox_flag                = w_outbox_flag
            owner                      = w_owner
            store_flag                 = w_store_flag
       IMPORTING
            object_id_new              = wa_object_id_new
            sent_to_all                = w_sent_to_all
       TABLES
            objcont                    = i_objcont
            objhead                    = i_objhead
            objpara                    = i_objpara
            objparb                    = i_objparb
            receivers                  = i_receivers
       EXCEPTIONS
            active_user_not_exist      = 1
            communication_failure      = 2
            component_not_available    = 3
            folder_not_exist           = 4
            folder_no_authorization    = 5
            forwarder_not_exist        = 6
            note_not_exist             = 7
            object_not_exist           = 8
            object_not_sent            = 9
            object_no_authorization    = 10
            object_type_not_exist      = 11
            operation_no_authorization = 12
            owner_not_exist            = 13
            parameter_error            = 14
            substitute_not_active      = 15
            substitute_not_defined     = 16
            system_failure             = 17
            too_much_receivers         = 18
            user_not_exist             = 19
            originator_not_exist       = 20
            x_error                    = 21
            OTHERS                     = 22.
  IF sy-subrc <> 0.
  ENDIF.
"Send mail immediately
  SUBMIT zpause WITH p_sec EQ c_2 AND RETURN.
  SUBMIT rsconn01 USING SELECTION-SET c_mode AND RETURN.
  CALL FUNCTION 'SO_DEQUEUE_UPDATE_LOCKS'.

Thanks,

Vinod.

Former Member
0 Kudos

hi,

Please check the below link

[https://forums.sdn.sap.com/click.jspa?searchID=16108450&messageID=5975625]

Regards,

Surinder