‎2009 Nov 04 9:52 AM
Dear Gurus,
Can we pass Variable used in TEXT created by TCODE "so10" in executable Program.
for e.g.
Text created using so10 as :
Your account &knvp-kunnr& has been exceeded the limit.
Can I pass &knvp-kunnr& value ? if yes then how?
I am using the FM READ_TEXT in my Executable report and getting output as:
Your account &knvp-kunnr& has been exceeded the limit.
I need knvp-kunnr values.
Please help ASAP.
‎2009 Nov 04 9:57 AM
Not sure why you are using READ_TEXT for this purpose?
Just use Message with place holders would do this job for you.
Please help ASAP.Please resist yourself to write down these words into your post.
‎2009 Nov 04 10:18 AM
thanks for making correction.
then what should i use instead of read_text?
‎2009 Nov 04 10:37 AM
http://www.google.co.in/search?hl=en&q=messagewithplaceholders%2BSAP&meta=&aq=f&oq=
‎2009 Nov 04 10:58 AM
they are neither messages nor text elements..
I have to use those Text to send emails.
Having 5 different types of email.
so will be creating 5 different text in so10.
using READ_TEXT, making that text available for email in text. but want to replace the variables.
as there are many variables needs to be used in mail.
For e.g.
Your Account number [Variable1] has been exceeded to [variable2]. Please contact your [variable 3]..... and so on.
I hope this clears the requirment.
‎2009 Nov 04 11:43 AM
Hi Neha,
You can save the text as
'Your Account number &1 has been exceeded to &2. Please contact your &3..... and so on.'
Then in the code, search for &1 and replace it with desired value (value1).
Search for &2, and replace it with value2.
You can use any word which you are sure will not be present in your message.
For eg : &1/&2 , or, AAAA/BBBB/CCCCC, etc.
Sample code below:
LOOP AT itab INTO wa.
l_codeword_1 = '&1'.
SEARCH wa-line FOR l_codeword_1.
IF sy-subrc EQ 0.
l_value_1 = <pass knvp-kunnr value>
REPLACE l_codeword_1 WITH l_value_1 INTO wa-line.
ENDIF.
SEARCH wa-line FOR l_codeword_2.
IF sy-subrc EQ 0.
l_value_2 = <pass second variable value>
REPLACE l_codeword_2 WITH l_value_2 INTO wa-line.
ENDIF.
wa2-line = wa-line.
APPEND wa2 TO itab2.
ENDLOOP.
This will solve your problem.
Thanks,
Nisha Vengal.
‎2009 Nov 04 12:09 PM
Thanks nisha...
but is there any method so that instead of searching and replacing....in READ_TEXT FM only the value of variable gets replaced ?
‎2009 Nov 05 9:46 AM
Hi Neha,
I am not sure if there is any better solution for this.
You should not modify the original text, unless requirement is like that.
Just modify the itab with the variable values.
Thanks,
Nisha Vengal.
‎2009 Nov 04 9:59 AM
Hi,
You want to display the values in Sapscript or Smartforms or report ???
‎2009 Nov 04 10:15 AM
in Report I will be using this which will be used in sending emails.
‎2009 Nov 10 12:03 PM
Hi,
You can create a document in SE61 with your variable &KUNNR& embedded within the text.
Use FM 'DOCU_GET' to read the document in program. Then call FM 'TEXT_SYMBOL_REPLACE' to replace the variable with the value of KUNNR, which is already populated in your program.
SAP standard program RSWUWFML2 for extended notifications uses this logic. You can refer this program for more information.
‎2009 Nov 11 3:56 AM
Thanks, I am closing this thread, as the same kinda reply I am getting.
I got the solution by own.
Thanks all.
‎2010 Jan 20 3:02 PM