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: 

type problems

Former Member
0 Kudos
510

Hi,

I'm trying to send emails via cl_bcs. It's working great, when I define the receivers on my own with:


    recipient = cl_cam_address_bcs=>create_internet_address(
                'mail@adress.com' ).

    CALL METHOD send_request->add_recipient
      EXPORTING
        i_recipient  = recipient
        i_express    = 'X'.

But when I'm using a list of email addresses from an internal table, I get the error "it_receivers-email is not type compatible to formal parameter i_address_string" (translated from german error text). it_receivers-email is declared as string. Why isn't this working?


loop at it_receivers.
       recipient = cl_cam_address_bcs=>create_internet_address(
                  it_receivers-email ).
       ...
endloop.

Regards

Christian

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
234

You might want to use a work area instead.

data: wa_recievers like line of it_receivers.

loop at it_receivers into wa_receivers.
       recipient = cl_cam_address_bcs=>create_internet_address(
                  wa_receivers-email ).
       ...
endloop.

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
235

You might want to use a work area instead.

data: wa_recievers like line of it_receivers.

loop at it_receivers into wa_receivers.
       recipient = cl_cam_address_bcs=>create_internet_address(
                  wa_receivers-email ).
       ...
endloop.

Regards,

Rich Heilman

0 Kudos
234

And you should try to type your field like ADR6-SMTP_ADDR instead of string.

Regards,

RIch Heilman

Former Member
0 Kudos
234

Thanks for your help. Typing the field like ADR6-SMTP_ADDR solved the problem.

Regards

Christian

0 Kudos
234

I have the same problem, but typeing

parameters: login(3) type c.

data: receiver like ADR6-SMTP_ADDR. and then...

select SMTP_ADDR from ADR6 join usr21 on adr6~persnumber =

usr21persnumber into receiver where usr21bname = login.

endselect.

in statement:

PERFORM send_mail USING receiver nalezeno text-014.

FORM send_mail

USING email LIKE reclist-receiver

nalezeno TYPE i

predmet LIKE doc_chng-obj_descr.

.

.

.[e.t.c]

I have error message:

In PERFORM "SEND_MAIL", the actual parameter "RECEIVER" and formal parameter

"EMAIL" are incomapatible.

please, help