Idoc/ALE error handling, send to external email

Hi all,
I'm developing an IDoc inbound interface for purchase order create using PORDCR1. For the error handling functionality, I need to send an external email describing all of the validation error happened in user-exit EXIT_SAPFKCIM_002. Please kindly tell me how to cater the functionality. I won't use workflow because the error handling can't describe all the error, it just displaying the first error encountered. I also don't want to create any custom object since message type PORDCR1 is available. I think creating a custom FM is a possible way, but if there is another way, please tell me how.
Thanks,
Teddy

Hi Teddy,
A custom FM is the easiest and simple way.There may be other ways.
Regards,
Atish

Similar Messages

  • About ale error handling in workflow?

    Hi,
    can any one explian in detail ale error handling through workflow,its urgent for me.
    Regards,
    phani

    Hi Srikanth,
    follw the steps it will helpful u,
    Pre-requisites. 
    It is assumed that the reader of this article has some knowledge in SAP workflow BOR objects and ALE Idoc process like process code, Partner Profile etc. 
    Description 
    Here, we will be discussing in details the Error handling of an Inbound Idoc through triggering an event, which in turn will be triggering a workflow attached to the workflow. 
    Steps:-
    1.     Create custom BOR object with the events, Start and Stop event
    2.     Create a workflow for the error handling, like generating a notification whenever an error occurred in the Inbound Idoc.
    3.     Creation of Function Module and attachment with the Process Code
    4.     Create the settings for the Inbound Process of the Idoc through the Process Code.
    Creation of BOR objects. Go to the[http://www.****************/Tutorials/ALE/ErrorHandling/page3.htm] transaction SWO1. 
    Enter a name for the Object type and click ‘CREATE’ button for creating the custom BOR object. 
    Enter the details required for creating the BOR objects... 
    Create the Key fields and events of the BOR object.
    For creating the Key fields place the cursor on the Key fields and Click on the Create Button
    Create events for triggering the workflow and stopping the workflow.
    For creating the event place the cursor on the EVENTS and Click the create button like Key fields.
    Create two events.
    Enter the event name description etc and proceed further to create it. 
    Similarly create another event for ending the Workflow in the similar manner like that created earlier. 
    Now, Generate the BOR object through the generate button
    Release the EVENTS and subsequently release the BOR object. 
    After the creation of BOR object
    Create a workflow for the generation of notification whenever an error is reached in the Inbound Idoc.
    Execute the transaction SWDD. 
    Click on the CREATE button for creating the workflow for error handling. 
    Choose the Step type to be inserted for the notification like here we are using Send Mail option for sending a mail to the user whenever any error occurred.
    Activate the Workflow and test it whether it is working as per the requirement.
    After the successful completion it is required to attach the workflow with the event.
    Go to the Header section (Denoted by CAP).
    Go to the Start Events TAB.        
    Enter the details of the event with which the workflow should be linked like the category, BOR object type and the event with which that should be linked.
    Enter here the BOR object that has been created and give the name of event created for starting the workflow.
    Click on the Binding Button for generating the binding between the event and the workflow.
    Click on the Binding Button for generating the binding between the event and the workflow.
    Generate the binding and click OK button to save the binding.
    Click on Activate / deactivate button for activating the linkage.
    After the successful linkage the following sign will appear on the workflow..... 
    This shows that the workflow has been linked to the event and it will be triggered whenever that particular event will be triggered. 
    After the creation and successful linkage of workflow with the event it is required it is required to generate a function module and attached it to the process code. 
    Go to SE37 transaction and copy a standard process code function module to a custom one. Do no delete any parameters from the function module as the SAP standard program itself is calling this. 
    In that function module do the required validation and whenever the validation fails set a standard parameter ‘WORKFLOW_RESULT’ to 9999 from within the function module, otherwise normally proceed to set the status to 53.
    After the creation of function module it is required to attach it to the process code and corresponding attached to the message type at the Partner Profile stage.
    The process code is being created through the transaction WE42
    Go to the change mode and click the New Entries button for creating new process code. 
    Enter the Process Code Name, description and choose the processing type as Processing by function module. Click on the extension button of Identification.
    The details for the of the Process Code after clicking the identification button will be  
    Whenever idoc arrives into the Destination system then the standard SAP triggers the Process code attached to the Message type in the partner profile. The partner profile is being maintained in the transaction WE20. 
    Since, it is and inbound scenario so the message type and the corresponding process code will be maintained for the Inbound Parameters. 
    Click on Create Inbound Parameters button for creating new Inbound Message type and the corresponding message type. 
    Enter the process code for the corresponding message type. 
    Click SAVE button for saving the changes. 
    Whenever the IDOC arrives into the target system, it checks the partner profile and finds the corresponding process code. The process code is being linked with the function module through which the IDOC is required to be processed.
    Regards,
    Phani.

  • Alv result send to External email adreess

    hi,
    i want to send Alv grid result send to External email adreess.n e body help me how can i do this

    use the code:
    FORM docu_send_email USING pv_otfdata  TYPE tsfotf
                               pv_emailid  TYPE any
                               pv_formname TYPE any.
      DATA: lv_filesize    TYPE i,
            lv_buffer      TYPE string,
            lv_attachment  TYPE i,
            lv_testo       TYPE i.
      DATA: li_pdfdata  TYPE STANDARD TABLE OF tline,
            li_mess_att TYPE STANDARD TABLE OF solisti1,
            li_mtab_pdf TYPE STANDARD TABLE OF tline,
            li_objpack  TYPE STANDARD TABLE OF sopcklsti1,
            li_objtxt   TYPE STANDARD TABLE OF solisti1,
            li_objbin   TYPE STANDARD TABLE OF solisti1,
            li_reclist  TYPE STANDARD TABLE OF somlreci1,
            li_objhead  TYPE soli_tab.
      DATA: lwa_pdfdata  TYPE tline,
            lwa_objpack  TYPE sopcklsti1,
            lwa_mess_att TYPE solisti1,
            lwa_objtxt   TYPE solisti1,
            lwa_objbin   TYPE solisti1,
            lwa_reclist  TYPE somlreci1,
            lwa_doc_chng TYPE  sodocchgi1.
      CONSTANTS: lc_u           TYPE char1  VALUE 'U',
                 lc_0           TYPE char1  VALUE '0',
                 lc_1           TYPE char1  VALUE '1',
                 lc_pdf         TYPE char3  VALUE 'PDF',
                 lc_raw         TYPE char3  VALUE 'RAW',
                 lc_ordform     TYPE char15 VALUE 'ZORDCONFIRM_01',
                 lc_attachment  TYPE char10 VALUE 'ATTACHMENT'.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = lc_pdf
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = lv_filesize
        TABLES
          otf                   = pv_otfdata
          lines                 = li_pdfdata
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT li_pdfdata INTO lwa_pdfdata.
        TRANSLATE lwa_pdfdata USING ' ~'.
        CONCATENATE lv_buffer lwa_pdfdata INTO lv_buffer.
        CLEAR lwa_pdfdata.
      ENDLOOP.
      TRANSLATE lv_buffer USING '~ '.
      DO.
        lwa_mess_att = lv_buffer.
        APPEND lwa_mess_att TO li_mess_att.
        CLEAR lwa_mess_att.
        SHIFT lv_buffer LEFT BY 255 PLACES.
        IF lv_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Object with PDF.
      REFRESH li_objbin.
      li_objbin[] = li_mess_att[].
      DESCRIBE TABLE li_objbin LINES lv_attachment.
    Object with main text of the mail.
      lwa_objtxt = space.
      APPEND lwa_objtxt TO li_objtxt.
      CLEAR lwa_objtxt.
      DESCRIBE TABLE li_objtxt LINES lv_testo.
    Create the document which is to be sent
      lwa_doc_chng-obj_name  = text-008.
      lwa_doc_chng-obj_descr = text-008.
      lwa_doc_chng-sensitivty = lc_0.
      lwa_doc_chng-obj_prio = lc_1.
      lwa_doc_chng-doc_size = lv_testo * 225.
    Pack to main body.
      CLEAR lwa_objpack-transf_bin.
    header
      lwa_objpack-head_start = 1.
    The document needs no header (head_num = 0)
      lwa_objpack-head_num   = 0.
    body
      lwa_objpack-body_start = 1.
      lwa_objpack-body_num   = lv_testo.
      lwa_objpack-doc_type   = lc_raw.
      APPEND lwa_objpack TO li_objpack.
      CLEAR lwa_objpack.
    Create the attachment.
    Fill the fields of the packing_list for the attachment:
      lwa_objpack-transf_bin = gc_x .
    header
      lwa_objpack-head_start = 1.
      lwa_objpack-head_num   = 1.
    body
      lwa_objpack-body_start = 1.
      lwa_objpack-body_num   = lv_attachment.
      lwa_objpack-doc_type   = lc_pdf.
      lwa_objpack-obj_name   = lc_attachment.
      lwa_objpack-obj_descr  = text-008.
      lwa_objpack-doc_size =  lv_attachment * 255.
      APPEND lwa_objpack TO li_objpack.
      CLEAR lwa_objpack.
      lwa_reclist-receiver   = pv_emailid.
      lwa_reclist-rec_type   = lc_u.
      lwa_reclist-notif_del  = gc_x.
      lwa_reclist-notif_ndel = gc_x.
      APPEND lwa_reclist TO li_reclist.
      IF li_reclist IS NOT INITIAL.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = lwa_doc_chng
            put_in_outbox              = gc_x
          TABLES
            packing_list               = li_objpack
            object_header              = li_objhead
            contents_bin               = li_objbin
            contents_txt               = li_objtxt
            receivers                  = li_reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.

  • Unable to send to external email recipients - Multi Tenant Exchange 2013 - MultiRole servers in DAG

    Greetings all, I hope someone can help.
    I have created a Exchange 2013 multi-tenant organization, with two servers, both multi-role - CAS and Mailbox roles.
    Internal mail flow is fine (external email addresses can send to the domain).
    External firewall port forwards ports 443 and 25 to the Internal DAG IP address.
    There are two multi-role Exchange servers that are members of the DAG.
    I am able to connect to OWA and ECP via https://externalIP/OWA and https://alias.domain.com/OWA
    No SSL certificates have been purchased or installed yet.
    Exchange URLs have not been changed since default configuration at install.
    OWA and ECP works both internal and external.
    External DNS works with SPF and PTR records correctly configured
    Exchange RCA - Send test only fails with one Spam Listing (this Blacklist provider now flags all domains and you cannot ask to be removed)
    Send Connectors are the default ones created during install. Receive connector is standard configuration with  - * - 
    When sending email to an external address, I receive a failure notice
    ServerName.test.corp.int gave this error:
    Unable to relay 
    Your message wasn't delivered due to a permission or security issue. It may have been rejected by a moderator, the address may only accept email from certain senders, or another restriction may be preventing delivery.
    More Info - 
    ServerName.test.corp.int
    Remote Server returned '550 5.7.1 Unable to relay'
    I have been troubleshooting this for many hours with no progress.
    I have created new Send Connectors for the server that is advising that it is unable to relay, but they have all failed.
    I have tried setting the Internal IP address for Exhange Server 1 (Exchange Server 2 reports failure), with most combinations of Security (Anonymous, Exchange Users, etc).
    I have also tried with the IP range 192.168.11.0/24 to allow the whole the subnet, I still receive the unable to relay failure notice.
    I have tried this guide - hxxps://glazenbakje.wordpress.com/2012/12/30/exchange-2013-how-to-configure-an-internal-relay-connector/ - with different combinations, still no resolution.
    I am at a loss as to why I can't send out with the default configuration. I would assume that email would flow out without any changes, but this does not happen.
    Can someone please assist before I lose my sanity.
    Thanks in advance,
    Terry

    Greetings all, I hope someone can help.
    I have created a Exchange 2013 multi-tenant organization, with two servers, both multi-role - CAS and Mailbox roles.
    Internal mail flow is fine.
    Incoming mail from external senders is also fine. - 
    external email addresses can send to the domain).
    External firewall port forwards ports 443 and 25 to the Internal DAG IP address.
    There are two multi-role Exchange servers that are members of the DAG.
    I am able to connect to OWA and ECP via https://externalIP/OWA and https://alias.domain.com/OWA
    No SSL certificates have been purchased or installed yet.
    Exchange URLs have not been changed since default configuration at install.
    OWA and ECP works both internal and external.
    External DNS works with SPF and PTR records correctly configured
    Exchange RCA - Send test only fails with one Spam Listing (this Blacklist provider now flags all domains and you cannot ask to be removed)
    Receive Connectors are the default ones created during install. Send connector is standard configuration with  - * - 
    When sending email to an external address, I receive a failure notice
    ServerName.test.corp.int gave this error:
    Unable to relay 
    Your message wasn't delivered due to a permission or security issue. It may have been rejected by a moderator, the address may only accept email from certain senders, or another restriction may be preventing delivery.
    More Info - 
    ServerName.test.corp.int
    Remote Server returned '550 5.7.1 Unable to relay'
    I have been troubleshooting this for several days with no progress.
    I have created new Receive Connectors for the server that is advising that it is unable to relay, but they have all failed.
    I have tried setting the Internal IP address for Exhange Server 1 (Exchange Server 2 reports failure), with most combinations of Security (Anonymous, Exchange Users, etc).
    I have also tried with the IP range 192.168.11.0/24 to allow the whole the subnet, I still receive the unable to relay failure notice.
    I have tried this guide - hxxps://glazenbakje.wordpress.com/2012/12/30/exchange-2013-how-to-configure-an-internal-relay-connector/ - with different combinations, still no resolution.
    Even more info - Further troubleshooting -
    I found my one of my Exchange servers had an extra NIC. I have since added a second NIC to the other server, so now both Exchange servers have dual NICs. I removed the DAG cleanly and recreated the DAG from scratch, using this link -
    hxxp://careexchange.in/how-to-create-a-database-availability-group-in-exchange-2013/ 
    The issue still exists, even with a newly created DAG. I also found that the Tenant Address Books were not 'applied'. I applied them but still no resolution
    I think the issue is related to multi-tenant configuration even though the error says that it can't relay. The unable to relay message can appear when sending from a domain that the Organization does not support. Like trying to email as [email protected]
    when you domain name is apple.com - But through extensive research I still can't resolve the issue.
    Can someone please assist before I lose my sanity.
    Thanks in advance,
    Terry

  • Reg : Issue for Sending of external email using SO_OBJECT_SEND

    There is one issue while sending external email using SO_OBJECT_SEND functional module.
    1. The body of the mail is also included as attachment.
    I want to avoid the same.
    Please anyone can give the solution.

    hi check this example ,
    Sending mail with attachment report in Background
    Content Author: Fernando Faian
    I have read the hint about "Sending mail with attachment report".
    It's great, but how can I make this function work in background??
    I had that needed last year too. See attachment a function group with two functions. The second one has that functionality to send email or fax (SAP office) with attachment objects in background job using SO_ATTACHMENT_INSERT function. 
    Pay attention because it’s working with output list from spool converted to pdf. 
    =================================================================================
    z_send_email_fax_global
    FUNCTION-POOL z_gfaian_mail_fax.            "MESSAGE-ID ..
    WORK TABLE AREAS
    TABLES: tsp01.
    INTERNAL TABLES
    DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
          lt_note_text   LIKE STANDARD TABLE OF soli  WITH HEADER LINE,
          lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
    DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
          lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
    DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
    TYPES: BEGIN OF y_files,
           file(60) TYPE c,
           END OF y_files.
    DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
    DATA: l_objcont     LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: l_objhead     LIKE soli OCCURS 0 WITH HEADER LINE.
    STRUCTURES
    DATA: folder_id      LIKE soodk,
          object_id      LIKE soodk,
          link_folder_id LIKE soodk,
          g_document     LIKE sood4,
         g_header_data  LIKE sood2,
          g_folmem_data  LIKE sofm2,
          g_header_data  LIKE sood2,
          g_receive_data LIKE soos6,
          g_ref_document LIKE sood4,
          g_new_parent   LIKE soodk,
          l_folder_id    LIKE sofdk,
          v_email(50).
    DATA: hd_dat  like sood1.
    VARIABLES
    DATA: client  LIKE tst01-dclient,
          name    LIKE tst01-dname,
          objtype LIKE rststype-type,
          type    LIKE rststype-type.
    DATA: numbytes TYPE i,
          arc_idx LIKE toa_dara,
          pdfspoolid LIKE tsp01-rqident,
          jobname LIKE tbtcjob-jobname,
          jobcount LIKE tbtcjob-jobcount,
          is_otf.
    DATA: outbox_flag LIKE sonv-flag VALUE 'X',
          store_flag  LIKE sonv-flag,
          delete_flag LIKE sonv-flag,
          owner       LIKE soud-usrnam,
          on          LIKE sonv-flag VALUE 'X',
          sent_to_all LIKE sonv-flag,
          g_authority LIKE sofa-usracc,
          w_objdes    LIKE sood4-objdes.
    DATA: c_file LIKE rlgrap-filename,
          n_spool(6) TYPE n.
    DATA: cancel.
    DATA: desired_type  LIKE sood-objtp,
          real_type LIKE sood-objtp,
          attach_type LIKE sood-objtp,
          otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
          ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
    CONSTANTS
    CONSTANTS: ou_fol LIKE sofh-folrg              VALUE 'O',
               c_objtp    LIKE g_document-objtp    VALUE 'RAW',
               c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
    =================================================================================
    z_send_email_fax2
    FUNCTION z_faian_mail_fax2.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(FAX_MAIL_NUMBER) TYPE  SO_NAME
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"     REFERENCE(OBJECT_TYPE) TYPE  SO_ESCAPE
    *"  TABLES
    *"      LT_BODY_EMAIL STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
    Fist part: Verify if the spool really exists
      SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
      IF sy-subrc NE 0.
        RAISE err_no_abap_spooljob. "doesn't exist
      ELSE.
        client = tsp01-rqclient.
        name   = tsp01-rqo1name.
        CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  authority     = 'SP01'
                  client        = client
                  name          = name
                  part          = 1
             IMPORTING
                  type          = type
                  objtype       = objtype
             EXCEPTIONS
                  fb_error      = 1
                  fb_rsts_other = 2
                  no_object     = 3
                  no_permission = 4
                  OTHERS        = 5.
        IF objtype(3) = 'OTF'.
          desired_type = otf.
        ELSE.
          desired_type = ali.
        ENDIF.
        CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
             EXPORTING
                  rqident              = src_spoolid
                  desired_type         = desired_type
             IMPORTING
                  real_type            = real_type
             TABLES
                  buffer               = l_objcont
             EXCEPTIONS
                  no_such_job          = 14
                  type_no_match        = 94
                  job_contains_no_data = 54
                  no_permission        = 21
                  can_not_access       = 21
                  read_error           = 54.
        IF sy-subrc EQ 0.
          attach_type = real_type.
        ENDIF.
        CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
             EXPORTING
                  owner     = sy-uname
                  region    = ou_fol
             IMPORTING
                  folder_id = l_folder_id
             EXCEPTIONS
                  OTHERS    = 5.
    fill out informations about the header of the email
        CLEAR: g_document.
        g_document-foltp     = l_folder_id-foltp.
        g_document-folyr     = l_folder_id-folyr.
        g_document-folno     = l_folder_id-folno.
        g_document-objtp     = c_objtp.
        g_document-objdes    = header_mail.
        g_document-file_ext  = c_file_ext.
        g_header_data-objdes    = header_mail.
        CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
             EXPORTING
                  method      = 'SAVE'
                  office_user = sy-uname
             IMPORTING
                  authority   = g_authority
             TABLES
                  objcont     = lt_body_email
                  attachments = lt_attachments
             CHANGING
                  document    = g_document
                  header_data = g_header_data
             EXCEPTIONS
                  OTHERS      = 1.
        folder_id-objtp = l_folder_id-foltp.
        folder_id-objyr = l_folder_id-folyr.
        folder_id-objno = l_folder_id-folno.
        object_id-objtp = c_objtp.
        object_id-objyr = g_document-objyr.
        object_id-objno = g_document-objno.
        link_folder_id-objtp = l_folder_id-foltp.
        link_folder_id-objyr = l_folder_id-folyr.
        link_folder_id-objno = l_folder_id-folno.
        REFRESH lt_rec_tab.
       CLEAR lt_rec_tab.
       lt_rec_tab-sel        = 'X'.
       lt_rec_tab-recesc     = object_type.   "This field for FAX/MAIL
       lt_rec_tab-recnam     = 'U-'.
       lt_rec_tab-deliver    = 'X'.
       lt_rec_tab-not_deli   = 'X'.
       lt_rec_tab-read       = 'X'.
       lt_rec_tab-mailstatus = 'E'.
       lt_rec_tab-adr_name   = fax_mail_number.
       lt_rec_tab-sortfield  = fax_mail_number.
       lt_rec_tab-recextnam  = fax_mail_number.
       lt_rec_tab-sortclass  = '5'.
       APPEND lt_rec_tab.
          lt_rec_tab-recextnam = fax_mail_number.
          lt_rec_tab-recesc = object_type.
          lt_rec_tab-sndart = 'INT'.
          lt_rec_tab-sndpri = 1.
          APPEND lt_rec_tab.
        lt_files-file = c_file.
        APPEND lt_files.
    begin of insertion by faianf01
        hd_dat-objdes = header_mail.
        CALL FUNCTION 'SO_ATTACHMENT_INSERT'
             EXPORTING
                  object_id                  = object_id
                  attach_type                = attach_type
                  object_hd_change           = hd_dat
                  owner                      = sy-uname
             TABLES
                  objcont                    = l_objcont
                  objhead                    = l_objhead
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  object_type_not_exist      = 17
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  x_error                    = 1000.
        IF sy-subrc > 0.
        ENDIF.
    end of insertion by faianf01
    send email from SAPOFFICE
        CALL FUNCTION 'SO_OBJECT_SEND'
             EXPORTING
                  folder_id                  = folder_id
                  object_id                  = object_id
                  outbox_flag                = outbox_flag
                  link_folder_id             = link_folder_id
                  owner                      = sy-uname
                 check_send_authority       = 'X'
             TABLES
                  receivers                  = lt_rec_tab
                 note_text                  = lt_note_text
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  component_not_available    = 1
                  folder_no_authorization    = 5
                  folder_not_exist           = 6
                  forwarder_not_exist        = 8
                  object_no_authorization    = 13
                  object_not_exist           = 14
                  object_not_sent            = 15
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  too_much_receivers         = 73
                  user_not_exist             = 35.
      ENDIF.
    ENDFUNCTION.
    =================================================================================
    z_send_email_fax
    FUNCTION ZCBFS_SEND_MAIL.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"  TABLES
    *"      LIST_FAX_MAIL_NUMBER STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
      DATA: vg_achou(1) TYPE n.
    Fist part: Verify if the spool really exists
      vg_achou = 1.
      DO 60 TIMES.
        SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
        IF sy-subrc IS INITIAL.
          CLEAR vg_achou.
          EXIT.
        ELSE.
          WAIT UP TO 1 SECONDS.
        ENDIF.
      ENDDO.
      IF vg_achou = 1.
        RAISE err_no_abap_spooljob. "doesn't exist
      ENDIF.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
           EXPORTING
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           IMPORTING
                type          = type
                objtype       = objtype
           EXCEPTIONS
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4
                OTHERS        = 5.
      IF objtype(3) = 'OTF'.
        desired_type = otf.
      ELSE.
        desired_type = ali.
      ENDIF.
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
           EXPORTING
                rqident              = src_spoolid
                desired_type         = desired_type
           IMPORTING
                real_type            = real_type
           TABLES
                buffer               = l_objcont
           EXCEPTIONS
                no_such_job          = 14
                type_no_match        = 94
                job_contains_no_data = 54
                no_permission        = 21
                can_not_access       = 21
                read_error           = 54.
      IF sy-subrc EQ 0.
        attach_type = real_type.
      ENDIF.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
           EXPORTING
                owner     = sy-uname
                region    = ou_fol
           IMPORTING
                folder_id = l_folder_id
           EXCEPTIONS
                OTHERS    = 5.
    fill out informations about the header of the email
      CLEAR: g_document.
      g_document-foltp     = l_folder_id-foltp.
      g_document-folyr     = l_folder_id-folyr.
      g_document-folno     = l_folder_id-folno.
      g_document-objtp     = c_objtp.
      g_document-objdes    = header_mail.
      g_document-file_ext  = c_file_ext.
      g_header_data-objdes    = header_mail.
      CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
           EXPORTING
                method      = 'SAVE'
                office_user = sy-uname
           IMPORTING
                authority   = g_authority
           TABLES
                attachments = lt_attachments
           CHANGING
                document    = g_document
                header_data = g_header_data
           EXCEPTIONS
                OTHERS      = 1.
      folder_id-objtp = l_folder_id-foltp.
      folder_id-objyr = l_folder_id-folyr.
      folder_id-objno = l_folder_id-folno.
      object_id-objtp = c_objtp.
      object_id-objyr = g_document-objyr.
      object_id-objno = g_document-objno.
      link_folder_id-objtp = l_folder_id-foltp.
      link_folder_id-objyr = l_folder_id-folyr.
      link_folder_id-objno = l_folder_id-folno.
      REFRESH lt_rec_tab.
      LOOP AT LIST_FAX_MAIL_NUMBER.
        lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
        lt_rec_tab-recesc = 'U'.
        lt_rec_tab-sndart = 'INT'.
        lt_rec_tab-sndpri = 1.
        APPEND lt_rec_tab.
      ENDLOOP.
      lt_files-file = c_file.
      APPEND lt_files.
      hd_dat-objdes = header_mail.
      CALL FUNCTION 'SO_ATTACHMENT_INSERT'
           EXPORTING
                object_id                  = object_id
                attach_type                = attach_type
                object_hd_change           = hd_dat
                owner                      = sy-uname
           TABLES
                objcont                    = l_objcont
                objhead                    = l_objhead
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                object_type_not_exist      = 17
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                x_error                    = 1000.
      IF sy-subrc > 0.
      ENDIF.
    send email from SAPOFFICE
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                folder_id                  = folder_id
                object_id                  = object_id
                outbox_flag                = outbox_flag
                link_folder_id             = link_folder_id
                owner                      = sy-uname
           TABLES
                receivers                  = lt_rec_tab
                note_text                  = lt_note_text
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                component_not_available    = 1
                folder_no_authorization    = 5
                folder_not_exist           = 6
                forwarder_not_exist        = 8
                object_no_authorization    = 13
                object_not_exist           = 14
                object_not_sent            = 15
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                too_much_receivers         = 73
                user_not_exist             = 35.
    ENDFUNCTION.
    =================================================================================
    regards,
    venkat.

  • Schedule job to send to external email address

    We wish to execute a daily report in the background and send the report to an external email. The idea is that a management report is set up to send to a senior manager every morning for the previous days data.
    I can add a recipient to the background job using the Properties - Cover sheets option, but this sends a the spool file to the recipient which is not acceptable.
    If I execute report in foreground (for example report FBL1N) I can then send the report to a recipient via List u2013 Send, however I cannot save this in the variant to then execute in background.
    I realise this could be done using ABAP but we don't want to create a copy report for what looks like should be something that SAP can do as standard
    Thanks

    HI,
    the way I do this for some daily/weekly check reports is the following:
    in SAP Business workplace (T-code SBWP) create a distribution list for the external email-adress (in the distribution list content key in the email-adress in "recipient" and as "recipient type" set "via internet").
    In SM37 job scheduling schedule the job for the time it should be executed and as "spool list recipient" add the distribution list you've created before.
    Try this with your own external email-adress first to see the result.
    Best regards, Christian

  • ALE Error Handling with Workflow

    Hi All,
    I have some issues with using workflows with idocs:
    In our process codes , the business object , start event for error handling and success event has been configured.
    Now if the workflow_result is 0 then success event is triggered and if workflow_result = 99999 then start event is triggered.
    I have two qquestons:
    1. How are these events triggered as I did not find any code in the F.M> to triggerethem.
    2. What is the purpose of End event.
    Apart from this , is there any area where workflows can be used with IDOCS.
    Thanks and Regards
    Aman

    Hi,
    In case I am creating a custom F.M. to process idoc data then I can use the F>M> to create the event.
    However In case the standard F.M. is being used and workflow_result is set to 9999 in it and I have consigured the start event to it,in that case I will not be able to use thie F.M> to trigger the workflow.
    Thanks and Regards
    Aman

  • Error Using Send Jython HTML Email

    I have imported the procedure from Oracle Support and tried sending mail using Send Jython HTML Email.
    I receive error as below, pls help.
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (most recent call last):
      File "<string>", line 9, in <module>
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 245, in __init__
        (code, msg) = self.connect(host, port)
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 311, in connect
        raise socket.error, msg
    socket.error: (62, 'Connection refused')
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
      at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:744)
    Caused by: Traceback (most recent call last):
      File "<string>", line 9, in <module>
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 245, in __init__
        (code, msg) = self.connect(host, port)
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 311, in connect
        raise socket.error, msg
    socket.error: (62, 'Connection refused')

    The underlying error here is -> socket.error: (62, 'Connection refused')
    Please debug in the jython code in your procedure to see if you are passing correct parameters.

  • Send PO External email with attachement and Body text

    Hi,
    I need to send Purchase Orders to Vendors as PDF attachments to emails; I have successfully configured all the necessary to send external email with PDF attachement but I want to add text in the body of the email:
    For Output Type NEU
       Access to conditions (General Data) set to X the Replacement of text symbols is SAPMM06E/TEXT_SYMBOL_REPLACE and I fill the text in the Mail Title and Texts. The email was send with all the information : Attachement, title with PO number but with no text in the body.
    Can somebody help me with this issue.
    best regards
    Andre

    Hi,
       My file is "PO Number APM - 123456.dpf". You have to config the "Define Message Types for Purchase Order" in the section Mail title and texts with NEU output type. But don't forget to put the program name SAPMM06E
    Look at
    [purchase order as email - SAPMM06E and TEXT_SYMBOL_REPLACE|purchase order as email - SAPMM06E and TEXT_SYMBOL_REPLACE]
    Best regards
    Andre

  • Scheduling Webi instance send to external email

    Hello all,
    Is there a way to schedule a Webi instance and send to the external email address for users that are within a distribution list?  If I select Destination..BI Inbox and select my distribution list, it only sends to BI Inbox.  If I selection Desitination..Email, I can list the external email addresses and it  goes there.  I want to selection my Distribution list and have it sent to the external email addresses for the users within that list.
    Thanks.

    You can use publication feature. Check the below link to publication.
    Introduction into the SAP BusinessObject Intelligence Platform Publication

  • ALE Error while sending PO IDOC through EDI

    Hi Experts,
                      I am sending one PO IDOC through EDI but I am getting the following error:-
                      Message no. B1130.
                      "Too many recipients found for message type ORDERS in the ALE model"
                      How can I solve this error ? Please guide me in this regards as this is an
                      important issue with urgency.
    Thanks & Regards
    Jitendra Gujarathi

    Please check this discussion thread
    Re: Too many recipients found for message type in the ALE model

  • ALE / IDOC Outbound Error Handling

    Hi Experts,
    I got an error in Outbound Process.
    An IDOC gets the status 36 - Timed out.
    Can anyone tell me how can i resolve this Error?.
    Thanks in advance,
    Sudhakar

    Hi ,
            Best option is to keep a sql trace on the outbound idoc which will tell you at which perform or functional module ,the performance is taking time to fetch .
    all check with basis in terms of timed out ,they would have set a paramater for time out in terms of mins or hrs.

  • IDoc outbound errors - mail send step in WF to send info-mail to enduser

    Hello specialists
    I searched quite a lot in the forums now. I found lot of info but nothing regarding my issue.
    I need to send an info-mail to the end user creating purchase orders. But only if the idoc (outbound ORDERS) could not be sent (failing for some reason, i.e. if rfc connection fails). This is what I've done to achieve this:
    - in WE40 I linked my WF to process code EDIO
    - the WF-BATCH user has an email address assigned to it (in SU01)
    - the mail sending step in my WF is configured like this:
    recipient type = G (organizational object)
    Expression = &_WORKITEM.CREATEDBYUSER.ID& (this contains the enduser id)
    subject = Test for &WORKITEM.CREATEDBYUSER.ID&
    When testing the mail can not be delivered (error SO23).
    When setting recipient type to U (E-Mail address) and giving a valid e-mail address, then it works fine (SCOT, etc. is configured and mailing to external systems works). But setting the e-mail address hard coded style in the mail send step is not an option here!
    It seems that the send mail step (SELFITEM.SENDTASKDESCRIPTION) always requires a valid e-mail address. Is it not able to handle SAP user id's ?
    Thanks in advance for some guideance on this one.
    Renaud
    Edited by: Renaud Desarzens on Feb 11, 2010 3:00 PM

    Hello and thanks for your help.
    I was able to solve it like this:
    - don't use mail send step
    - instead, add new activity with a new task (SELFITEM.SENDTASKDESCRIPTION)
    - in the bindings (workflow -> step) set:
         B --> &TYPEID&
         &_WORKITEM.CREATEDBYUSER.ID& --> &ADDRESSSTRINGS&
    Seems that the mail send step doesn't allow TYPEID to be "B" because each time I tried to tweak the generated bindings that way it messed up the recipient type and expression I set before.
    Regards
    Renaud

  • Can not SEND to external emails

    Customer I support is having Blackberry device issue:
    I use the Desktop Manager to sync my BB emails.   This morning, after our server with BES on it was rebooted (and, my computer was still on at the time), i discovered that I could no longer send emails outside the office.  I can send internally and also can receive emails both internally and from outside addresses.  My BB phone service works.   No other BB user in the office suffering this problem.  What can I do?

    I don't think I've messed other blocklimits than those in my post.
    I know that service.http.maxmessagesize and service.http.maxpostsize are for webmail only.
    I can send big mails but I can not RECEIVE big mails. That's the problem.
    In my previous post I've pasted the error messages.

  • Best Pratice of Error Handling calling multiple external components

    I have used EJBs in my question, but it applies to any component/service that is exposed.
    If I have EJB1 calling EJB2, what is the standard approach to handling an error received from EJB2? Does EJB1 simply pass it back or wrap its own error around it?
    I use the term error to include exceptions & all information that would be used for debugging & used by the caller.
    If we allow the errors from EJB2 to be returned to the caller of EJB1, then the caller of EJB1 must be aware of those errors.
    If EJB1 wraps the errors from EJB1, then the caller of EJB1 only needs to know about errors returned from EJB1.
    This can be extended a little and EJB1 calls multiple ejbs. Some of EJBs may be external EJBs or have the possibility of returning an error from a 3rd party tool.
    What should be returned if EJB3 can return the same error as say EJB4? If (for some reason) the caller needs to know exactly when the problem occurred it would imply that additional information needs to be attached to the original error.
    What would be a 'best practice' approach to returning the errors to the original caller?

    I have used EJBs in my question, but it applies to
    any component/service that is exposed.
    If I have EJB1 calling EJB2, what is the standard
    approach to handling an error received from EJB2?It depends on the context.
    Does EJB1 simply pass it back or wrap its own error
    r around it?
    I use the term error to include exceptions & all
    information that would be used for debugging & used
    by the caller.
    If we allow the errors from EJB2 to be returned to
    the caller of EJB1, then the caller of EJB1 must be
    aware of those errors.
    If EJB1 wraps the errors from EJB1, then the caller
    of EJB1 only needs to know about errors returned from
    EJB1.
    Caller?
    EJBs are in a layer. For application programming layers will seldom return errors (plural) to other layers.
    Within a layer handling depends on the context.

Maybe you are looking for

  • Only one song plays at a time

    I have one playlist with 300 songs. I decided to break this up to three 100-playlists. But, after doing this, i found that all of my playlists play only one song at a time. And, my advance button doesn't work. Problem never occurred before I broke up

  • Help with dynamic table

    Hello, I need to create a 3 column table from three database tables. when any column is missing from the database, I need to display "missing" I cannot just bind the tables as all rows need to be processed. How can I do this in creator? Thanks Frank

  • WRT54G v.6 intermittent disconnections

    I've been using my WRT54G router for a year now and it always worked pretty well. But about a month ago i started to lose internet connection every now and then (maybe 1 or 2 times each day). Now the problem occurs approximately every hour. I updated

  • Issues while watching content after live streaming operation

    Hi, 1)We have performed a live streaming of an event using Azure Media Services , we streamed the entire event  which was of about 5-6 hrs duration . But at the end we came to know that it has streamed only last  1 hour of  entire event. Can you let

  • Adding printer from print server

    Hi All, We are migrating to a new print server, and i am writing a script to detect a users installed printers, change the server name and re add the printers (and also set the default printer). This is to be deployed from SCCM 2012 R2 The problem is