Application Development 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: 

message id with variable

Former Member
0 Kudos

I have to include the path of the file in my message box.

CONCATENATE c_fname p_saleno INTO c_path.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

MSG_ID = 'Z10493498'

MSG_NO = '002'

MSG_VAR1 = 'c_path'

IMPORTING

MSG_TEXT = v_mess

.

But it displays an error instead., I already include a & in my message short text, what is wrong with this?

Edited by: Enrique Mancao on Oct 20, 2008 7:44 AM

1 ACCEPTED SOLUTION

peter_ruiz2
Active Contributor
0 Kudos

hi Enrique,

try this.

CONCATENATE c_fname p_saleno INTO c_path.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

MSG_ID = 'Z10493498'

MSG_NO = '002'

MSG_VAR1 = c_path

IMPORTING

MSG_TEXT = v_mess

regards,

Peter

9 REPLIES 9

peter_ruiz2
Active Contributor
0 Kudos

hi Enrique,

try this.

CONCATENATE c_fname p_saleno INTO c_path.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

MSG_ID = 'Z10493498'

MSG_NO = '002'

MSG_VAR1 = c_path

IMPORTING

MSG_TEXT = v_mess

regards,

Peter

0 Kudos

Hi Peter,

I already did that, it has an error that says;

Type conflict when calling a function module.

Why is that?

0 Kudos

hi,

declare c_patch using the data type of MSG_VAR1.

regards,

Peter

0 Kudos

How would i know its data type?

0 Kudos

Hi Enrique,

I think there is a problem in the declaration you have made for c_path then.

give it as..


data: c_path type SYMSGV.

and then try...

Cheers,

Vishnu

0 Kudos

hi,

open the FM 'MESSAGE_PREPARE' in SE37 and check the declaration of the input parameter MSGV1. use its data type to declare c_path.

regards,

Peter

Former Member
0 Kudos

Hi ,

Check the data type of c_path is same as MSG_VAR1 and also check the data type of v_mess.

And also it is better to write capital letter when we are writing any text in codes. So change 'c_path' to 'C_PATH' and 'v_mess' to 'V_MESS'.

Thanks.

Phani Diwakar.

Former Member
0 Kudos

Go to Function module MESSAGE_PREPARE

check the data type of the MSG_VAR1 and decalre C_PATH with that data type

Former Member
0 Kudos

Can u pass the Language parameter as sy-langu and check ,

message text as 255 char ,

and the passing variables with sy-msgv1 ,

and get rid of the quotes .

Vijay.