Skip to Content
0
Oct 02, 2012 at 03:14 PM

BTE 2040 FINAA-INTAD multiple receivers F110

1079 Views

Hello,

I have to send an email for different receivers via BTE 2040 (AVIS for the F110).

Part of the coding:

CONCATENATE 'pppppr@cccc.com' c_finaa-intad "PZ1
into c_finaa-intad SEPARATED BY space. "PZ1

-> The email-sending doesn't work.

With the coding:

c_finaa-intad = l_adsmtp_line-adsmtp-smtp_addr.

-> The email-sending works.

The OSS-note 1033893 is implemented.

Do you have an idea, what's the problem?

Thanks in advance

Peter

The whole coding..

****************************************************************************

*****************************************************************************

FUNCTION Z_S1FI_BTE_EVENT00002040_PZ.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REGUH) LIKE REGUH STRUCTURE REGUH
*" TABLES
*" T_FIMSG STRUCTURE FIMSG
*" CHANGING
*" VALUE(C_FINAA) LIKE FINAA STRUCTURE FINAA
*"----------------------------------------------------------------------
*{ INSERT SK1K904419 1

* data declaration for address routines
TYPE-POOLS szadr.
DATA: l_addr1_complete TYPE szadr_addr1_complete,
l_adsmtp_line TYPE szadr_adsmtp_line,
lv_tlfxs TYPE lfb1-tlfxs, "DD050309
lv_lnrza TYPE lfa1-lnrza. "DD110509

** Mandantenprüfung
CASE sy-mandt.
WHEN '291' OR '299'.

* Nur für Buchungskreis 0002 durchführen
CASE i_reguh-zbukr. "DD100910
WHEN '0002'. "DD100910
* default: print payment advice
c_finaa-nacha = '1'.

*<DD011012-------------------------------------------------------------
* Email (message type I)
* 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 = l_addr1_complete
EXCEPTIONS
OTHERS = 4.
IF sy-subrc EQ 0.
* check that internet address is available
READ TABLE l_addr1_complete-adsmtp_tab INTO l_adsmtp_line
INDEX 1.
IF sy-subrc EQ 0
AND NOT l_adsmtp_line-adsmtp-smtp_addr IS INITIAL.
* choose message type 'I'nternet and fill email address
c_finaa-nacha = 'I'.
c_finaa-intad = l_adsmtp_line-adsmtp-smtp_addr.

CONCATENATE 'p.BBBB@XXXXX.com' c_finaa-intad "PZ1
into c_finaa-intad SEPARATED BY space. "PZ1

c_finaa-textf = 'PDF'.
ENDIF.
ENDIF.
ENDIF.
*------------------------------------------------------------DD011012>

* Falls keine Email Adresse gefunden wurde, schicke an Fax
IF c_finaa-intad IS INITIAL. "DD011012

* Abw. Zahlungsempfänger ermitteln
SELECT SINGLE lnrza FROM lfa1 "DD110509
INTO lv_lnrza "DD110509
WHERE lifnr = i_reguh-lifnr. "DD110509
* Abw. Zalhungsempfänger vorhanden
IF lv_lnrza IS NOT INITIAL.
* Fax-Nummer des Sachbearbeiters beim abw. Zahlungsempfänger
* ermitteln:
SELECT SINGLE tlfxs FROM lfb1 "DD110509
INTO lv_tlfxs "DD110509
WHERE lifnr = lv_lnrza "DD110509
AND bukrs = i_reguh-zbukr. "DD110509
ENDIF.
* Falls es keinen abw. Zahlungsempfänger gibt, oder dieser keine
* Faxnummer hat, suche beim Kreditor
IF lv_tlfxs IS INITIAL. "DD110509
* Fax-Nummer des Sachbearbeiters auslesen
SELECT SINGLE tlfxs FROM lfb1 "DD050309
INTO lv_tlfxs "DD050309
WHERE lifnr = i_reguh-lifnr "DD050309
AND bukrs = i_reguh-zbukr. "DD050309
ENDIF. "DD110509

* Fax (message type 2)
IF c_finaa-nacha NE 'I'.
IF lv_tlfxs IS NOT INITIAL.
c_finaa-nacha = '2'. "Fax
c_finaa-tdschedule = 'IMM'. "Sofort
c_finaa-tdteleland = i_reguh-zland. "Land der Faxnummer
c_finaa-tdtelenum = lv_tlfxs. "DD050309
c_finaa-tdfaxuser = space.
c_finaa-abtei = space.
c_finaa-fornr = space.
ENDIF.
ENDIF.
ENDIF. "DD011012

ENDCASE. "DD100910
ENDCASE.

*} INSERT
ENDFUNCTION.