‎2006 Aug 16 5:40 PM
Hi Experts,
Can anybody please help me in writing the logic for "giving a message in a report".
code:
<b>data: l_field1 type c,
data: l_field2 type c,
data: l_field3 type c.</b>
in the report i have to give the message. <b>"Based on l_field1 l_field2 the value of l_field3 shoudl be ____".</b>
I hve to show the values of the 3 fields dynamically.
I hve to show the message like this:
<b>if sy-subrc = 0.
message iXXX(XX) with '----
'.</b>
plz advise.
Thanks for the help.
‎2006 Aug 16 5:52 PM
HI
For your understanding of using message class.
Messsage class:ZZ
Message Number: 001
Message Text: Material & does not exist in Plant & and storage location &
In Program:
Supposing the values are:
l_matnr = 'A1234'.
l_werks = 'PL10'.
l_lgort = 'ST10'.
Now use message in program as:
message e001(ZZ) with l_matnr l_werks l_lgort.
Result: Material A1234 does not exist in Plant PL10 and storage location ST10
Each & will be substituted with values in sequence.
Kind Regards
Eswar
‎2006 Aug 16 5:45 PM
Hi,
check this :
Take a character variable with long length and concatenate your message with variable and
then call like
message iXXX(XX) with x_message.
data : x_message(500) type c.
concatenate 'Based on' l_field1 l_field2 'the value of' l_field3 'shoudl be' into x_message.
Regards
Appana
‎2006 Aug 16 5:48 PM
You might try something like this.
report zrich_0001.
data: l_field1(5) type c value 2,
l_field2(5) type c value 2,
l_field3(5) type c.
data: message type string.
l_field3 = l_field1 + l_field2.
concatenate 'Based on' l_field1 l_field2
'the value of l_field3 should be' into message
separated by space.
message i001(00) with message l_field3.
REgards,
Rich Heilman
‎2006 Aug 16 6:06 PM
Thnx guyz.
I'm sorry i mentioned it wrongly.
The only problem here is l_field2 is type DEC.
It's amount field. How can I make it?
Thnx.
‎2006 Aug 16 6:11 PM
‎2006 Aug 16 6:17 PM
‎2006 Aug 16 6:31 PM
‎2006 Aug 16 5:52 PM
HI
For your understanding of using message class.
Messsage class:ZZ
Message Number: 001
Message Text: Material & does not exist in Plant & and storage location &
In Program:
Supposing the values are:
l_matnr = 'A1234'.
l_werks = 'PL10'.
l_lgort = 'ST10'.
Now use message in program as:
message e001(ZZ) with l_matnr l_werks l_lgort.
Result: Material A1234 does not exist in Plant PL10 and storage location ST10
Each & will be substituted with values in sequence.
Kind Regards
Eswar