cancel
Showing results for 
Search instead for 
Did you mean: 

RLB_INVOICE program for sending mail to muliple mail's Id's

former_member361845
Participant
0 Kudos

Hi Gurus,

I have requirement for sending mail for customer's multiple mail id's through VF03 transaction.

i have created ZRLB_INVOICE for this and internally smartform is called.

PERFORM set_print_param USING ls_addr_key ls_dlv-land

CHANGING ls_control_param

ls_composer_param

ls_recipient

ls_sender

cf_retcode.

As per my understanding, ls_recipient always get one mail ID, which is internally passed to smartform.

However, i want to know where exactly i can debug to find the mail code .

The sample code will be highly appreciated...as i have seen multiple thread's but can't find the solution to implement.

Mail to :

Accepted Solutions (1)

Accepted Solutions (1)

former_member361845
Participant
0 Kudos

Hi All,

I hv called the BCS mailing option for triggering mail to acheive solution.

However i have called smartform and converted to PDF and then send the mail using BCS.

Guys it may help you,although you would have ur own ways.

Answers (1)

Answers (1)

brad_bohn
Active Contributor
0 Kudos

If you have a Z-program, why don't you handle the email process yourself with class CL_BCS? It's far more flexible than the old macros that smartforms uses and you'll be able to use more than one email ID. You can find the smartform email code by following the parameters.

former_member361845
Participant
0 Kudos

Hi Brad,

I agree with your comments for BCS class.

However i would like to change the existing YRLB_INVOICE which also calls smartform where ls_reciptents fields gets always one mail id...

Do you have any suggestion how i can i change the existing logic for achive my requirement for sending muliple mails?

Any sample code is welcome.

Thanks!

former_member361845
Participant
0 Kudos

Hi Gurus!

Have anybody got this scenario... ??!

RLB_INVOICE program doesnot have the muliple mail functionalaty..

see the prevoius mails for better undersatanding.

Former Member
0 Kudos

Hi,

I had a similar scenario to implement.

What I did is instead of populating the ls_receipient as mentioned in ur post above, I have added another logic and mentioned below:

I have declared an internal table -

DATA: BEGIN OF g_t_emailid OCCURS 0,

smtp_addr LIKE adr6-smtp_addr,

END OF g_t_emailid.

I have fetcehd the multiple emailids thats need to eb emailed into this internal table. Then before calling FM - SO_DOCUMENT_SEND_API1 , i have populated the t_receriver table passed to the FM.

LOOP AT g_t_emailid.

t_receivers-receiver = g_t_emailid-smtp_addr.

t_receivers-rec_type = 'U'.

t_receivers-com_type = 'INT'.

t_receivers-notif_del = 'X'.

t_receivers-notif_ndel = 'X'.

APPEND t_receivers.

ENDLOOP.

*FM to send the email

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = w_doc_data

put_in_outbox = 'X'

sender_address = ld_sender_address

sender_address_type = ld_sender_address_type

commit_work = 'X'

IMPORTING

sent_to_all = w_sent_all

TABLES

packing_list = t_packing_list

contents_bin = t_attachment

contents_txt = it_message

receivers = t_receivers

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

Hope this helps.

Cheers,

Varna

former_member361845
Participant
0 Kudos

Hi Varna,

i see the solution you proposed fine.

However i have also done something like that.

I am calling smartform and converting to PDF and then sending mail to multiple id's except

for the defaulted in xd03 by using FM 'ADDR1_EXTRACT_TABLES'

Anyhow Thanks!