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

Message Class inside a function module

Former Member
0 Likes
5,255

Hi Experts,

Can i still use message class inside a function module?

Thank you very much.

9 REPLIES 9
Read only

Former Member
0 Likes
2,185

Yes you can. In the function Pool use the following statement.

FUNCTION-POOL (Funcctioni Grp Name) MESSAGE-ID (Message class Name).

then in the function modules you can use statements like

Example

  MESSAGE S377 RAISING CORR_EXIT.

Amandeep

Read only

Former Member
0 Likes
2,185

Yes as long as you have declared the message class in the REPORT statement like

Report ztest Message ID ztest_msg.

at the starting of your program.

Read only

Former Member
0 Likes
2,185

Hi Don,

You can not use Message class in Function module

Go to the main program of the Function module from Attributes --> Program name --> Double click, you will find TOP include in that.

Maintain the message class there as below

FUNCTION-POOL <Function Pool Name> MESSAGE-ID <Message ID>.

Regards,

Satish

Read only

Former Member
0 Likes
2,185

Thanks everyone.

can i declare like this?

FUNCTION <function_name> message-id <message_ID>.

Thanks

Read only

0 Likes
2,185

No...

As below

FUNCTION-POOL <function_name> message-id <message_ID>.

<function_name> - this will come automatically.

Regards,

Satish

Read only

0 Likes
2,185

All you have to do is to do the declaratioin in the TOP include.

this will flow down to all the function modules in the function group.

cheers

A

Read only

0 Likes
2,185

Sorry misread it as Subroutine, always confusing.

Read only

0 Likes
2,185

If resolved please close the thread.

thanks

a

Read only

Former Member
0 Likes
2,185

Thank you very much everyone. Till next time.