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 mismatch

Former Member
0 Likes
1,261

Hi,

I am calling a method decared in a global class (se24) in my program. The method requires an import value TITLE which is defined as STRING.

In the program, I pass a text message to this global method. See the following:


call method ZW_UPDATE=>F1HELP
          EXPORTING
            TITLE       = text-002.                         

However, when I try to run the program, it complains that "TEXT-002" is not type-compatible with formal parameter "TITLE".

How can I get around with this problem?

Thanks,

Anna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,080

define a string variable and pass it like the below.

data: str type string.

str = '23243245235235t2fgsdfgdgsergegewwewefawef'(002).

call method ZW_UPDATE=>F1HELP
          EXPORTING
            TITLE       = str.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,080

Move the text element to a string and pass the string.

data: str type string.


str = text-002

call method ZW_UPDATE=>F1HELP
          EXPORTING
            TITLE       = str.

Regards.

Rich Heilman

Read only

Former Member
0 Likes
1,081

define a string variable and pass it like the below.

data: str type string.

str = '23243245235235t2fgsdfgdgsergegewwewefawef'(002).

call method ZW_UPDATE=>F1HELP
          EXPORTING
            TITLE       = str.

Read only

Former Member
0 Likes
1,080

Hi,

you can not pass the text element directly to the method or function module. you need to declare the data variable with type C or String and then need to pass it to FM/Method.

I hope it will solve your query.

Thanks,

Kamesh Bathla

Read only

0 Likes
1,080

Thanks everyone. Your help is greatly appreciated.

Anna