08-21-2007 4:44 AM
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
08-31-2007 8:43 PM
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.
08-31-2007 9:17 PM
Check function module SO_DLI_LIST_READ and tables SOID, SODM, SOUD.
Thanks
Seshu