Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

F110 Email to be sent to Vendor

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.

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question