jueves, 4 de noviembre de 2010

Abap eliminar caracteres de una cadena

Es para cuando no se puede usar el REPLACE ALL OCCURRENCES OF debido a que no lo tiene la version de sap, si se quiere insertar otro simbolo en vez de ese usar
translate donde elim nos dice que caracter sustituir por cual ej @ por ' '.


report zelcar.
data texto(5000) type c
value '@123"@=,<,>,~,/,”,,+,*,|,:,·$%&/()9876*1@)'.
data elim(4) value '@ * '.
write texto.
perform f_elimina_caracteres using texto.
*translate texto using elim.
write / texto.



**------------------------------------------------
** f_elimina_caracteres.
**------------------------------------------------
form f_elimina_caracteres changing texto.
data: len type i, caracter, va type i,texto2(5000) type c.
*creamos tabla interna con los caracteres a eliminar de el archivo
data: begin of i_careli occurs 0,
car,
end of i_careli.
*cuales caracteres queremos quitar =,<,>,~,/,”,’,+,*,|,:,
i_careli-car = '='.append i_careli.
i_careli-car = '<'.append i_careli.
i_careli-car = '>'.append i_careli.
i_careli-car = '~'.append i_careli.
i_careli-car = '/'.append i_careli.
i_careli-car = '+'.append i_careli.
i_careli-car = '*'.append i_careli.
i_careli-car = '|'.append i_careli.
i_careli-car = ':'.append i_careli.


write texto.
len = strlen( texto ).
while va <= len.

caracter = texto+va(+1).
loop at i_careli.
if i_careli-car = caracter.
caracter = ''.
endif.
endloop.
concatenate caracter texto2 into texto2.
va = va + 1.
endwhile.
texto = texto2.
endform.

16 comentarios:

Anónimo dijo...

You actually make it seem so easy with your presentation but I find this topic
to be really something that I think I would never understand.
It seems too complex and extremely broad for me. I am looking forward for your next post, I will
try to get the hang of it!

my website ... ロレックスレプリカ

Anónimo dijo...

I constantly spent my half an hour to read this weblog's articles daily along with a mug of coffee.

My web-site - http://youngsick.blogspot.com/

Anónimo dijo...

Asking questions are in fact good thing if you are not
understanding anything entirely, however this paragraph provides pleasant understanding yet.



Feel free to surf to my homepage :: visarcana.pl

Anónimo dijo...

Hello there! I know this is kinda off topic nevertheless I'd figured I'd ask.
Would you be interested in exchanging links or maybe guest authoring a blog
article or vice-versa? My site addresses a lot of the same subjects as
yours and I think we could greatly benefit from each other.
If you are interested feel free to send me an email.

I look forward to hearing from you! Wonderful blog by the
way!

My page: ロレックスコピー

Anónimo dijo...

Wonderful items from you, man. I have understand your stuff
prior to and you are just extremely wonderful.

I really like what you've received here, certainly like what you're stating and the way in which wherein you say it.
You're making it enjoyable and you still take care of to keep it smart. I can't wait to learn far more
from you. That is really a wonderful website.

Also visit my webpage: the tao of badass

Anónimo dijo...

Nice weblog here! Additionally your website loads up very fast!
What web host are you the use of? Can I am getting your associate hyperlink on your host?
I desire my web site loaded up as quickly as
yours lol

Here is my web-site: christian louboutin wedding shoes

Anónimo dijo...

Whoa! This blog looks just like my old one! It's on a entirely different subject but it has pretty much the same layout and design. Great choice of colors!

Feel free to visit my site - oakley outlet

Anónimo dijo...

Heya! I know this is somewhat off-topic however I had to ask.
Does running a well-established blog such as yours require a lot
of work? I am brand new to operating a blog however I do write in my journal
daily. I'd like to start a blog so I can easily share my experience and views online. Please let me know if you have any kind of recommendations or tips for brand new aspiring blog owners. Thankyou!

Here is my weblog ... forum.fesch.at

Anónimo dijo...

Remarkable things here. I'm very satisfied to look your article. Thanks a lot and I am having a look ahead to contact you. Will you kindly drop me a e-mail?

my homepage - Polo Ralph Lauren Outlet

Anónimo dijo...

Hi there I am so excited I found your blog page,
I really found you by accident, while I was researching on Yahoo for something else, Anyhow I am here
now and would just like to say thanks for a tremendous post and
a all round thrilling blog (I also love the theme/design), I don’t have time to
browse it all at the moment but I have book-marked it and also added your RSS feeds, so when I have time
I will be back to read a great deal more, Please do keep up the great work.


Also visit my web blog ... Polo Ralph Lauren Outlet

Anónimo dijo...

When some one searches for his vital thing, so he/she needs to be available that in detail, thus that thing is maintained over here.


Also visit my web blog; ロレックスレプリカ

Anónimo dijo...

After exploring a few of the blog posts on your web page, I really appreciate your
way of writing a blog. I saved it to my bookmark website list and will be checking back soon.
Take a look at my website as well and tell me how you feel.



Also visit my blog post :: http://www.abercrombiefitchclothesoutletsale.com/

Anónimo dijo...

Why visitors still make use of to read news papers when in this technological world all is existing on web?


Also visit my web site: christian louboutin discount

Anónimo dijo...

Asking questions are genuinely fastidious thing if you are not understanding something entirely, however this post provides nice understanding even.


Here is my page :: Nike Free Run Sale

Anónimo dijo...

Que feo código. Podríasn ponerle un poco de onda para que se entienda bien.

Anónimo dijo...

Pésimo Codigo!