SAP Reports / Programs

/TDAG/CPR_TASK_EMAILPROCESS SAP ABAP Report - Process Selected E-Mails







/TDAG/CPR_TASK_EMAILPROCESS is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). Below is the basic information available for this SAP report including which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC. Also check out the submitted Comments related to this SAP report or see any standard documentation available.

If you would like to execute this report or see the full code listing simply enter /TDAG/CPR_TASK_EMAILPROCESS into the relevant SAP transactions such as SE38 or SE80


Transaction Code(s):

Below is a list of transaction codes which are relevant to this SAP report

/TDAG/CPT03 - Process E-Mails and Generate Tasks


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT /TDAG/CPR_TASK_EMAILPROCESS. "Basic submit
SUBMIT /TDAG/CPR_TASK_EMAILPROCESS AND RETURN. "Return to original report after report execution complete
SUBMIT /TDAG/CPR_TASK_EMAILPROCESS VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: P_EXPPER = Log Expiration Period
Selection Text: P_FA = E-Mails That Failed Processing
Selection Text: P_FA_NO =
Selection Text: P_FA_TP =
Selection Text: P_FA_YR =
Selection Text: P_MN = E-Mails To Be Processed
Selection Text: P_MN_NO =
Selection Text: P_MN_TP =
Selection Text: P_MN_YR =
Selection Text: P_MSGID = Message Class
Selection Text: P_MSGNO = D .
Selection Text: P_PC = Processed E-Mails
Selection Text: P_PC_NO =
Selection Text: P_PC_TP =
Selection Text: P_PC_YR =
Selection Text: P_RETPER = E-Mail Retention Period
Selection Text: P_TCAT = Task Category for New Tasks
Selection Text: P_UK = E-Mails without Attachments
Selection Text: P_UK_NO =
Selection Text: P_UK_TP =
Selection Text: P_UK_YR =
Selection Text: P_UNAM = User Name
Selection Text: P_VEND = Supplier E-Mails
Selection Text: P_CUST = Customer E-Mails
Title: Process Selected E-Mails
Text Symbol: 010 = Specify Origin of E-Mails To Be Processed
Text Symbol: 011 = Supplier E-Mails
Text Symbol: 012 = Customer E-Mails
Text Symbol: 020 = Specify Folders for E-Mail Processing
Text Symbol: 030 = Parameters for Task Creation
Text Symbol: 040 = Additional Parameters
Text Symbol: E01 = Reading of screen values failed
Text Symbol: E02 = Reading folder list failed
Text Symbol: E03 = Folder for Unprocessed E-Mails
Text Symbol: E04 = Folder for Processed E-Mails
Text Symbol: E05 = Folder for E-Mails without Attachments
Text Symbol: E06 = Reading unprocessed e-mails failed
Text Symbol: E07 = Folder for E-Mails for Which Processing Failed





Text Symbol: E08 = Mismatch in substitution data
Text Symbol: E09 = Failure in folder selection dialog
Text Symbol: E10 = Processed mails folder could not be read; cleanup cannot continue
Text Symbol: I01 = Successfully
Text Symbol: I02 = Failed
Text Symbol: I03 = Had no attachments
Text Symbol: S01 = Validate input
Text Symbol: S02 = Delete input
Text Symbol: T01 =


INCLUDES used within this REPORT /TDAG/CPR_TASK_EMAILPROCESS

No INCLUDES are used within this REPORT code!


TABLES used within REPORT and the associated SELECT statement:

No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

RS_SET_SELSCREEN_STATUS CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' EXPORTING p_status = 'SELECTION_SCREEN' * P_PROGRAM = ' ' TABLES p_exclude = itab.

USER_NAME_GET CALL FUNCTION 'USER_NAME_GET' IMPORTING user_name = ls_uname-user_name full_user_name = ls_uname-full_user_name.

F4IF_INT_TABLE_VALUE_REQUEST CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING * DDIC_STRUCTURE = ' ' retfield = lc_retfield * PVALKEY = ' ' dynpprog = l_repid dynpnr = l_dynnr dynprofield = l_dynprofield * STEPL = 0 * WINDOW_TITLE = * VALUE = ' ' value_org = 'S' * MULTIPLE_CHOICE = ' ' * DISPLAY = ' ' * CALLBACK_PROGRAM = ' ' * CALLBACK_FORM = ' ' TABLES value_tab = lt_uname * FIELD_TAB = * RETURN_TAB = * DYNPFLD_MAPPING = EXCEPTIONS parameter_error = 0 no_values_found = 0 OTHERS = 0.

DYNP_VALUES_READ CALL FUNCTION 'DYNP_VALUES_READ' EXPORTING dyname = l_repid dynumb = l_dynnr TABLES dynpfields = lt_dynpfield EXCEPTIONS invalid_abapworkarea = 1 invalid_dynprofield = 2 invalid_dynproname = 3 invalid_dynpronummer = 4 invalid_request = 5 no_fielddescription = 6 invalid_parameter = 7 undefind_error = 8 double_conversion = 9 stepl_not_found = 10 OTHERS = 11.

SO_WIND_FOLDERS_SELECT CALL FUNCTION 'SO_WIND_FOLDERS_SELECT' EXPORTING * EXCLUDE_REGIONS = ' ' folder_access = '2' * FULL_SCREEN = ' ' * ONE_SELECTION = 'X' owner = l_owner region = l_region * SELECTION = 'X' * SOURCE_FOLDER_ID = ' ' folder_selections = ls_folder_sel * CURRENT_FOL_ID = ' ' IMPORTING f_cancelled = l_flg_cancel * F_DOCUMENT_SELECTION = TABLES follist = lt_folder_list EXCEPTIONS component_not_available = 1 operation_no_authorization = 2 owner_not_exist = 3 parameter_error = 4 x_error = 5 error_message = 6 OTHERS = 7.

DYNP_VALUES_UPDATE CALL FUNCTION 'DYNP_VALUES_UPDATE' EXPORTING dyname = l_repid dynumb = l_dynnr TABLES dynpfields = lt_dynpfield EXCEPTIONS OTHERS = 0.

SO_AUTHORITY_CHECK CALL FUNCTION 'SO_AUTHORITY_CHECK' EXPORTING folder_id = is_folder_id owner = sy-uname IMPORTING authority = l_authority folder_data = ls_fld_data EXCEPTIONS OTHERS = 1.

/TDAG/CP_TR02_IMPTYP2FILEXT CALL FUNCTION '/TDAG/CP_TR02_IMPTYP2FILEXT' EXPORTING i_doctype = ic_imptyp-email IMPORTING e_file_ext = l_email_filext CHANGING xt_message = lt_message.

SO_ATTACHMENT_READ_API1 CALL FUNCTION 'SO_ATTACHMENT_READ_API1' EXPORTING attachment_id = -attach_id IMPORTING attachment_data = ls_att_info TABLES attachment_header = lt_att_header attachment_content = lt_att_body EXCEPTIONS attachment_not_exist = 1 operation_no_authorization = 2 parameter_error = 3 x_error = 4 enqueue_error = 5 OTHERS = 6.

/TDAG/CP_LB06_FUNCTION_CHECK CALL FUNCTION '/TDAG/CP_LB06_FUNCTION_CHECK' EXPORTING i_funcname = ls_att_data-imfo-task_det IMPORTING e_flg_error = l_flg_det_error.

/TDAG/RCS_COM4_TASK_CREATE_EML CALL FUNCTION '/TDAG/RCS_COM4_TASK_CREATE_EML' EXPORTING is_email_body = ls_email_body is_email_doc = is_taskmsg = ls_task_msg IMPORTING ev_header_no = lv_header_no e_flg_error = l_flg_error TABLES it_att_data = lt_att_no_data.

/TDAG/RCS_COM4_TASK_CREATE_EML CALL FUNCTION '/TDAG/RCS_COM4_TASK_CREATE_EML' EXPORTING is_email_body = ls_email_body is_email_doc = is_taskmsg = ls_task_msg IMPORTING ev_header_no = lv_header_no e_flg_error = l_flg_error TABLES it_att_data = lt_att_no_data.

SO_DOCUMENT_MOVE_API1 CALL FUNCTION 'SO_DOCUMENT_MOVE_API1' EXPORTING old_document_id = ps_doc_data-doc_id new_folder_id = l_dst_fol_id_1 * IMPORTING * NEW_DOCUMENT_ID = EXCEPTIONS new_folder_not_exist = 1 document_not_exist = 2 document_already_in_folder = 3 operation_no_authorization = 4 parameter_error = 5 x_error = 6 enqueue_error = 7 OTHERS = 8.

SO_SOOD_READ





CALL FUNCTION 'SO_SOOD_READ' EXPORTING object_id = l_doc_id IMPORTING sood_dat = ls_sood_data EXCEPTIONS object_not_exist = 1 x_error = 2 OTHERS = 3.

SO_DOCUMENT_MOVE CALL FUNCTION 'SO_DOCUMENT_MOVE' EXPORTING * FORWARDER = ' ' new_parent = l_dst_fol_id object_id = l_doc_id old_parent = l_src_fol_id owner = ls_sood_data-ownnam EXCEPTIONS folder_no_authorization = 1 new_folder_not_exist = 2 object_already_in_folder = 3 object_not_exist = 4 old_folder_not_exist = 5 operation_no_authorization = 6 parameter_error = 7 x_error = 8 OTHERS = 9.

SO_SOFD_READ CALL FUNCTION 'SO_SOFD_READ' EXPORTING folder_id = l_folder_id IMPORTING sofd_dat = ls_folder_data EXCEPTIONS component_not_available = 1 object_not_exist = 2 x_error = 3 OTHERS = 4.

SO_USER_WITH_ID_READ CALL FUNCTION 'SO_USER_WITH_ID_READ' EXPORTING usrtp = ls_folder_data-owntp usryr = ls_folder_data-ownyr usrno = ls_folder_data-ownno IMPORTING mainuserdata = ls_user_data EXCEPTIONS system_failure = 1 user_not_exist = 2 communication_failure = 3 OTHERS = 4.

SO_FOLDER_READ CALL FUNCTION 'SO_FOLDER_READ' EXPORTING * FILTER = object_id = l_folder_id * FORWARDER = * owner = ls_user_data-usrnam "NEE owner = sy-uname "NEE
* IMPORTING * object_hd_display = * OBJECT_SD_DISPLAY = * OBJECT_RC_DISPLAY = * TABLE_EMPTY = * INVISIBLE_FOR_SUBST = TABLES folder_cont = lt_folder_contents * FIELDS = EXCEPTIONS active_user_not_exist = 1 communication_failure = 2 component_not_available = 3 folder_not_exist = 4 operation_no_authorization = 5 owner_not_exist = 6 substitute_not_active = 7 substitute_not_defined = 8 system_failure = 9 x_error = 10 OTHERS = 11.

SO_SOOD_READ CALL FUNCTION 'SO_SOOD_READ' EXPORTING object_id = l_object_id IMPORTING sood_dat = ls_sood_data EXCEPTIONS object_not_exist = 1 x_error = 2 OTHERS = 3.

SO_OBJECT_READ CALL FUNCTION 'SO_OBJECT_READ' EXPORTING * FILTER = folder_id = l_folder_id * FORWARDER = object_id = l_object_id * owner = ls_sood_data-ownnam "NEE * F_MAILER = ' ' * IMPORTING * OBJECT_FL_DISPLAY = * OBJECT_HD_DISPLAY = * OBJECT_RC_DISPLAY = TABLES objcont = lt_body_cont * OBJHEAD = * OBJPARA = * OBJPARB = EXCEPTIONS active_user_not_exist = 1 communication_failure = 2 component_not_available = 3 folder_not_exist = 4 folder_no_authorization = 5 object_not_exist = 6 object_no_authorization = 7 operation_no_authorization = 8 owner_not_exist = 9 parameter_error = 10 substitute_not_active = 11 substitute_not_defined = 12 system_failure = 13 x_error = 14 OTHERS = 15.

SO_ATTACHMENT_LIST_READ CALL FUNCTION 'SO_ATTACHMENT_LIST_READ' EXPORTING object_id = l_object_id TABLES OBJECTS = lt_atts EXCEPTIONS system_failure = 1 communication_failure = 2 OTHERS = 3.

SO_SOOD_READ CALL FUNCTION 'SO_SOOD_READ' EXPORTING object_id = l_object_id IMPORTING sood_dat = ls_sood_data EXCEPTIONS object_not_exist = 1 x_error = 2 OTHERS = 3.

SO_OBJECT_DELETE CALL FUNCTION 'SO_OBJECT_DELETE' EXPORTING folder_id = l_folder_id * FORWARDER = ' ' * F_UNREAD_DELETE = ' ' object_id = l_object_id owner = ls_sood_data-ownnam * PUT_IN_WASTEBASKET = 'X' EXCEPTIONS communication_failure = 1 folder_not_empty = 2 folder_not_exist = 3 folder_no_authorization = 4 forwarder_not_exist = 5 object_not_exist = 6 object_no_authorization = 7 operation_no_authorization = 8 owner_not_exist = 9 substitute_not_active = 10 substitute_not_defined = 11 system_failure = 12 x_error = 13 OTHERS = 14.

CV120_DOC_GET_APPL CALL FUNCTION 'CV120_DOC_GET_APPL' EXPORTING pf_file = l_filename TABLES ptx_tdwp = lt_tdwp.

/TDAG/RCS_COM1_INCTYP_GET CALL FUNCTION '/TDAG/RCS_COM1_INCTYP_GET' EXPORTING i_filename = l_filename i_filesize = l_tmp_size i_flg_get_hdrno = esp1_true is_source = ls_source IMPORTING e_inctyp = l_imptyp et_taskhdrno = xt_taskh ev_encoding = lv_encoding CHANGING xt_errors = lt_error_all[] EXCEPTIONS imptyp_not_found = 1 open_file = 2 function_modul = 3 OTHERS = 4.

/TDAG/RCS_COM1_INCOM_READ CALL FUNCTION '/TDAG/RCS_COM1_INCOM_READ' EXPORTING i_inctyp = l_imptyp IMPORTING es_imptyp = es_incom.

SCMS_XSTRING_TO_BINARY CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = l_xbuffer * APPEND_TO_TABLE = ' ' * IMPORTING * OUTPUT_LENGTH = TABLES binary_tab = xt_dst.

/TDAG/CP_LB03_MSGS_DISPL_LOG CALL FUNCTION '/TDAG/CP_LB03_MSGS_DISPL_LOG' EXPORTING i_flg_amodal = esp1_false i_flg_shw_win_always = esp1_true it_messages = lt_msg.

BAL_LOG_CREATE CALL FUNCTION 'BAL_LOG_CREATE' EXPORTING i_s_log = ls_log_header IMPORTING e_log_handle = g_log_handle EXCEPTIONS log_header_inconsistent = 0 OTHERS = 0.

BAL_GLB_MSG_DEFAULTS_SET CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_SET' EXPORTING * I_AUTHORIZATION = i_s_msg_defaults = ls_msg_defaults EXCEPTIONS not_authorized = 0 defaults_inconsistent = 0 OTHERS = 0 .

BAL_LOG_MSG_ADD CALL FUNCTION 'BAL_LOG_MSG_ADD' EXPORTING i_log_handle = g_log_handle i_s_msg = ls_bal_msg * IMPORTING * E_S_MSG_HANDLE = * E_MSG_WAS_LOGGED = * E_MSG_WAS_DISPLAYED = EXCEPTIONS log_not_found = 0 msg_inconsistent = 0 log_is_full = 0 OTHERS = 0 .

BAL_LOG_MSG_ADD CALL FUNCTION 'BAL_LOG_MSG_ADD' EXPORTING * i_log_handle = i_s_msg = ls_bal_msg * IMPORTING * E_S_MSG_HANDLE = * E_MSG_WAS_LOGGED = * E_MSG_WAS_DISPLAYED = EXCEPTIONS log_not_found = 0 msg_inconsistent = 0 log_is_full = 0 OTHERS = 0 .

BAL_DB_SAVE CALL FUNCTION 'BAL_DB_SAVE' EXPORTING * I_CLIENT = SY-MANDT * I_IN_UPDATE_TASK = ' ' * I_SAVE_ALL = ' ' i_t_log_handle = lt_log_handles * IMPORTING * e_new_lognumbers = EXCEPTIONS log_not_found = 0 save_not_allowed = 0 numbering_error = 0 OTHERS = 0 .




BAL_GLB_MSG_DEFAULTS_GET CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_GET' IMPORTING e_s_msg_defaults = ls_msg_defaults.

BAL_GLB_MSG_DEFAULTS_SET CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_SET' EXPORTING * I_AUTHORIZATION = i_s_msg_defaults = ls_msg_defaults EXCEPTIONS not_authorized = 0 defaults_inconsistent = 0 OTHERS = 0 .

BAL_GLB_MSG_DEFAULTS_GET CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_GET' IMPORTING e_s_msg_defaults = ls_msg_defaults.

BAL_GLB_MSG_DEFAULTS_SET CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_SET' EXPORTING * I_AUTHORIZATION = i_s_msg_defaults = ls_msg_defaults EXCEPTIONS not_authorized = 0 defaults_inconsistent = 0 OTHERS = 0 .

/TDAG/CP_TR0C_TASKMSG_GET CALL FUNCTION '/TDAG/CP_TR0C_TASKMSG_GET' EXPORTING i_taskcat = i_taskcat i_msgid = i_msgid i_msgno = i_msgno IMPORTING es_taskmsg = ls_tcmsg EXCEPTIONS no_data_found = 1 OTHERS = 2.

SUSR_USER_CHECK_EXISTENCE CALL FUNCTION 'SUSR_USER_CHECK_EXISTENCE' EXPORTING user_name = l_user EXCEPTIONS user_name_not_exists = 1 OTHERS = 2.

SO_SUBSTITUTION_ACTIVE CALL FUNCTION 'SO_SUBSTITUTION_ACTIVE' EXPORTING substitute = sy-uname TABLES substitutions = lt_substitutions EXCEPTIONS OTHERS = 0.

SO_FOLDER_LIST_READ CALL FUNCTION 'SO_FOLDER_LIST_READ' EXPORTING * EXCLUDE_REGIONS = ' ' folder_access = i_fld_access folder_selections = ls_fld_sel owner = i_uname region = gcs_folders-region-shared * SOURCE_FOLDER_ID = ' ' * PARENT_ID = ' ' current_fol_id = ls_fld_key * IMPORTING * TABLE_EMPTY = * TABLE_HIER = * TABLE_100_ROWS = TABLES folder_list = lt_folder_list EXCEPTIONS component_not_available = 1 operation_no_authorization = 2 owner_not_exist = 3 parameter_error = 4 x_error = 5 OTHERS = 6.

SO_FOLDER_LIST_READ CALL FUNCTION 'SO_FOLDER_LIST_READ' EXPORTING * EXCLUDE_REGIONS = ' ' folder_access = i_fld_access folder_selections = ls_fld_sel owner = i_uname region = gcs_folders-region-private * SOURCE_FOLDER_ID = ' ' * PARENT_ID = ' ' current_fol_id = ls_fld_key * IMPORTING * TABLE_EMPTY = * TABLE_HIER = * TABLE_100_ROWS = TABLES folder_list = lt_folder_list EXCEPTIONS component_not_available = 1 operation_no_authorization = 2 owner_not_exist = 3 parameter_error = 4 x_error = 5 OTHERS = 6.

SO_ADDRESS_GET CALL FUNCTION 'SO_ADDRESS_GET' EXPORTING adrnr = l_so_key * SNDART = ' ' * LFDNR = ' ' * NO_ADDRESS = ' ' * NO_NAME = ' ' * GET_DATA = ' ' * USE_HOME_ADDRESS = ' ' IMPORTING address = l_address * ADDRESS_STRING = sndart = l_sndart * LFDNR = name = l_name data = ls_data * TITLE_TEXT = EXCEPTIONS address_not_exist = 1 x_error = 2 OTHERS = 3.

SO_ADDRESS_GET CALL FUNCTION 'SO_ADDRESS_GET' EXPORTING adrnr = l_so_key * SNDART = ' ' * LFDNR = ' ' * NO_ADDRESS = ' ' * NO_NAME = ' ' * GET_DATA = ' ' * USE_HOME_ADDRESS = ' ' IMPORTING address = l_address * ADDRESS_STRING = sndart = l_sndart * LFDNR = name = l_name data = ls_data * TITLE_TEXT = EXCEPTIONS address_not_exist = 1 x_error = 2 OTHERS = 3.

CONVERSION_EXIT_ALPHA_OUTPUT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT':
EXPORTING input = i_proc_cnt IMPORTING output = l_proc_cnt,
EXPORTING input = i_fail_cnt IMPORTING output = l_fail_cnt,
EXPORTING input = i_unkn_cnt IMPORTING output = l_unkn_cnt,
EXPORTING input = l_totl_cnt IMPORTING output = l_totl_cnt,
EXPORTING input = x_main_cnt_n IMPORTING output = l_main_cnt_n.

SAPGUI_PROGRESS_INDICATOR CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING percentage = l_progress text = l_progress_text.

SCMS_XSTRING_TO_BINARY CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_hex_string IMPORTING output_length = l_doc_size TABLES binary_tab = lt_eml_body_orblk.

/TDAG/CP_LB13_SO_CLEAN_FILENAM CALL FUNCTION '/TDAG/CP_LB13_SO_CLEAN_FILENAM' EXPORTING i_filename = x_filename IMPORTING e_filename = x_filename.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name /TDAG/CPR_TASK_EMAILPROCESS or its description.