Distribution List Table
Team,
I'm looking for the table that contains the information in Distribution List from SO23.
I will be grateful if I get your response.
It is too late to reply
But if the problem still unsolved try this:
REPORT ZTESTALE.
data ls_member type SODM1.
data lt_member type table of SODM1.
data ls_dli_id type SOODK.
data ls_objpara type SELC.
data lt_objpara type table of SELC.
data ls_objparb type SOOP1.
data lt_objparb type table of SOOP1.
CALL FUNCTION 'SO_DLI_READ'
EXPORTING
DISTRIBUTIONLIST = 'PIPPO' "DLIST NAME
DLI_ID = ls_dli_id "Empty if it is a system dlist
OWNER = sy-uname
SYSTEM_DLI = 'X'
* IMPORTING
* OBJECT_FL_DISPLAY =
* OBJECT_HD_DISPLAY =
* OBJECT_ID =
* OBJECT_SD_DISPLAY =
TABLES
member = lt_member
objpara = lt_objpara
objparb = lt_objparb
* EXCEPTIONS
* ACTIVE_USER_NOT_EXIST = 1
* COMMUNICATION_FAILURE = 2
* COMPONENT_NOT_AVAILABLE = 3
* DL_NAME_NOT_EXIST = 4
* FOLDER_NOT_EXIST = 5
* FOLDER_NO_AUTHORIZATION = 6
* FORWARDER_NOT_EXIST = 7
* OBJECT_NOT_EXIST = 8
* OBJECT_NO_AUTHORIZATION = 9
* OPERATION_NO_AUTHORIZATION = 10
* OWNER_NOT_EXIST = 11
* PARAMETER_ERROR = 12
* SUBSTITUTE_NOT_ACTIVE = 13
* SUBSTITUTE_NOT_DEFINED = 14
* SYSTEM_FAILURE = 15
* USER_NOT_EXIST = 16
* X_ERROR = 17
* OTHERS = 18
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at lt_member into ls_member.
endloop.
Similar Messages
-
How to send mail to distribution list and another table list
Hi
I am facing a problem. I need to send mail to the user who is creating the SO/PO and a distribution list.
Problem is only one thing can be used at the same time. ie either Distribution list or list from internal table.
How can we use both in 1 function module. Like it should call the internal table and then the distribution list for sending the mail .
Regards,
VarunHi,
Refer to following link,
http://www.sap-img.com/abap/make-e-mail-sender-of-po-the-po-creators-name.htm
http://www.sap-img.com/fu016.htm
Reward pts. if helpfull.
Regards,
Dhan -
Hi all,
Can anybody tell me the table where the "Distribution List" data is stored.
Regards,
SunnyHI amit,
I am not able to find the tables for distribution list where for a particular list, all the email ids are stored which are included in that particular distribution list.
I have searched all the tables starting from SO*.but could nt able to find.
The table SOOD just gives me the header data of distribution list.
If you can give the tables for line items it will be a great help.
Regards,
Sunny -
Distribution list folder, what table is it in?
Hello all,
I am creating a report that will list all of the distribution lists, along with the content of the list. I've tracked down the name, description, and contents. But I have been unable to find the name of the folder in which the distribution lists were created. I started with tables SOID and SOOD.
Can someone tell me how to determine the folder name?
Thanks
BruceBruce,
Check SOOF SAPoffice: object folder
SOFD SAPoffice: Object Definition
SOFM SAPoffice: Folder contents
SOOD SAPoffice: Object definition
SOUD SAPoffice: user definition
K.Kiran. -
What tables store the email addresses for a distribution list?
Can someone please tell me the table or tables used to store the email addresses for a distribution list
I have a requirement in BW to send an email to a person who starts a process chain. One to many people will be able to do this and the requirement is to have the email only go to the person who executes the Process chain. I would like to dynamically maintain the distribution list in my job.Here is piece of code i used one of my program to fetch email address from distribution list
if not soid-objnam is initial.
call function 'SO_DLI_READ_API1'
exporting
dli_name = soid-objnam
shared_dli = 'X'
tables
dli_entries = i_distlist
exceptions
dli_not_exist = 1
operation_no_authorization = 2
parameter_error = 3
x_error = 4
others = 5.
if sy-subrc ne 0.
else.
loop at i_distlist.
if i_distlist-member_adr is initial.
move i_distlist-member_nam to i_user-bapibname.
call function 'BAPI_USER_GET_DETAIL'
exporting
username = i_user-bapibname
importing
address = wa_address
tables
return = i_return.
move wa_address-e_mail to wa_receiver-receiver.
append wa_receiver to i_receiver.
else.
move i_distlist-member_adr to wa_receiver-receiver.
append wa_receiver to i_receiver.
endif.
endloop.
endif.
a® -
How to send spool to Distribution List using JOB_CLOSE
Please help on sending Distribution list when job defined using JOB_OPEN, JOB_Submit and JOB_CLOSE
Thanks.Hi, this is code:
DATA WA_RECIPIENT LIKE swotobjid.
CONSTANTS: gc_objname TYPE oj_name VALUE 'RECIPIENT'.
PERFORM get_distribucion_list USING 'NAME_LIST' " name of List of distribution
CHANGING WA_RECIPIENT.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_jobcount
jobname = l_jobname
strtimmed = 'X'
recipient_obj = wa_recipient
IMPORTING
job_was_released = l_libero
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
FORM get_distribucion_list USING p_objnam TYPE so_obj_nam
CHANGING p_wa_recipient LIKE swotobjid.
DATA: it_tab LIKE STANDARD TABLE OF soxdl
INITIAL SIZE 0 WITH HEADER LINE.
CHECK NOT p_objnam IS INITIAL.
CALL FUNCTION 'SO_DLI_LIST_READ_XDL'
EXPORTING
dli_generic_name = p_objnam
public = 'X'
subscript = 'X'
TABLES
dli_display_tab = it_tab
EXCEPTIONS
communication_failure = 1
dl_list_no_entries = 2
owner_not_exist = 3
system_failure = 4
x_error = 5
parameter_error = 6
OTHERS = 7
IF sy-subrc = 0.
READ TABLE it_tab INDEX 1.
IF sy-subrc = 0.
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = p_wa_recipient-logsys
EXCEPTIONS
own_logical_system_not_defined = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
MOVE gc_objname TO p_wa_recipient-objtype.
CONCATENATE it_tab-dlitp it_tab-dliyr it_tab-dlino
INTO p_wa_recipient-objkey.
ENDIF.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. -
Creating distribution lists in SAP CRM 5.0 business workplace
Hi Experts,
We have CRM 5.0 and I have tried to create distribution lists for
mailsending.
After defining a name and a folder (that is then created) for the
list the recipient list insertion is a following task.
I can search for partners of different type by F4 help but no
matter the type of the partner searched - the type that is
automatically entered to the lists recipents table is "shared
distribution list". even though the desired type is among others
in a list other values cannot be selected.
Please help, is this a setting that can be undone or what might
be a problem in the procedure that i use in creating a list?
has anyone else had similar problems?
Thank You so much,i have received an answer from SAP:
"The reason for the error is a wrong entry in table TBCS_RECIP. To removethis entry, please use the report which is entered in the description
of note 735795 or delete the wrong entry direct on table TBCS_RECIP.
After the run of the report or the deletion on table TBCS_RECIP you willnot find further the selection option 'Business Partner' on the F4 help."
The entry was removed and for Lists business partners cannot be selected at all - as a standard. really sad endeed. -
How to send mail to all the receipients in distribution list
Hi All,
As per my requirement I need to send error log in doc format.
I am using the help of following code suggested by someone in sdn.
Mehr Beispile unter BCS_EXAMPLE_* mit se38
Mehr Beispile unter BCS_TEST* mit se38
DATA: SEND_REQUEST TYPE REF TO CL_BCS.
DATA: SUBJECT TYPE SO_OBJ_DES.
DATA: ATT_TYPE TYPE SOODK-OBJTP.
DATA: IT_TEXT TYPE BCSY_TEXT.
DATA: WA_TEXT LIKE SOLI.
DATA: IT_BIN TYPE SOLIX_TAB.
DATA: WA_BIN TYPE SOLIX.
DATA: DOCUMENT TYPE REF TO CL_DOCUMENT_BCS.
DATA: SENDER TYPE REF TO CL_SAPUSER_BCS.
DATA: RECIPIENT TYPE REF TO IF_RECIPIENT_BCS.
DATA: BCS_EXCEPTION TYPE REF TO CX_BCS.
DATA: SENT_TO_ALL TYPE OS_BOOLEAN.
Bytes der Datei
DATA: IT_LENGHT TYPE SO_OBJ_LEN.
DATA: N10(10) TYPE N.
START-OF-SELECTION.
PERFORM MAIN.
PERFORM RSCONN01_EXECUTE.
END-OF-SELECTION.
FORM MAIN.
TRY.
Dokument erstellen (mit Anhang)
SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
PERFORM HEAD_CONT.
PERFORM RAW_ATT.
Dokument (mit Anhang) setzen
CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
Absender setzen
SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
CALL METHOD SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = SENDER.
Empfänger setzen
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
'email@address' ).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
Dokument senden
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
COMMIT WORK.
Sende-Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "main
FORM HEAD_CONT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Betreffzeile'.
WA_TEXT = 'First Line'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line'. APPEND WA_TEXT TO IT_TEXT.
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = ATT_TYPE
I_TEXT = IT_TEXT
I_LENGTH = IT_LENGHT
I_SUBJECT = SUBJECT ).
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "HEAD_CONT
*& Form RAW_ATT
text
FORM RAW_ATT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Text Anhang'.
WA_TEXT = 'First Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
Lenght of Att_Text
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = ATT_TYPE
I_ATT_CONTENT_TEXT = IT_TEXT
I_ATTACHMENT_SIZE = IT_LENGHT
I_ATTACHMENT_SUBJECT = SUBJECT.
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "ATT_RAW
But From this method I am not able to send the mail to the distribution list created.
Please suggest How this can be done.
I dont want to changHi Smriti,
You can make changes like shown below. The changes are shown in the code format for your easy reference. You can remove the code in bold. This will work.
Mehr Beispile unter BCS_EXAMPLE_* mit se38
Mehr Beispile unter BCS_TEST* mit se38
DATA: SEND_REQUEST TYPE REF TO CL_BCS.
DATA: SUBJECT TYPE SO_OBJ_DES.
DATA: ATT_TYPE TYPE SOODK-OBJTP.
DATA: IT_TEXT TYPE BCSY_TEXT.
DATA: WA_TEXT LIKE SOLI.
DATA: IT_BIN TYPE SOLIX_TAB.
DATA: WA_BIN TYPE SOLIX.
DATA: DOCUMENT TYPE REF TO CL_DOCUMENT_BCS.
DATA: SENDER TYPE REF TO CL_SAPUSER_BCS.
DATA: RECIPIENT TYPE REF TO IF_RECIPIENT_BCS.
DATA: BCS_EXCEPTION TYPE REF TO CX_BCS.
DATA: SENT_TO_ALL TYPE OS_BOOLEAN.
Bytes der Datei
DATA: IT_LENGHT TYPE SO_OBJ_LEN.
DATA: N10(10) TYPE N.
data: it_recipients type standard table of ad_smtpadr.
data: w_recipients type ad_smtpadr.
START-OF-SELECTION.
PERFORM MAIN.
PERFORM RSCONN01_EXECUTE.
END-OF-SELECTION.
FORM MAIN.
TRY.
Dokument erstellen (mit Anhang)
SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
PERFORM HEAD_CONT.
PERFORM RAW_ATT.
Dokument (mit Anhang) setzen
CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
Absender setzen
SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
CALL METHOD SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = SENDER.
Empfänger setzen
LOOP AT it_recipients into w_recipients.
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(w_recipients).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
ENDLOOP.
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS('email@address' ).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
Dokument senden
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
COMMIT WORK.
Sende-Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "main
FORM HEAD_CONT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Betreffzeile'.
WA_TEXT = 'First Line'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line'. APPEND WA_TEXT TO IT_TEXT.
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = ATT_TYPE
I_TEXT = IT_TEXT
I_LENGTH = IT_LENGHT
I_SUBJECT = SUBJECT ).
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "HEAD_CONT
*& Form RAW_ATT
text
FORM RAW_ATT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Text Anhang'.
WA_TEXT = 'First Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
Lenght of Att_Text
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = ATT_TYPE
I_ATT_CONTENT_TEXT = IT_TEXT
I_ATTACHMENT_SIZE = IT_LENGHT
I_ATTACHMENT_SUBJECT = SUBJECT.
Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "ATT_RAW
where the internal table "it_recipients" contains all the e-mail addresses. -
How to send mail to distribution list ?
Hi Everybody,
Pls let me know how to send mail to distributed list???
Thanks & Regards,
raju<b></b>Hi ,
Use Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
U need to pass Distribution list to Receiver and 'C' to receiver type refer the below code for clarification.
Determine the Distribution List.
gv_rec_list-receiver = gv_distribution.
gv_rec_list-rec_type = 'C'.
APPEND gv_rec_list.
Check if Distribution List is deleted.
SELECT SINGLE objnam
FROM soid
INTO lc_objnam
WHERE objnam = gv_rec_list AND
dlitp = lc_dli.
IF sy-subrc = 0.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = gv_doc_data
document_type = 'RAW'
put_in_outbox = 'X'
TABLES
object_content = gv_obj_cont
receivers = gv_rec_list
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4.
CASE sy-subrc.
WHEN '1'.
message i001(as) with 'TOO MANY RECEIVERS'.
EXIT.
WHEN '2'.
message i001(as) with 'DOCUMENT NOT SENT'.
EXIT.
WHEN '3'.
message i001(as) with 'DOCUMENT TYPE DOES NOT EXIST'.
EXIT.
WHEN '4'.
message i001(as) with 'OPERATION NO AUTHORIZATION'.
EXIT.
ENDCASE.
Hope this might have helped you.
Thanks,
Prashanth -
Sending mail to distribution list
HI guys,
Please look at the coding below..
l_wa_recieve-receiver = '[email protected]'. " this is the distribution list id "with number of mail ids inside it
l_wa_recieve-rec_type = 'C'. "shared dis list
APPEND l_wa_recieve TO l_it_recieve.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = "ERROR'
document_type = 'DLI'
put_in_outbox = c_x
commit_work = c_x
TABLES
object_content = l_it_content "this table contains the body of email
receivers = l_it_recieve " this is above
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.
Can you just tell me whether it works fine.. And if it is correct how much time will it take to get email in my respective email address..
I have run this FM by just giving my mail id (not distribution list just giving doctype = 'RAW instead of DLI)
The FM ran sucessfully without any errors , But I didnot receive any mail in my mail Inbox..
Can you please help me how to sort it out getting mail in less time..
Points will be rewarded
regards,
nazeerHI prabhu,
there is no numbmer in the waitinh list but number 5 is in the error column in SCOT..
Can you please tell me what could be the reason..
regards,
nazeer -
Need to send an attachment with the mail to the distribution list
Hi all,
How do I send an <b>attachment</b> with the e-mail to a distribution list?
I am using the FMs <b>SO_DLI_EXPAND</b> and <b>SO_OBJECT_SEND</b> to expand the distribution list and send mail to the distribution list respectively.I am getting the contents of the file in the email that is being sent. The file is being extracted from UNIX.
However, the contents of the file has to go as an attachment.
Please assist.
Thanks and regards,
AnishurHello,
You can do it like this...using SapScript:
REPORT YMAIL.
DATA: ITCPO LIKE ITCPO,
TAB_LINES LIKE SY-TABIX.
Variables for EMAIL functionality
DATA: MAILDATA LIKE SODOCCHGI1.
DATA: MAILPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: MAILHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: MAILBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILREC LIKE SOMLREC90 OCCURS 0 WITH HEADER LINE.
DATA: SOLISTI1 LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
PERFORM SEND_FORM_VIA_EMAIL.
FORM SEND_FORM_VIA_EMAIL *
FORM SEND_FORM_VIA_EMAIL.
CLEAR: MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
REFRESH: MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
Creation of the document to be sent File Name
MAILDATA-OBJ_NAME = 'TEST'.
Mail Subject
MAILDATA-OBJ_DESCR = 'Subject'.
Mail Contents
MAILTXT-LINE = 'Here is your file, would you check it?'.
APPEND MAILTXT.
Prepare Packing List
PERFORM PREPARE_PACKING_LIST.
BREAK gpulido.
Set recipient - email address here!!!
<b>*MAILREC-RECEIVER = '[email protected]'.
MAILREC-RECEIVER = '[email protected]'.
MAILREC-REC_TYPE = 'U'.</b>
APPEND MAILREC.
Set recipient - email address here!!!
*MAILREC-RECEIVER = 'BGIRALDO'.
*MAILREC-REC_TYPE = 'B'.
*APPEND MAILREC.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = MAILDATA
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = MAILPACK
OBJECT_HEADER = MAILHEAD
CONTENTS_BIN = MAILBIN
CONTENTS_TXT = MAILTXT
RECEIVERS = MAILREC
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
submit rsconn01 with mode = 'INT' and return.
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT MAILREC.
WRITE: / mailrec-RECEIVER(48), ':'.
IF mailrec-RETRN_CODE = 0.
WRITE 'sent successfully'.
ELSE.
WRITE 'not sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'no authorization to send to the specified number of'
WHEN 2.
WRITE: / 'document could not be sent to any of the recipients!'.
WHEN 4.
WRITE: / 'no authorization to send !'.
WHEN OTHERS.
WRITE: / 'error occurred during sending !'.
ENDCASE.
ENDFORM.
Form PREPARE_PACKING_LIST
FORM PREPARE_PACKING_LIST.
CLEAR: MAILPACK, MAILBIN, MAILHEAD.
REFRESH: MAILPACK, MAILBIN, MAILHEAD.
DESCRIBE TABLE MAILTXT LINES TAB_LINES.
READ TABLE MAILTXT INDEX TAB_LINES.
MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
Creation of the entry for the compressed document
CLEAR MAILPACK-TRANSF_BIN.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 0.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'RAW'.
APPEND MAILPACK.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM GET_OTF_CODE.
LOOP AT SOLISTI1.
MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
APPEND MAILBIN.
ENDLOOP.
DESCRIBE TABLE MAILBIN LINES TAB_LINES.
MAILHEAD = 'TEST.OTF'.
APPEND MAILHEAD.
Creation of the entry for the compressed attachment
MAILPACK-TRANSF_BIN = 'X'.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 1.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'OTF'.
MAILPACK-OBJ_NAME = 'TEST'.
MAILPACK-OBJ_DESCR = 'Subject'.
MAILPACK-DOC_SIZE = TAB_LINES * 255.
APPEND MAILPACK.
ENDFORM.
Form GET_OTF_CODE
FORM GET_OTF_CODE.
DATA: BEGIN OF OTF OCCURS 0.
INCLUDE STRUCTURE ITCOO .
DATA: END OF OTF.
DATA: ITCPO LIKE ITCPO.
DATA: ITCPP LIKE ITCPP.
CLEAR ITCPO.
ITCPO-TDGETOTF = 'X'.
Start writing OTF code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'YSEND_MAIL'
LANGUAGE = SY-LANGU
OPTIONS = ITCPO
DIALOG = ' '
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'START_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
Close up Form and get OTF code
CALL FUNCTION 'END_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
MOVE-CORRESPONDING ITCPO TO ITCPP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = ITCPP
TABLES
OTFDATA = OTF
EXCEPTIONS
OTHERS = 1.
Move OTF code to structure SOLI form email
CLEAR SOLISTI1. REFRESH SOLISTI1.
LOOP AT OTF.
SOLISTI1-LINE = OTF.
APPEND SOLISTI1.
ENDLOOP.
Reward points if helpful.
Thanks
Message was edited by:
Pattan Naveen -
Capturing the Actual Responder for a notification sent to a Distribution List in Outlook
Hello All,
Morning , need some guidance on the issue mentioned below which we are currently facing.
We had a requirement to send Oracle Workflow Notification to a Distribution List maintained within Microsoft Outlook Mail client/server. The email address of the users which are part of the DL would be setup in this DL . lets say this DL has the
mailing address as : [email protected] which has 4 users in it let's say Oracle Apps FND users : A (email id - [email protected]), B (email id - [email protected]) , C(email id - [email protected]) , D (email id - [email protected]) with their respective email address . This email address within Oracle Apps would be linked at the FND User setup as well as in the HRMS Employee Setup --. Official details section
For this we created a ad hoc role name : 'Role_abcd' as below , then set ad hoc role attribute as shown below ( in the display name and email address we specify the email address created for the Distribution List )
wf_directory.createadhocrole
(role_name => 'Role_abcd',
role_display_name => 'Role_abcd',
notification_preference => 'MAILATTH'
wf_directory.setadhocroleattr
(role_name => 'Role_abcd',
display_name => '[email protected]',
email_address => '[email protected]',
notification_preference => 'MAILATTH' );
Finally we set the Notification Performer
Item Attribute (Next_Approver) and assign the role name ('Role_abcd') created above to this performer :
wf_engine.setitemattrtext (itemtype => p_in_itemtype,
itemkey => p_in_itemkey,
aname => 'NEXT_APPROVER',
avalue => 'Role_abcd' );
Now we are able to successfully send the workflow notifications to this Outlook DL and all the 4 users : A,B,C & D would get the same notification to their email address mentioned as a part of the DL.
Issue :
Now lets say user A Approves this notification from email notification itself using mail id : [email protected] , In this scenario the Responder name which is getting captured in the wf_notifications table is not consistent , sometimes it is getting populated as : email:[email protected] and sometimes as the value for the recipient role/original recipient itself : Role_abcd .This appears to be wrong
Ideally this responder column in wf_notifications table should get populated as ( email:[email protected] ) so that we could identify as to which person within the DL has responded to the notification.
Could someone please help as to how this could be acheived (to identify the actual responder for workflow notification sent to a Outlook Distribution List
ThanksThe following is the criteria when responding notification from email.
1. If there is no user/role exists for the email address from which the notification is responded, the responder column value will be in the form 'email:[email protected]'.
2. If there is only one user/role exists for the email address, then responder column value will be populated with that particular user/role.
3. If there are multiple user/roles with the same email address, then responder column value will be populated with the user in the following preference order
PER -> FND_USR -> OTHERS
What is the customer code lne.
The fix mentioned in step3 was given in 12.1.3 only. The earlier versions have the responder column value will be in the form 'email:[email protected]' if there are multiple users exists for the same email address. -
Which field stores the value of distribution list ?
Actually i want to pass distribution list when i send an attachment from my custom program not a singlre recipient.For sending the mails to the distribution list use the FM
<b>'SO_NEW_DOCUMENT_ATT_SEND_API1'</b> where give the REC_TYPE = 'C'.
Here SGD_BUS_ANLT, SGD_SAL_MNGR etc are the distribution list.
Check the sample code:
*Sending mails to distribution list*
PERFORM f1001_mail_distribution_list.
DATA: lws_docdata LIKE sodocchgi1,
li_objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
li_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
li_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
li_objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
li_objhex LIKE solix OCCURS 10 WITH HEADER LINE,
li_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: lws_tab_lines TYPE i,
lws_doc_size TYPE i,
lws_att_type LIKE soodk-objtp.
CLEAR: lws_docdata, li_objpack, li_objhead, li_objtxt, li_objbin,
li_objhex, li_reclist, lws_tab_lines, lws_doc_size, lws_att_type.
REFRESH: li_objpack, li_objhead, li_objtxt, li_objbin, li_objhex,
li_reclist.
lws_docdata-obj_name = text-019. "EUC
CONCATENATE co_01 text-018 co_10 text-018 ws_conf_year
INTO ws_conf_date.
CONCATENATE text-006 ws_conf_date INTO lws_docdata-obj_descr
SEPARATED BY space.
CONCATENATE text-007 ws_conf_date text-008 INTO li_objtxt
SEPARATED BY space.
APPEND li_objtxt.
CONCATENATE text-009 text-010 ws_conf_date INTO li_objtxt
SEPARATED BY space.
APPEND li_objtxt.
DESCRIBE TABLE li_objtxt LINES lws_tab_lines.
READ TABLE li_objtxt INDEX lws_tab_lines.
lws_docdata-doc_size = ( lws_tab_lines - 1 ) * 255 +
STRLEN( li_objtxt ).
CLEAR li_objpack-transf_bin.
li_objpack-head_start = 1.
li_objpack-head_num = 0.
li_objpack-body_start = 1.
li_objpack-body_num = lws_tab_lines.
li_objpack-doc_type = text-020. "RAW
APPEND li_objpack.
li_reclist-receiver = text-014. "SGD_BUS_ANLT
li_reclist-rec_type = text-021. "C
APPEND li_reclist.
li_reclist-receiver = text-013. "SGD_SAL_MNGR
li_reclist-rec_type = text-021. "C
APPEND li_reclist.
li_reclist-receiver = text-012. "SGD_SAL_SUPT
li_reclist-rec_type = text-021. "C
APPEND li_reclist.
li_reclist-receiver = sy-uname.
li_reclist-rec_type = text-022. "B
APPEND li_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lws_docdata
put_in_outbox = c_x
commit_work = c_x
TABLES
packing_list = li_objpack
object_header = li_objhead
contents_bin = li_objbin
contents_txt = li_objtxt
receivers = li_reclist
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.
IF sy-subrc <> 0.
wa_idoc_status-status = co_stat_appl_err.
wa_idoc_status-msgty = c_stat_err.
wa_idoc_status-msgid = c_msg_class_spa.
wa_idoc_status-msgno = co_001.
wa_idoc_status-msgv1 = text-023.
CASE sy-subrc.
WHEN 1.
wa_idoc_status-msgv2 = text-024.
WHEN 2.
wa_idoc_status-msgv2 = text-025.
WHEN 3.
wa_idoc_status-msgv2 = text-026.
WHEN 4.
wa_idoc_status-msgv2 = text-027.
WHEN 5.
wa_idoc_status-msgv2 = text-028.
WHEN 6.
wa_idoc_status-msgv2 = text-029.
WHEN 7.
wa_idoc_status-msgv2 = text-030.
ENDCASE.
wa_idoc_status-msgv3 = space.
wa_idoc_status-msgv4 = space.
ws_flag = c_x.
EXIT.
ENDIF.
Regards,
Prakash. -
Distribution List in SO_SEND_*?
Hi All,
I am using 'SO_NEW_DOCUMENT_SEND_API1' to send email notification But I am getting x_error in return when I am using Distribution list.
I have created Dist.List in SO23 but still no succeess however when I am sending it by hard coding the email address and changing the receiver type it is working fine.
Can any one suggest solution or sample code for the same.Its urgent
REgardsHi,
Check the sample program to send Mai using the FM you used.
REPORT zvenkat_mai_simple.
* Mai related declarations
"Variables
DATA :
g_sent_to_all TYPE sonv-flag,
g_tab_lines TYPE i.
"Types
TYPES:
t_document_data TYPE sodocchgi1,
t_packing_list TYPE sopcklsti1,
t_attachment TYPE solisti1,
t_body_msg TYPE solisti1,
t_receivers TYPE somlreci1.
"Workareas
DATA :
w_document_data TYPE t_document_data,
w_packing_list TYPE t_packing_list,
w_attachment TYPE t_attachment,
w_body_msg TYPE t_body_msg,
w_receivers TYPE t_receivers.
"Internal Tables
DATA :
i_document_data TYPE STANDARD TABLE OF t_document_data,
i_packing_list TYPE STANDARD TABLE OF t_packing_list,
i_attachment TYPE STANDARD TABLE OF t_attachment,
i_body_msg TYPE STANDARD TABLE OF t_body_msg,
i_receivers TYPE STANDARD TABLE OF t_receivers.
parameters:p_mai(99).
"start-of-selection.
START-OF-SELECTION.
PERFORM send_mai.
"Form send_mai
" PACKING LIST table requires information about how the data in the
" tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to be
" distributed to the documents and its attachments. The first row is
" for the document, the following rows are each for one attachment.
FORM send_mai .
"Subject of the mai.
w_document_data-obj_name = 'MAI_TO_HEAD'.
w_document_data-obj_descr = 'Simple mai using SAP ABAP'.
"Body of the mai
PERFORM build_body_of_mai
USING:space,
'Hi,',
'I am fine. How are you? How are you doing ? ',
'This program has been created to send simple mai',
'with Subject,Body with Address of the sender. ',
'Thanks and Regards,',
'Venkat.O,',
'SAP HR Technical Consultant.'.
"Write Packing List (Body)
DESCRIBE TABLE i_body_msg LINES g_tab_lines.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
w_packing_list-body_num = g_tab_lines.
w_packing_list-doc_type = 'RAW'.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Fill the document data and get size of attachment
READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
"Receivers List.
w_receivers-rec_type = 'U'. "Internet address
w_receivers-receiver = p_mai.
w_receivers-com_type = 'INT'.
w_receivers-notif_del = 'X'.
w_receivers-notif_ndel = 'X'.
APPEND w_receivers TO i_receivers .
CLEAR:w_receivers.
"Function module to send mai to Recipients
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
contents_txt = i_body_msg
receivers = i_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.
IF sy-subrc = 0 .
MESSAGE i303(me) WITH 'Mai has been Successfully Sent.'.
ELSE.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ENDFORM. " send_mai
" Form build_body_of_mai
FORM build_body_of_mai USING l_message.
w_body_msg = l_message.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
ENDFORM. " build_body_of_mai
Regards,
Venkat.O -
hi to all,
i developed a report for sending mails to the corresponding email ids.in this i wrote
select-options: s_manif for sood-objnam no intervals.
if we did not enter any distribution list name it will automatically go to the consignee.
my requirement is while it going to the consignee it should ask a pop up regarding "Manifest will be emailed to Consignee" with ok and cancel buttons. if we click ok button then mail will go to consignee and if we click cancel button it will remain in the transcation
<b>thanks helman for giving the help.</b>
but while i click cancel button it is not remain into the transaction.
data: answer type c.
*LOOP AT S_DLINAM.
LOOP AT S_MANIF.
CLEAR DLI_NAME1.
DLI_NAME1 = S_DLINAM-LOW.
DLI_NAME1 = S_MANIF-LOW.
*IF S_DLINAM IS NOT INITIAL.
IF S_MANIF IS NOT INITIAL.
CALL FUNCTION 'SO_DLI_READ_API1'
EXPORTING
DLI_NAME = DLI_NAME1
DLI_ID = ' '
SHARED_DLI = 'X'
IMPORTING
DLI_DATA = IDLIENT
TABLES
DLI_ENTRIES = IDLIENT.
ENDIF.
LOOP AT IDLIENT.
IT_EMAIL-EMAIL = IDLIENT-MEMBER_ADR.
APPEND IT_EMAIL.
ENDLOOP.
REFRESH IDLIENT.
CLEAR IDLIENT.
CLEAR S_DLINAM.
CLEAR S_MANIF.
ENDLOOP.
*end of insert of tcs_kun.
CLEAR t_email_objtxt[].
Text in the email.
t_email_objtxt = 'PDF is included as attachment.'.
APPEND t_email_objtxt.
Fill the OTF table.
t_email_otf[] = h_sf-otfdata-otfdata[].
Get the address number
READ TABLE t_partners
WITH KEY parvw = 'ZC'.
IF sy-subrc NE 0.
MESSAGE ID 'ZSH' TYPE 'E' NUMBER 999
WITH text-006.
ENDIF.
h_email-addr_receiver = t_partners-adrnr.
Some general settings.
h_email-name_of_object = 'Freight'.
h_email-descr_of_obj = 'FREIGHT/CARGO MANIFEST'.
h_email-descr_attachem = 'FREIGHT.PDF'.
CALL FUNCTION 'ZSH_SEND_PDF_PER_EMAIL2'
EXPORTING
name_of_object = h_email-name_of_object
descript_of_object = h_email-descr_of_obj
descript_attachement = h_email-descr_attachem
address_no_recipient = h_email-addr_receiver
TABLES
OTF = t_email_otf
TEXT_IN_MAIL = t_email_objtxt
ITAB = IT_EMAIL
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 3
ADDRESS_NOT_EXIST = 4
CONV_NOT_POSSIBLE = 5
ERR_OTF_MC_NOENDMARKER = 6
OTHERS = 7.
IF SY-SUBRC = 0.
call function 'POPUP_TO_CONFIRM'
exporting
TITLEBAR = ' '
DIAGNOSE_OBJECT = ' '
text_question = 'Manifest will be emailed to Consignee'
text_button_1 = 'Continue'
ICON_BUTTON_1 = ' '
text_button_2 = 'Cancel'
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = ' '
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
importing
answer = answer
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
CALL FUNCTION 'ZSH_POPUP_MESSAGE'
EXPORTING
is_error = 'I'
popup_title = text-007
message_text = text-008.
ELSE.
CALL FUNCTION 'ZSH_POPUP_MESSAGE'
EXPORTING
is_error = 'E'
popup_title = text-015
message_text = text-016.
ENDIF.
Message was edited by: sun deep
Message was edited by: sun deep
Message was edited by: sun deepYou can do something like this.
report zrich_0001.
data: answer type c.
call function 'POPUP_TO_CONFIRM'
exporting
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
text_question = 'Manifest will be emailed to Consignee'
text_button_1 = 'Continue'
* ICON_BUTTON_1 = ' '
text_button_2 = 'Cancel'
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = ' '
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
importing
answer = answer
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
if answer = '1'.
write:/ 'The answer is yes'.
elseif answer = '2'.
write:/ 'This answer is no'.
endif.
Regards,
Rich Heilman
Maybe you are looking for
-
When I try to wake the MBP from sleep (opening the lid, pressing spacebar, or pressing power button), the computer display doesn't come on. The light on the front shows it is awake but there is no display or backlight though the caps lock lights up.
-
PR To PO conversion via ME59, Closed Indicator
Hi, We have set up ME59 to create POs from PR. 1.The 'Closed' indicator (in Quantities/Dates tab of PR) was not set. What to be done? 2. Main thing which is baffling is that in Production system, multiple POs continue to get created for a single PR.
-
Speed up adding URL hyperlinks to bullets/selected text
Hi, I'm doing a presentation that requires linking a huge amount of the bullet text to different sites. I was hoping to create some sort of macro that told Keynote to add the URL of the current active window in Safari to the selected text, but Automa
-
FileVault - Files & Folders Locked, etc
Since turning off FileVault the folllowing has occurred: All documents listed in the Finder have a "blank" icon. All documents are locked. When I unlock a document in "Get Info" it re-locks when launched again.
-
HP Prime - Math Templates Usage Question
On the HP Prime, if I press the math template key, I see a group of templates pop up on the screen. These templates do not apprear in help nor are they identified in the User's manual. I know what most of them are for, but a few I do not. And the one