Application Development 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: 

Function module to get all users of a distribution list

Former Member
0 Kudos

Hi,

Is there a function module to extract all the users of a Distribution List ? I tried using Fn 'SO_DLI_READ'.. I created a tabletype of the 'SODM1' and make a internal table of this type to store all the results.. But its triggering an exception.

Is there another one available ?

Regards

Sukanya

2 REPLIES 2

Former Member

Here is some code that works...

Load distribution list name in DLINAME. List comes back in DLIENTRIES. Note that distribution list can have different types of entries...SAP User IDs or SMTP addresses.

Part of a z-method that takes a distribution list and creates two tables...one with user ids and one with corresponding SMTP addresses (which are taken from the distribution list or from SAP central address management or from user profile forwarding address) Useful in workflow.

DATA:

DLINAME LIKE SOOBJINFI1-OBJ_NAME,

DLIDATA LIKE SODLIDATI1,

DLIENTRIES LIKE SODLIENTI1 OCCURS 0 with header line.

CALL FUNCTION 'SO_DLI_READ_API1'

EXPORTING

SHARED_DLI = 'X'

DLI_ID = SPACE

DLI_NAME = DLINAME

IMPORTING

DLI_DATA = DLIDATA

TABLES

DLI_ENTRIES = DLIENTRIES

EXCEPTIONS

DLI_NOT_EXIST = 9001

OPERATION_NO_AUTHORIZATION = 9002

PARAMETER_ERROR = 9003

X_ERROR = 9004

OTHERS = 01.

Former Member
0 Kudos

Check function module SO_DLI_LIST_READ and tables SOID, SODM, SOUD.

Thanks

Seshu