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

Function Module Help

Former Member
0 Likes
542

Is there any FM that sends messgaes to distribution List of the Users(not to Individual Receipients) ..

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
514

hi

u can use any of the below fms..

<b>SO_NEW_DOCUMENT_ATT_SEND_API1

SO_NEW_DOCUMENT_SEND_API1</b>

Cheers,

Abdul Hakim

4 REPLIES 4
Read only

Former Member
0 Likes
514

Its the same function module that sends the mail, you have to specify the dist. list name and change the user type. That should work.

regards,

Ravi

Read only

abdul_hakim
Active Contributor
0 Likes
515

hi

u can use any of the below fms..

<b>SO_NEW_DOCUMENT_ATT_SEND_API1

SO_NEW_DOCUMENT_SEND_API1</b>

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
514

Hi Vicky,

You can use function module <b>SO_DLI_READ</b> to get the list of members in the distribution list. There is internal table MEMBER returned.

Then you loop at internal table MEMBER, populate body for each member-memnam and call the function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send messages.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
514

Hi,

Use the Function module <b>TH_POPUP</b> to send the messages to the user, if you want to send the message to all users, use the below code ..

REPORT Z_MESSAGE_TO_ALL.

PARAMETERS: MESSAGE(128) default ' Error ! Please logoff now ! '.
DATA: OPCODE TYPE X VALUE 2.
DATA: BEGIN OF USR_TABL OCCURS 5.
INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.


CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE
ID 'TAB' FIELD USR_TABL-*SYS*.

LOOP AT USR_TABL.

CALL FUNCTION 'TH_POPUP'
EXPORTING
CLIENT = SY-MANDT
USER = USR_TABL-BNAME
MESSAGE = MESSAGE
* MESSAGE_LEN = 0
* CUT_BLANKS = ' '
EXCEPTIONS
USER_NOT_FOUND = 1
OTHERS = 2.
ENDLOOP

.

Regards

Sudheer