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

Issue with Tables in with Method Call

Former Member
0 Likes
1,217

Hi All,

I am getting the error:

"ME->GT_EMAIL_ATTACHMENT" IS NOT TYPE-COMPATIBLE WITH FORMAL PARAMETER "ET_EMAIL_ATTACHMENT"

and I can't see why, possibly another set of eyes can do so.

Definition:


    DATA: gt_e070v            TYPE tt_open_repairs,
          gt_username         TYPE tt_send_email,
          gt_email_attachment TYPE STANDARD TABLE OF tt_formatted_message.

    METHODS format_message
            IMPORTING
              it_e070v  TYPE tt_open_repairs
            EXPORTING
              et_email_attachment TYPE tt_formatted_message
            EXCEPTIONS
              format_failed.

implementation:


*----------------------------------------------------------------------*
  METHOD format_message.

    DATA:
          ls_e070v TYPE e070v,
          ls_email_attachment LIKE LINE OF gt_email_attachment.

    LOOP AT gt_e070v INTO ls_e070v.
      MOVE-CORRESPONDING ls_e070v TO ls_email_attachment.
      APPEND ls_email_attachment TO gt_email_attachment[].
    ENDLOOP.

  ENDMETHOD.                             "format_message

Method call:


*--Format the table so that it is more readable
    CALL METHOD format_message
          EXPORTING
            it_e070v = gt_e070v
          IMPORTING
            et_email_attachment = gt_email_attachment
          EXCEPTIONS
            format_failed = 1.

Edited by: Keith Warnock on May 27, 2011 9:21 PM

Edited by: Keith Warnock on May 27, 2011 9:22 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,186

Wel, I don't know what

APPEND ls_email_attachment TO gt_email_attachment[].

will do. Try

APPEND ls_email_attachment TO gt_email_attachment.

instead.

Rob

Hi All,

I am getting the error:

"ME->GT_EMAIL_ATTACHMENT" IS NOT TYPE-COMPATIBLE WITH FORMAL PARAMETER "ET_EMAIL_ATTACHMENT"

and I can't see why, possibly another set of eyes can do so.

Definition:


    DATA: gt_e070v            TYPE tt_open_repairs,
          gt_username         TYPE tt_send_email,
          gt_email_attachment TYPE STANDARD TABLE OF tt_formatted_message.

    METHODS format_message
            IMPORTING
              it_e070v  TYPE tt_open_repairs
            EXPORTING
              et_email_attachment TYPE tt_formatted_message
            EXCEPTIONS
              format_failed.

implementation:


*----------------------------------------------------------------------*
  METHOD format_message.

    DATA:
          ls_e070v TYPE e070v,
          ls_email_attachment LIKE LINE OF gt_email_attachment.

    LOOP AT gt_e070v INTO ls_e070v.
      MOVE-CORRESPONDING ls_e070v TO ls_email_attachment.
      APPEND ls_email_attachment TO gt_email_attachment[].
    ENDLOOP.

  ENDMETHOD.                             "format_message

Method call:


*--Format the table so that it is more readable
    CALL METHOD format_message
          EXPORTING
            it_e070v = gt_e070v
          IMPORTING
            et_email_attachment = gt_email_attachment
          EXCEPTIONS
            format_failed = 1.

Edited by: Keith Warnock on May 27, 2011 9:21 PM

Edited by: Keith Warnock on May 27, 2011 9:22 PM

7 REPLIES 7
Read only

Former Member
0 Likes
1,187

Wel, I don't know what

APPEND ls_email_attachment TO gt_email_attachment[].

will do. Try

APPEND ls_email_attachment TO gt_email_attachment.

instead.

Rob

Read only

0 Likes
1,186

hi Rob,

i had the no bracket there first and was still getting the same error. I put them in as a desperation move.

Read only

0 Likes
1,186

OK - is this a syntax error or a dump or something else?

Rob

Read only

0 Likes
1,186

I don't have any error on syntax checks... I assume it if something wrong in my definition?

Read only

0 Likes
1,186

So it's a dump?

Rob

Read only

brad_bohn
Active Contributor
0 Likes
1,186

It's definitely not compatible. You have an EXPORTING parameter declared with type tt_formatted_message and the associated internal table declared with TYPE STANDARD TABLE OF tt_formatted_message. How is tt_formatted_message declared? That's the only thing missing from your post. It looks like you intend to pass a table so the definition of tt_formatted_message needs to be a table type (not a line type) and the associated definition of your internal table would use the same type (drop the STANDARD TABLE OF part).

Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
1,186

Try..

DATA: gt_e070v            TYPE tt_open_repairs,
      gt_username         TYPE tt_send_email,
      gt_email_attachment TYPE tt_formatted_message.

Cheers

Graham Robbo