09-30-2010 8:36 AM
hello gurus,
seee this example
data : var1 type string,
var2 type string,
var3 tyype string.
var1 = 'lifnr'.
var2 = '1000'.
concatenate var1 var2 into var3 .
write : / var3.
output : lifnr = 1000.
but i want to display my output as lifnr = '1000'.
through concatenate string.
thanks
anji.
09-30-2010 8:40 AM
Hello,
write the following statement:
concatenate var1 '=' '''' var2 '''' into var3.
Hope this helps.
Regards,
Himanshu
09-30-2010 8:40 AM
Hello,
write the following statement:
concatenate var1 '=' '''' var2 '''' into var3.
Hope this helps.
Regards,
Himanshu
09-30-2010 8:41 AM
data : var1 type string,
var2 type string,
var3 tyype string.
var1 = 'lifnr'.
var2 = '1000'.
concatenate var1 var2 into var3 .
write : / var3.
data char1 thpe c '''.
concatenate var1 space '=' space char1 var2 char1 into var3 .
char1
output : lifnr = 1000.
but i want to display my output as lifnr = '1000'.
through concatenate string.
thanks
Edited by: Karthikeyan Pandurangan on Sep 30, 2010 9:46 AM
09-30-2010 8:50 AM
09-30-2010 8:55 AM
Hello,
Check this:
DATA : var1 TYPE string,
var2 TYPE string,
var3 TYPE string.
var1 = `lifnr`.
var2 = `'1000'`. "Check the Backquotes
CONCATENATE var1 '=' var2 INTO var3 SEPARATED BY space.
WRITE : / var3.
BR,
Suhas
09-30-2010 9:00 AM
This was reported to the Moderators as a basic question. And it is. But the poster has put the effort in, it's not something he can search for, so in my view it can stand. To me this is an opportunity to show a beginner the way he should go.
(It's not that basic questions aren't permitted, it's just that they tend to be Frequently Asked Questions, and these are not training forums).
I wouldn't use concatenate in for this type of problem, I'd do something like
DATA: my_text TYPE string.
data : var2 type string,
my_text = 'lifnr = ''&LIFNR'''(001). " Defines text element text-001 as: lifnr = '&LIFNR'
var2 = '1000'.
REPLACE ALL OCCURENCES OF '&LIFNR' IN my_text WITH var2.
write : / my_text
09-30-2010 9:07 AM
09-30-2010 10:23 AM
> Hi Matt,
>
> Any specifics why you won't use CONCATENATE ?
>
> BR,
> Suhas
I think my version is easier to read and understand, and also it is MUCH easier to do the translation in a multilingual system - especially if there's more than one variable. For example:
In English: "You must &1 instead of &2.". In German "Sie müssen anstatt zu &2 &1."
How would you do that using concatenation, without having some like IF language EQ 'DE'... ? OK, you can use a message class and number, but that's not always appropriate, or even possible.
09-30-2010 9:35 AM
Hey.. Pls have a look at this...:
data: var1 type string,
var3 type string.
parameters: var2 type string.
var1 = 'LIFNR'.
concatenate ''''var2'''' into var3.
concatenate var1 '=' var3 into var3 separated by ''.
write var3.