RE: [sap-abap] How to add space.
Posted by
Admin at
|
Share this post:
|
0 Comments
| | Posted by prakashkunte (Mr.) on Aug 19 at 11:45 AM | |
Dear Horacio,
Thanks for your help.
Translate command worked.
Used following line after concatenation
TRANSLATE lv_txtname USING '- '.
Thanks again.
Regards,
Prakash Kunte
_____
From: horacio zapettini via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Sent: Wednesday, August 19, 2009 8:43 PM
To: prakashkunte
Subject: RE: [sap-abap] How to add space.
Posted by horacio zapettini
on Aug 19 at 11:04 AM
<http://it.toolbox.com/api/ContentVote/2940941/1/1/> Mark this reply as
helpfulMark as helpful
Have you tried using translate instead of replace?
Ex. Translate variablename using '- '.
I use it when I want to format a text with spaces and I have to use
concatenate.
________________________________
De: prakashkunte via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Enviado el: MiƩrcoles, 19 de Agosto de 2009 11:57 a.m.
Para: Horacio Zapettini
Asunto: RE: [sap-abap] How to add space.
[http://userimages.toolbox.com/user/b_941647.jpg]
Posted by prakashkunte (Mr.)
on Aug 19 at 10:49 AM
[http://images.ittoolbox.com/vt/icons/vote.png]Mark as
helpful<http://it.toolbox.com/api/ContentVote/2940880/1/1/>
Dear Horacia,
Here is the code.
data: serial_length type i.
serial_length = strlen( w_data-matnr ).
IF serial_length = 10.
CONCATENATE w_data-matnr '--------' INTO w_data-matnr.
ENDIF.
CONCATENATE w_data-matnr c_selesorg INTO lv_txtname.
REPLACE ALL OCCURRENCES OF '-' in lv_txtname WITH space.
I have tried it first adding '-' at the end of w_data-matnr.
After concatenation my lv_txtname becomes 'xxxxxxxxxx--------140010'
Now I want replace '--------' with 8 spaces which will give me the form
'xxxxxxxxxx 140010'
But after replace string is getting trimmed giving 'xxxxxxxxxx140010'
Thanks & Regards,
Prakash
_____
From: horacio zapettini via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Sent: Wednesday, August 19, 2009 7:44 PM
To: prakashkunte
Subject: RE:[sap-abap] How to add space.
Posted by horacio zapettini
on Aug 19 at 10:20 AM
<http://it.toolbox.com/api/ContentVote/2940789/1/1/> Mark this reply as
helpfulMark as helpful
Prakash,
can you paste an snippet of your code?
what exactly do you want to do?
thanks,
Horacio
__.____._ Thanks for your help.
Translate command worked.
Used following line after concatenation
TRANSLATE lv_txtname USING '- '.
Thanks again.
Regards,
Prakash Kunte
_____
From: horacio zapettini via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Sent: Wednesday, August 19, 2009 8:43 PM
To: prakashkunte
Subject: RE: [sap-abap] How to add space.
Posted by horacio zapettini
on Aug 19 at 11:04 AM
<http://it.toolbox.com/api/ContentVote/2940941/1/1/> Mark this reply as
helpfulMark as helpful
Have you tried using translate instead of replace?
Ex. Translate variablename using '- '.
I use it when I want to format a text with spaces and I have to use
concatenate.
________________________________
De: prakashkunte via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Enviado el: MiƩrcoles, 19 de Agosto de 2009 11:57 a.m.
Para: Horacio Zapettini
Asunto: RE: [sap-abap] How to add space.
[http://userimages.toolbox.com/user/b_941647.jpg]
Posted by prakashkunte (Mr.)
on Aug 19 at 10:49 AM
[http://images.ittoolbox.com/vt/icons/vote.png]Mark as
helpful<http://it.toolbox.com/api/ContentVote/2940880/1/1/>
Dear Horacia,
Here is the code.
data: serial_length type i.
serial_length = strlen( w_data-matnr ).
IF serial_length = 10.
CONCATENATE w_data-matnr '--------' INTO w_data-matnr.
ENDIF.
CONCATENATE w_data-matnr c_selesorg INTO lv_txtname.
REPLACE ALL OCCURRENCES OF '-' in lv_txtname WITH space.
I have tried it first adding '-' at the end of w_data-matnr.
After concatenation my lv_txtname becomes 'xxxxxxxxxx--------140010'
Now I want replace '--------' with 8 spaces which will give me the form
'xxxxxxxxxx 140010'
But after replace string is getting trimmed giving 'xxxxxxxxxx140010'
Thanks & Regards,
Prakash
_____
From: horacio zapettini via sap-abap [mailto:sap-abap@Groups.ITtoolbox.com]
Sent: Wednesday, August 19, 2009 7:44 PM
To: prakashkunte
Subject: RE:[sap-abap] How to add space.
Posted by horacio zapettini
on Aug 19 at 10:20 AM
<http://it.toolbox.com/api/ContentVote/2940789/1/1/> Mark this reply as
helpfulMark as helpful
Prakash,
can you paste an snippet of your code?
what exactly do you want to do?
thanks,
Horacio
Copyright © 2009 CEB Toolbox, Inc. and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
View this thread online
Manage group e-mails
Create an FAQ on this topic
Tell us what you think
Unsubscribe from discussion
Manage group e-mails
Create an FAQ on this topic
Tell us what you think
Unsubscribe from discussion