04-06-2009 11:16 AM
Hi guys i m using titles to print any title but i need to put some spaces in both sides of the message , i was thinking in something like that :
concatenate space(20) 'welcome to' space(12) into tit
write tit.
but it doesnt work , how can i achive this ?
thanks.
04-06-2009 11:58 AM
data: car type char50.
car+20(20) = 'Welcome'.
car+40(10) = ' '.
write car.
This is tried and it gives you spaces just adjust according to your need...
Regards,
Lalit Mohan Gupta.
04-06-2009 11:19 AM
Hi:
Simply do like this
1.
concatenate ' welcome to ' into tit
write tit.
2.
write : / (20) tit.
Regards
Shashi
04-06-2009 11:20 AM
Hi,
Simplest would be:
Clear tit.
tit+20 = 'Welcome to'.
Regards
Raju Chitale
04-06-2009 11:25 AM
04-06-2009 11:26 AM
Hello,
I donot know about the spaces on the RH of the string.
DATA: tit TYPE char120.
tit+20 = 'Welcome to SAP'.
WRITE: tit.
BR,
Suhas
04-06-2009 11:27 AM
Hi,
This issue exist when we try to give some space along with concatenate statement.
But i tried with some logic as following,
As You need to print Welcome TO
So you take a work feild wf1 and assingn text "welcome" to it
And then SHIFT wf1 RIGHT BY 20 PLACES.
And take wf2 and assign text "To " to it.
And then SHIFT wa_temp LEFT BY 20 PLACES.
and then Concatenate wf1 and wf2
Hope this will work.
Regards,
Nitin.
04-06-2009 11:29 AM
Hi Jose,
Try this:
Tit = ' Welcome to '.
write 😕 Tit.
Copy in your editor and execute.
Regards,
Swapna.
04-06-2009 11:32 AM
hello,
declare two variables
data: lv_space(20) type c,
lv_space(20) type c.
concatenate lv_space your message lv_space into lv_var.
sorry!..its not working .
Edited by: BrightSide on Apr 6, 2009 11:39 AM
04-06-2009 11:35 AM
Hi All,
We can't concatenate SPACES with Concatinate statement. It will automatically removes the extra space.
So here we need to shift space on the left and right side and then concatenate the work fields way i have given above.
Regards,
Nitin.
04-06-2009 12:44 PM
>
> Hi All,
>
> We can't concatenate SPACES with Concatinate statement. It will automatically removes the extra space.
> So here we need to shift space on the left and right side and then concatenate the work fields way i have given above.
>
> Regards,
>
> Nitin.
Actually we can concatenate spaces using the following;
CONCATENATE ld_one ld_two ld_three INTO ld_four RESPECTING BLANKS.
Regards,
Simon
04-06-2009 11:58 AM
data: car type char50.
car+20(20) = 'Welcome'.
car+40(10) = ' '.
write car.
This is tried and it gives you spaces just adjust according to your need...
Regards,
Lalit Mohan Gupta.
04-06-2009 12:06 PM
Use the logic like this:
data: v_str type string.
CONCATENATE '#####' 'welcome to' '#####' INTO v_str.
TRANSLATE v_str USING '# '.
write:/ v_str.
In the above '#' replaces with space.
04-06-2009 12:50 PM
Hi Simon,
Actually, you try with this statement , we can not insert more then 1 space using this statement.
Regards,
Nitin.
04-06-2009 12:52 PM
But in SAP 4.6 only and lower . Respecting blanks is only valid with versions next from 4.6.
04-06-2009 1:06 PM
OK. Well assuming he is using v4.6 or higher, this would be the perfect solution in my opinion.