Application Development and Automation 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: 
Read only

SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Likes
449

hi gurus,

May i know how do i make use of e SO_NEW_DOCUMENT_SEND_API1??

I have created a scripting mail.

After this, how can i send email and call this script?

Alternatively, please advise me just how to send email using the function?

How can i create the import/export data?

Thanks very much..

4 REPLIES 4
Read only

Former Member
0 Likes
418

Go to SE37

Open the Function Module

On right hand side u will get a Button called FM Documentation

From that u can get the explanation what ever u want

Read only

Former Member
0 Likes
418

hi all,

i have tested with SO_NEW_DOCUMENT_SEND_API1

But, email can only be sent to

SAP inbox but not Internet mail address.

  • mailing function is working and tested to be working

  • no error returned from using this function.

  • returned successful but no email received.

&----


*& Report Z_SEND_EMAIL_TEST *

*& *

&----


*& *

*& *

&----


REPORT Z_SEND_EMAIL_TEST .

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 = 'mymail@gmail.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.

Please advise.

thanks so much.

Read only

Former Member
0 Likes
418

solved.

Read only

Former Member
0 Likes
418

What is document_data in this FM

and u can send it a mail but i want my ALV display table to be send with the mail..

how can i go abt it can anyone tell me abt this??