Application Development and Automation 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: 
Read only

type problems

Former Member
0 Likes
1,216

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
940

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
941

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

Read only

0 Likes
940

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

Regards,

RIch Heilman

Read only

Former Member
0 Likes
940

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

Regards

Christian

Read only

0 Likes
940

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