cancel
Showing results for 
Search instead for 
Did you mean: 

Payment advice form via email

Former Member
0 Kudos

Hi Gurus,

I encounter this situation that I will try to describe.

The form used for the Payment Advice note, is a custom one launched by program RFFOAVIS_FPAYM, through F110 (automatic payment program)

I already know the possibility that my abaper should check the coding for Function Module 'SAMPLE_PROCESS_00002040' in tcode SE37, within the mentioned program, in order to implement the sending of the form via email. This idea I successfully found within this forum. Thanks



We still need to check from where this automatic email trigger to vendor, that is, where do I have to save the email address so that the payment advice program can get that email address and send the payment advice note. However, I suspect it is the field in Vendor General Data, within address Tag:


Can anybody confirm this to me?.

However, my particular issue with the email address is that my client already used that General field for the email sending of the Purchasing order form. Now, my client is adding a new company code to its SAP systems that needs to send as well the Payment advise note (something not used before) to a different email address, but the email recipient is already occupied for a different purpose, despite you can add more than one email address.

So my core question is: is it possible to save elsewhere ANOTHER email address, different from the one saved at General Data (perhaps at company code level or purchasing organisation level) so that the program RFFOAVIS_FPAYM could get that email and send the Financial form to the email address for the payment advise note? I mean, using standard implementation in Program RFFOAVIS_FPAYM...

Please give advice on how to handle this situation of 2 different emails: one email is already in place, and it is exactly the field at General data (Address), used for the sending of the PO form.

Where can we save a different email address so that the Payment Advice program can easily trigger it and send the financial form? At company level, at Purchase organisation level??

Many thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

michael_kozlowski
Active Contributor
0 Kudos

You can use the "Notes" field in the email address to control the utilization of an email-address.

For ex.

Email                          Notes

teddy.tester@mr.com   PAYM      <- receiver of the payment avis

tom.trial@mr.com         PO          <- receiver of the PO


Your Abaper should be able to adjust the involved programs to fetch the appropriate email address.

Former Member
0 Kudos

Could it be saved at another level? I mean, not at general level, but at company code level or purchasing organisation level.

Probably my client doesn´t want to touch the place in which PO forms work fine.....

Would it be possible to trigger an email address elsewhere?

michael_kozlowski
Active Contributor
0 Kudos

Basically you can use partner roles concept in PUR to create a special role which holds email receiver of PO. Ask your functional MM-Consultant for help. This will allow you to use email in general data for payment avis.

Former Member
0 Kudos

Hi Michael,

We have already fetched an email address from the box containing emails at Vendor General data. RFFOAVIS_FPAYM already gets the email and sends the Payment Advice form

The problem my abaper has encountered and therefore stopshim, is that if there is another email address inside that box, simple 2040 gets all the emails and send the Payment advice to all of them, and he is unable to program (via simple 2040), to select which email should be ONLY selected from the box, in case there is more than one.

Please, is this possible? Maybe using the Note space? He doesn´t know what code to insert via sample 2040.

If it is possible, could you give some coding advice to this?

Kind regards,

Patxi

michael_kozlowski
Active Contributor
0 Kudos

Using notes field to mark relevant email-addresses in master data and use code similar like that.

SELECT SINGLE adrnr INTO lv_adrnr FROM lifa

WHERE lifnr EQ i_reguh-lifnr.

IF sy-subrc EQ 0.

SELECT * FROM adrt INTO CORRESPONDING FIELDS OF TABLE lt_paymaddr

  WHERE addrnumber = lv_adrnr

    AND comm_type = 'INT'

    AND remark = 'PAYM'  "<-- Extract only marked email addresses!

    AND date_from <= sy-datum

    AND langu = sy-langu.

  IF sy-subrc EQ 0.

    LOOP AT lt_paymaddr INTO ls_paymaddr.

*     get email adresses

      SELECT SINGLE smtp_addr FROM adr6 INTO l_email1

       WHERE addrnumber = ls_paymaddr-addrnumber

         AND persnumber = ls_paymaddr-persnumber

         AND date_from  = ls_paymaddr-date_from

         AND consnumber = ls_paymaddr-consnumber.

      IF sy-subrc = 0.

        CONCATENATE l_emails l_email1 INTO l_emails SEPARATED BY ' '.

        IF l_emails(1) = ' '.

          SHIFT l_emails LEFT DELETING LEADING ' '.

        ENDIF.

      ENDIF.

    ENDLOOP.

ENDIF.

Former Member
0 Kudos

Appreciate much your valuable hints indeed!

When you say:

SELECT SINGLE adnr INTO lv_adnr FROM lifa

What´s lifa? Shouldn´t it be lfa1?

So when you say....AND remark='PAYM', is because you are considering we are going to insert in nots the letters PAYM, don´t you?

And this is implemented inside famous sample 2040?

Do you want to add something else?

I will get back to my abaper.

Thanks a lot

michael_kozlowski
Active Contributor
0 Kudos

Patxi Albisu wrote:

Appreciate much your valuable hints indeed!

When you say:

SELECT SINGLE adnr INTO lv_adnr FROM lifa

What´s lifa? Shouldn´t it be lfa1?  <- You are right a typo correct LFA1

So when you say....AND remark='PAYM', is because you are considering we are going to insert in nots the letters PAYM, don´t you? <- Yes assumed you might use PAYM, but you can use any other marker.

And this is implemented inside famous sample 2040? <- Yes must be implemented in BTE 2040

Do you want to add something else? <- Provided coding is only a sample to give you an idea how to implement. It might be that adjustments are necessary for final solution. But your Abaper should be able to do.

I will get back to my abaper.

Thanks a lot

Please see my answers in blue colored.

Good luck!

Former Member
0 Kudos

Thanks a lot Michael!

May I come back to you in case we find other issues regarding this?

Really appreciatte your answer.

REgards.

Answers (3)

Answers (3)

former_member184580
Contributor
0 Kudos

Hi,

You can use 'Clerk's Internet' field under 'correspondence' tab and make changes to 2040.

Regards,

Prasad

ajaycwa1981
Active Contributor
0 Kudos

Also, refer SAP note 1033983

You can also refer this link

http://www.saptechnical.com/Tutorials/ExitsBADIs/BTE/Index.htm

Former Member
0 Kudos

Hi Ajay,

But if I use the Note field within the email region at General Data (address tag), I have to write the words within the Note field (ex. PAYM, PO...ETC.), so that my program can distinguish the correct email, because I cannot use any matchcode in the field.

Could it be possible to save the email in another place?

Former Member
0 Kudos

Hi Ajay,

Are you sure this note talks about email implementation?

regards

ajaycwa1981
Active Contributor
0 Kudos

Hi

Incase you have a field 25 to 30 Char Long available in the Vendor Master, you can always store the EMAIL in that field.. All your ABAP needs to do it is to write the Code to get the EMAIL from there.

You can also add a Custom Field in Vendor Master if you wish

Regards

Ajay M

ajaycwa1981
Active Contributor
0 Kudos

Yup. It talks about BTEs 2040 and 2050

Ajay M

ajaycwa1981
Active Contributor
0 Kudos

Hi

Yes you must SAVE the EMAIL in the Vendor Master..

May be you can enter both EMAIL addresses with a / as separator.. Then Code your BTE 2040 accordingly

Ajay M

Former Member
0 Kudos

Hi Ajay,

Bt where should I save it? What field?

Could it be saved in another place, different than the one already used for the PO forms? Perhaps at company code level or Purchasing Organisation...

If yes, how can I implement it with program RFFOAVIS_FPAYM?

Thanks.

ajaycwa1981
Active Contributor
0 Kudos

Hi

One Option is to use the Notes field in the Email maintenance

Or you can maintain the 2nd email address in any available field and your ABAPer can fetch it based on the code in the Function Module

Also, refer the below link I provided

Ajay M

Former Member
0 Kudos

Hi Ajay,

My abaper is encountering problems while implementing SAMPLE 2040. Although we have copied the original FM onto a custom one, and have changed its paremeter from 1 to I, while executing payments through F110 system is not sending the Paym. Adv. form to the email saved at Vendor General data.

SOST tray does not generate any sending.....

We can only see the form at the spool site, same as always.

The link you gave me was very accurate in description, but still we haven´t made any progress. Form is still not being sent automatically when executing F110, only visible via spool.

Do we have to insert something special in the Variant used for the program RFFOAVIS_FPAYM?. Our variant is only containing company code and payment method. Just that....

Please, could help me? Or anyone else Reading our issue...

Thanks in advance

Former Member
0 Kudos

Hi Ajay,

My abaper has already connected the payment advice to be sent via email.

However, we have found it is impossible (at least via sample 2040), to get rid of an email address saved at Email General maintenance. Payment advice is ALWAYS sent to an email saved there, an another one you want.

Do you know if  it possible to avoid the sending of the payment advice to an email saved there, because there is another place, another field where another email address has been saved?

Thanks in advance