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 - Message text not displaying completely

Former Member
0 Likes
2,452

Dear All,

Case1: I am using message class ZMESSAGE in my program as mentioned below.

PROGRAM  zm_pp_prdconf MESSAGE-ID zmessage.

  LOOP AT lt_return WHERE type = 'E'.
    MESSAGE e001 WITH lt_return-message.
  ENDLOOP.

Message class:        ZMESSAGE
001	   & & & &

Here, my problem is.. the text from lt_return-message is not displaying completely. It is displaying maximum 50 Characters.

Example:

If lt_return-message = 'The Plant data for the material 10000 is locked by the user XXXXXXXXXXX".

It is displaying only "The Plant data for the material 1000 is locked by"

Can anyone help me for this problem

Case 2: I have also tried using the statement,

MESSAGE lt_return-message TYPE 'E'.

In this case. I am getting the message like "No Vendor specified" instead of displaying the real text.

Can anyone tel me the solution for either of these cases.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,472

Hi,

The variable part of the message (the &) is only 50 characters long, your field lt_return-message is longer than this so it truncates.

Try breaking the message string up into smaller parts;


MESSAGE e001 WITH lt_return-message(50) lt_return-message+50(50) 
                                   lt_return-message+100(50) lt_return-message+150(50) .

Regards,

Nick

Dear All,

Case1: I am using message class ZMESSAGE in my program as mentioned below.

PROGRAM  zm_pp_prdconf MESSAGE-ID zmessage.

  LOOP AT lt_return WHERE type = 'E'.
    MESSAGE e001 WITH lt_return-message.
  ENDLOOP.

Message class:        ZMESSAGE
001	   & & & &

Here, my problem is.. the text from lt_return-message is not displaying completely. It is displaying maximum 50 Characters.

Example:

If lt_return-message = 'The Plant data for the material 10000 is locked by the user XXXXXXXXXXX".

It is displaying only "The Plant data for the material 1000 is locked by"

Can anyone help me for this problem

Case 2: I have also tried using the statement,

MESSAGE lt_return-message TYPE 'E'.

In this case. I am getting the message like "No Vendor specified" instead of displaying the real text.

Can anyone tel me the solution for either of these cases.

6 REPLIES 6
Read only

Former Member
0 Likes
1,472

Hi,

Try to split the message and pass to MESSAGE statement..

lt_return-message1 = 'The Plant data for the material 10000'.
lt_return-message2 = 'locked by the user XXXXXXXXXXX".

LOOP AT lt_return WHERE type = 'E'.
    MESSAGE e001 WITH lt_return-message1 lt_return-message2 .
  ENDLOOP.

Read only

Former Member
0 Likes
1,473

Hi,

The variable part of the message (the &) is only 50 characters long, your field lt_return-message is longer than this so it truncates.

Try breaking the message string up into smaller parts;


MESSAGE e001 WITH lt_return-message(50) lt_return-message+50(50) 
                                   lt_return-message+100(50) lt_return-message+150(50) .

Regards,

Nick

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,472

Hi,

Split the sentence into two and use two variables. See the below example.

data v1(65) type c value '12345678901234567890 12345678901234567890 12345678901234567890'.

data v2(5) value 'hello'.

message i000 with v1 v2.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,472

If lt_return comes from a BAPI, why don't use the actual message id

MESSAGE ID lt_return-id TYPE lt_return-type  NUMBER lt_return-number
    WITH lt_return-message_v1 lt_return-message_v2 lt_return-message_v3 lt_return-message_v4

Regards,

Raymond

Read only

0 Likes
1,472

Hi,

While my earlier solution will work, Raymond's is the better approach, as it will also allow you to navigate to the long text of the message, whereas using a generic message with for placeholders will not.

Regards,

Nick

Read only

Former Member
0 Likes
1,472

Hi,

Use the FM "FORMAT_MESSAGE" to construct the complete message.

for this FM u need to pass Message class, Message Number, Message variables V1,V2,V3,V4.

Regards,

Bharat Kalagara.