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

Changing parameter type confusion

Former Member
0 Likes
601

Hi all,

One more question regarding the type of a changing parameter. I want to wrap some FMs in a subroutine. One example is SM02_ADD_MESSAGE. Trouble is I want to include a changing parameter for the message_id parameter. I can't seem to get the type declaration correct. Any pointers?

best regards,

Mat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
561

Declare it as:

MESSAGE_ID LIKE TEMSG-ID

Regards,

Joy.

4 REPLIES 4
Read only

Former Member
0 Likes
562

Declare it as:

MESSAGE_ID LIKE TEMSG-ID

Regards,

Joy.

Read only

0 Likes
561

Hi Joy,

I'm still a lil confused on this one. Here is my sample code. I've defined the following subroutine:

FORM add_system_message CHANGING pv_message_id LIKE temsg-id. I call the function module 'SM02_ADD_MESSAGE' in the subroutine and pass pv_message_id as the import parameter.

I call the same subroutine as follows:

PERFORM add_system_message CHANGING gv_message_id.

where gv_message_id is defined as follows:

DATA: gv_message_id LIKE temsg-id.

The program compiles but balks when I run it...seems the parameter has an incompatible type. Am I missing something here?

regards,

Mat

Read only

0 Likes
561

Hi,

U have shown the PERFORM part. But how u defined it in the statement

FROM add_system_message CHANGING gv_message_id LIKE ??????.

...

ENDFORM.

It should also have same type. Check this and get back in case of any issue.

Thanks,

Vinod.

Read only

0 Likes
561

My mistake...the message_id parameter was fine. when i debugged I realized it was another variabel that had the worng type