2007 Aug 07 2:00 PM
Hi All,
I am inputting the value of variable A1 from selection screen.
Now i am using text element to display some msg where i want to use A1.
For eg: text-001.
And in 001 i have wrritten msg 'The status of (value of A1) is OK'
So how to pass variable A1 there??
Any help appreciated.
Regards,
Samruddhi
2007 Aug 07 2:10 PM
If your text-001 was 'The status of &1 is OK', then you could copy the value in variable and then replace &1 with value of the field, not very funny.
worktext = text-001.
REPLACE '&1' WITH field INTO worktext.Better way, is to use messages.
Via SE91 you define a message say ZMSG number 001 with text 'The status of &1 is OK'
Then in your program you only have to write
MESSAGE S001(ZMSG) WITH field.The &1 or & characters will be replaced with the parameter of the message (0 to 4 parameters)
Regards
Hi All,
I am inputting the value of variable A1 from selection screen.
Now i am using text element to display some msg where i want to use A1.
For eg: text-001.
And in 001 i have wrritten msg 'The status of (value of A1) is OK'
So how to pass variable A1 there??
Any help appreciated.
Regards,
Samruddhi
2007 Aug 07 2:07 PM
Hi,
Paste this code.
REPORT Y_TEST_1 message-id ytest .
parameters: mat type matnr.
if not mat is initial.
message e001 with mat.
endif.
(double click on Ytest message -id and give text as "materail & doesnt exist".)
"& "--> will be replaced by mat i.e variable.
Revert back if any issues.
Reward with points if hhelpful.
regards,
Naveen
2007 Aug 07 2:18 PM
Hi,
Thanks for quick reply.
But, i have some different scenario.
I don't want to display it as a error or warning message..
This will be the final output of my program.
So i am displaying it as follows
A2 = text-001.(where A2 is one variable):
Calling a function module RSSM_ICON_CREATE which creates icon(green colour, or red or yellow) which needs 2 parameters:
text(passing A2) and icon code.
And then using WRITE statement displaying the result.
2007 Aug 07 2:35 PM
Hi Samruddhi,
Then u cannot change the Value Dynamically in the TEXT-001 statement, as it wiil be constatnt.
so u can use some string function there by u can display that.
revert back if any issues,
Rewrad with points if helpful.
Regards,
Naveen
2007 Aug 07 2:09 PM
Hi
Also you can...
*for example lenght 50
DATA field(50) type c.
Use---> CONCATENATE text-001 ' ' A1 into field.
and display "field".
Regards
Yossi
2007 Aug 07 2:10 PM
If your text-001 was 'The status of &1 is OK', then you could copy the value in variable and then replace &1 with value of the field, not very funny.
worktext = text-001.
REPLACE '&1' WITH field INTO worktext.Better way, is to use messages.
Via SE91 you define a message say ZMSG number 001 with text 'The status of &1 is OK'
Then in your program you only have to write
MESSAGE S001(ZMSG) WITH field.The &1 or & characters will be replaced with the parameter of the message (0 to 4 parameters)
Regards
2007 Aug 07 2:29 PM
Thanks for your help.
My problem is almost solved.
But it is displaying 'The status of (value of A1) is OK'
Why the space is comming between A1 value and is??
Any help appreciated..
2007 Aug 07 2:50 PM
2007 Aug 07 2:53 PM
2007 Aug 07 2:15 PM
HI,
In SE91 create a message of your message class like this way
"The status of & is OK"
then Use
message e001(ymsg) with text-001.
aRs
2007 Aug 07 2:16 PM
Hi,
The best way to achieve what you eant to is to use a message.In the message add a place holder & and then when you call the message call it like:
message i320(mssgcalss) with 'A'.
'A' will appear in the message.
Thanks,
Sandeep.
2007 Aug 07 2:17 PM
Hi..
You have to Call a <b>Message</b> from the program instead of Text Elements<b></b>
Put the Following Statment in Your Code.
**Calling a message in a program
MESSAGE S001(ZMSGCL) WITH A1.
To Create the Message Class ZMSGCL and the Message Number 001 you have to double click on the Message class ZMSGCL.
It will create the Message class and gives the message numbers from 000 to 999
You enter the following message for 001
001 The status of &1 is OK
Here &1 is the Variable where the Value of A1 is displayed.
Save the Message class and Execute the program.
<b>Reward if Helpful</b>
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |