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

Diffusion mode SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Likes
616

Hi experts,

I am using SO_NEW_DOCUMENT_SEND_API1 to send mails from SAP.

The FM is working fine, but the mails are sent in a private mode.

How can i do to send them in a standard mode. Here my code:

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA 
= DOC_DATA
PUT_IN_OUTBOX 
= 'X'
COMMIT_WORK   
= 'X'
TABLES
*   OBJECT_HEADER  = packing_list
OBJECT_CONTENT
= TB_TEXT
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.

ENDIF.


Thanks.


Amine

3 REPLIES 3
Read only

Former Member
0 Likes
583

If i add a line like this into my code:

DOC_DATA-SENSITIVTY = 'O'.

Is that sufficient? or do i need to modify something in the system settings?

Thanks.

Amine


Read only

0 Likes
583

Hi Amine,

Yes It would be sufficient.

Read only

0 Likes
583

Ok thanks.

Amine