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 id with variable

Former Member
0 Likes
1,984

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
Read only

peter_ruiz2
Active Contributor
0 Likes
1,711

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
Read only

peter_ruiz2
Active Contributor
0 Likes
1,712

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

Read only

0 Likes
1,711

Hi Peter,

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

Type conflict when calling a function module.

Why is that?

Read only

0 Likes
1,711

hi,

declare c_patch using the data type of MSG_VAR1.

regards,

Peter

Read only

0 Likes
1,711

How would i know its data type?

Read only

0 Likes
1,711

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

Read only

0 Likes
1,711

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

Read only

Former Member
0 Likes
1,711

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.

Read only

Former Member
0 Likes
1,711

Go to Function module MESSAGE_PREPARE

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

Read only

Former Member
0 Likes
1,711

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.