10-06-2008 8:30 AM
Hello Experts,
I am using SO_DOCUMENT_REPOSITORY_MANAGER to send a mail with PDF as attachment(PDF file stored on local drive). but while sending i am getting pop where i need to click on send button to send a mail.
I want to schedule my program in background and unless & until i click on send button the mail will not send.
how do i bypass this pop up or how do i send a mail using this without getting pop up in background?.
Regards,
Saurabh
12-17-2008 9:46 PM
Hello ,
First get the folder id from the FM SO_FOLDER_ROOT_ID_GET,
Like this :
call function 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
region = 'B'
IMPORTING
folder_id = folder_id
EXCEPTIONS
others = 1.
Then :
w_document-foltp = folder_id-objtp .
w_document-folyr = folder_id-objyr .
w_document-folno = folder_id-objno .
Once you get this use the FM SO_DOCUMENT_REPOSITORY_MANAGER, with a method "ATTCREATEFROMPC" and then pass the file path in the table FILES , in changing pass the
DOCUMENT = w_document,
For eg:
st_header_data-objla = 'EN'.
st_header_data-objnam = st_document-objnam.
st_header_data-objdes = st_document-objdes.
st_header_data-objpri = '5'.
st_header_data-objsns = 'O'.
st_header_data-file_ext = 'TXT'.
w_header-objdes = 'PO ATTACHED'.
w_method1 = 'ATTCREATEFROMPC'.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = w_method1
IMPORTING
authority = w_authority
TABLES
files = it_files
CHANGING
document = st_document
header_data = st_header_data.
After this use the FM : 'SO_OBJECT_SEND'
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = w_folder_id
object_hd_change = w_object_hd_change
object_id = w_object_id
outbox_flag = 'X'
check_send_authority = 'X'
originator_type = 'J'
link_folder_id = w_object_id.
10-06-2008 11:53 AM
Hi,
use the fm so_document_send_api to send which we can schedule in background.
if any more queries reply back.
12-17-2008 9:46 PM
Hello ,
First get the folder id from the FM SO_FOLDER_ROOT_ID_GET,
Like this :
call function 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
region = 'B'
IMPORTING
folder_id = folder_id
EXCEPTIONS
others = 1.
Then :
w_document-foltp = folder_id-objtp .
w_document-folyr = folder_id-objyr .
w_document-folno = folder_id-objno .
Once you get this use the FM SO_DOCUMENT_REPOSITORY_MANAGER, with a method "ATTCREATEFROMPC" and then pass the file path in the table FILES , in changing pass the
DOCUMENT = w_document,
For eg:
st_header_data-objla = 'EN'.
st_header_data-objnam = st_document-objnam.
st_header_data-objdes = st_document-objdes.
st_header_data-objpri = '5'.
st_header_data-objsns = 'O'.
st_header_data-file_ext = 'TXT'.
w_header-objdes = 'PO ATTACHED'.
w_method1 = 'ATTCREATEFROMPC'.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = w_method1
IMPORTING
authority = w_authority
TABLES
files = it_files
CHANGING
document = st_document
header_data = st_header_data.
After this use the FM : 'SO_OBJECT_SEND'
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = w_folder_id
object_hd_change = w_object_hd_change
object_id = w_object_id
outbox_flag = 'X'
check_send_authority = 'X'
originator_type = 'J'
link_folder_id = w_object_id.
10-20-2009 9:00 AM
Could you please give more information in how to use SO_OBJECT_SEND after SO_DOCUMENT_REPOSITORY_MANAGER. Some of the fields such as w_object_hd_change; w_object_id are unknown.
Do you have an example coding?
Where f.i. do you set the email-adress?
For SO_DOCUMENT_REPOSITORY_MANAGER you could set
g_receipients-recextnam = 'mail adressl'.
g_receipients-recesc = 'U'.
g_receipients-sndex = 'X'.
with method SEND, but this gives a dialog. I hoped that with SO_OBJECT_SEND you could do without dialog.
Regards, Léon Hoeneveld
10-21-2009 2:27 PM
Try this
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
Edited by: Rob Burbank on Oct 21, 2009 9:28 AM
10-21-2009 2:30 PM
Leon - I'm simply rejecting all your posts on this. Please stop.
Rob
10-21-2009 4:03 PM
Rob, I'm sorry but I saw a lot of similar code-replies in the postings, ans my code does solve the questions.
I will post the relevant code instead:
gs_folder_id-objtp = gv_fold_type.
gs_folder_id-objyr = gv_fold_yr.
gs_folder_id-objno = gv_fold_number.
gs_order_id-objtp = gs_document-OBJTP.
gs_order_id-objyr = gs_document-objyr.
gs_order_id-objno = gs_document-objno.
"gi_receivers-recnam = 'USERNAME'.
gi_receivers-recextnam = 'mail-adress here'.
"gi_receivers-recesc = 'B'.
gi_receivers-recesc = 'U'.
gi_receivers-sndex = 'X'.
append gi_receivers.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
FOLDER_ID = gs_folder_id
OBJECT_ID = gs_order_id
"OUTBOX_FLAG = 'X'
TABLES
objcont = gi_objcnt
objhead = gi_objhead
objpara = gi_objpara
objparb = gi_objparb
RECEIVERS = gi_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.
write: sy-subrc.
ENDIF.
commit work.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01
WITH mode = 'INT'
"WITH output = 'X'
AND RETURN.