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: 

How to send spool to Distribution List using JOB_CLOSE

Former Member
0 Kudos

Please help on sending Distribution list when job defined using JOB_OPEN, JOB_Submit and JOB_CLOSE

Thanks.

5 REPLIES 5

Kanagaraja_L
Active Contributor
0 Kudos

Following tables used to get the distribution List

SODM ,SOFR ,SOID

FM SO_DLI_READ_API1 You can get the List Check the Following Threads

Kanagaraja L

0 Kudos

I've already created distribution list.

I need help that how i can send spool using JOB_CLOSE to the Distribution list i've created.

Thanks.

0 Kudos

Populate the Parameter in JOB_CLOSE

RECIPIENT_OBJ	LIKE	SWOTOBJID	                     	The Mail Recipient of the Spool Lists

Kanagaraja L

0 Kudos

Hi,

I already tried poppulating

RECIPIENT_OBJ LIKE SWOTOBJID The Mail Recipient of the Spool Lists

This works for single email recipient not for the distribution list.

Thanks.

Former Member
0 Kudos

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.