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: 

F110 Email to be sent to Vendor

palash_mazumder
Participant
0 Kudos

Hi ABAP Guru,

I have issue while sent email to Vendor,For sent email I have used the BTE  SAMPLE_PROCESS_00002040  and copy that create a FM

TYPE-POOLS szadr.

*----------------------------------------------------------------------*

*                        Data Declaration                              *

*----------------------------------------------------------------------*

*Local work Area

   DATA: lwa_addr1_complete TYPE szadr_addr1_complete,

         lwa_adsmtp_line    TYPE szadr_adsmtp_line,

         lv_text            TYPE zde_text,

         lv_emailid         TYPE zde_email,

         lv_intad           TYPE lfb1-intad, " Clks internet

         lv_sender          TYPE zemail_id.

* default: print payment advice

   c_finaa-nacha = '1'.

* check that address number is available

   IF NOT i_reguh-zadnr IS INITIAL.

*   read complete address of vendor/customer

     CALL FUNCTION 'ADDR_GET_COMPLETE'

       EXPORTING

         addrnumber     = i_reguh-zadnr

       IMPORTING

         addr1_complete = lwa_addr1_complete

       EXCEPTIONS

         OTHERS         = 4.

     IF sy-subrc IS INITIAL.

       CLEAR lv_intad.

**Retrieving intenet address

       SELECT SINGLE intad FROM  lfb1

                           INTO lv_intad

                           WHERE lifnr = i_reguh-lifnr

                           AND   bukrs = i_reguh-zbukr.

       IF  lv_intad IS NOT INITIAL.

*       choose message type 'I'nternet and fill email address

         c_finaa-nacha = 'I'.

*Field where Email is entered

         c_finaa-intad = lv_intad.

         c_finaa-namep = space.

       ENDIF.

     ENDIF.

   ENDIF.

*

*Added to get the Inquiry Contact Email Address and update as sender address.

   SELECT SINGLE email_id ztext_element

     FROM zfi_rem_tab

     INTO (lv_sender, lv_text)

     WHERE zbukr EQ i_reguh-zbukr.

   IF sy-subrc IS INITIAL.

     IF lv_sender IS NOT INITIAL.

       c_finaa-mail_send_addr = lv_sender.

     ENDIF.

     IF lv_text IS NOT INITIAL.

       c_finaa-mail_body_text = lv_text.

       c_finaa-mail_body_format = 'ASCII'.

     ENDIF.

   ENDIF.

*  SELECT SINGLE zcontact_email

*                ztext_element

*          FROM  zfi_paymnt_email

*          INTO  (lv_emailid, lv_text)

*          WHERE bukrs  EQ i_reguh-zbukr.

*  IF sy-subrc IS INITIAL.

**    c_finaa-mail_send_addr = lv_emailid.

**    c_finaa-intad          = lv_emailid.

**Getting the body of the Email text from SO10

*    c_finaa-mail_body_text = lv_text.

*    c_finaa-mail_body_format = 'ASCII'.

*  ENDIF.

   c_finaa-mail_sensitivity = 'O'.

   c_finaa-mail_outbox_link = 'X'.

****If no email found

  IF c_finaa-intad IS INITIAL.

     c_finaa-nacha = '1'.

   ELSE.

     c_finaa-nacha = 'I'.

   ENDIF.

ENDFUNCTION.

The mail is triggering fine.But the problem is when mail is trigger the print should not happen.But here print also happen.I want only send mail.I have set C_FINNA-NACHA = 'I' also.Please help.

1 ACCEPTED SOLUTION

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Please, check note 1033893 and related notes. Maybe it's related with the subject of the email and BTE 2050.

I hope it helps you

Regards

Eduardo

2 REPLIES 2

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Please, check note 1033893 and related notes. Maybe it's related with the subject of the email and BTE 2050.

I hope it helps you

Regards

Eduardo

roberto_vacca2
Active Contributor
0 Kudos

Hi.

You can try to implement process 2050 and manage your ITCPO destination and output.

Hope to help

Bye