Skip to Content
0
Oct 09, 2019 at 07:37 AM

Error when trying to send mail in web client

101 Views Last edit Oct 09, 2019 at 07:39 AM 3 rev

Hey Friends,

i got error when i trying to send mail in web client.

(My codes works another web client),

error : lo_send_request->send

 DATA: 
        lo_send_request  TYPE REF TO cl_bcs,
        lo_document      TYPE REF TO cl_document_bcs,
        lo_recipient     TYPE REF TO if_recipient_bcs,
        lo_bcs_exception TYPE REF TO cx_bcs,
        lo_sender        TYPE REF TO if_sender_bcs VALUE IS INITIAL,
        lv_bp_number     TYPE char10,
        lv_sent_to_all   TYPE os_boolean,
        lv_main_text     TYPE soli,
        lt_main_text     TYPE bcsy_text,
        lv_epostaonay    TYPE ad_smtpadr value 'test@test.com',
        lv_sbj           TYPE so_obj_des VALUE 'test'.

    TRY.
       CLEAR : lo_document   , lv_bp_number,
                lv_epostaonay , lo_send_request,
                lo_document   , lo_recipient,
                lo_sender     , lo_bcs_exception,
                lt_main_text  , lv_main_text.


        lo_send_request = cl_bcs=>create_persistent( ).

        CONCATENATE
        ls_str-object_id
        'ok'
        INTO lv_main_text
        SEPARATED BY space.

        APPEND lv_main_text TO lt_main_text.

        lo_document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                        i_text    = lt_main_text
                                                        i_subject = lv_sbj ).


        lo_send_request->set_document( lo_document ).

        lo_sender = cl_sapuser_bcs=>create( sy-uname ).

        lo_send_request->set_sender( i_sender = lo_sender ). "gönderici

        lo_recipient   = cl_cam_address_bcs=>create_internet_address( lv_epostaonay ).

        lo_send_request->add_recipient( i_recipient = lo_recipient ). " alıcı

        lv_sent_to_all = lo_send_request->send( i_with_error_screen = 'X' ).

      ENDTRY.
      COMMIT WORK.
    ENDIF.

Attachments