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: 

Email functionality for delivery release via VKM3

Former Member
0 Kudos

Dear All,

My question is -

When a delivery is being released by the credit department by transaction VKM4 a message should be automatically send to the responsible person in the sales office with the confirmation that the delivery has been released.

The message will be send to the @ mail (Lotus Notes) address.

The correct person will be identified via the partner function VW Customer Service which is defined at header level and should be available in the sales order.

I found the user exit Include RVKREFZ2 to be used for this.

Can anyone guide how to use this email functionality and from where the relevant data can be picked up from?

If any further clarifications are needed pls let me know.

Would greatly appreciate your useful feedback.

Thanks.

Regards,

Saurabh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

To send e-mail you can use the function module:

SO_NEW_DOCUMENT_ATT_SEND_API1.

to learn the functionality you can use the SAP sample program RSWNSENDMAIL1.

Hope this helps. Pls reward points if useful.

Regards,

Renjith Michael.

2 REPLIES 2

Former Member
0 Kudos

Hi,

To send e-mail you can use the function module:

SO_NEW_DOCUMENT_ATT_SEND_API1.

to learn the functionality you can use the SAP sample program RSWNSENDMAIL1.

Hope this helps. Pls reward points if useful.

Regards,

Renjith Michael.

Former Member
0 Kudos

hello Saurabh,

You can use the following code to send an email.

DATA : l_message(100) TYPE c.

DATA : l_subject(50) TYPE c.

DATA : g_email(50) type c value 'saptech@gmail.com'.

DATA : objheader LIKE solisti1 OCCURS 0 WITH HEADER LINE.

DATA object_id LIKE soodk.

DATA : docdata LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.

DATA : objcontents LIKE solisti1 OCCURS 0 WITH HEADER LINE.

DATA : receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.

receivers-receiver = g_email.

MOVE : 'X' TO receivers-express,

'U' TO receivers-rec_type.

APPEND receivers.

CONCATENATE 'Please note that your cheque numbered' p_cheque ' has been dishonoured' INTO l_message SEPARATED BY space.

CONCATENATE 'Cheque numbered' p_cheque 'dishonoured' INTO l_subject SEPARATED BY space.

objheader-line = 'Cheque Dishonoured!'.

APPEND objheader.

      • mail contents

objcontents-line = l_message.

APPEND objcontents.

objcontents-line = 'You are requested to contact the nearest Regional Office immediately'.

APPEND objcontents.

      • mail subject

docdata-obj_descr = l_subject.

APPEND docdata.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = docdata

  • DOCUMENT_TYPE = 'RAW'

put_in_outbox = 'X'

commit_work = 'X'

IMPORTING

  • SENT_TO_ALL =

new_object_id = object_id

TABLES

object_header = objheader

object_content = objcontents

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = 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

.

Moreover the email address can be found from the ADR6 table by giving the address number from KNA1 - the customer master.

Happy Programming

Zankruti