Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Junk values in an internal table field

Former Member
0 Kudos

Hi,

I have an internal table with a field matnr and matxt.

Now both the fields have a junk value '#'.

matnr has '#' at the end and matxt has '#' in between the description.

How do I get rid of them.

Michael

13 REPLIES 13

Former Member
0 Kudos

Hi Michael,

Can u paste your code here.

Guru

0 Kudos

Hi All,

the MARA table itself has '#' in matnr and matxt.

now actually I want to remove this '#' as I would pass it to an interface.

Michael

0 Kudos

Hi

use REPLACE '#' WITH ' ' INTO field.

Guru.

0 Kudos

Hi Guru,

tried it, but no success.

Michael

0 Kudos

hi,

Use..

TRANSLATE <fieldname> USING '# '.

Thanks & REgards

0 Kudos

ok

if so,

if the '#' is only at starting and ending.

then use.

replace twice.

replace "#' with ' ' into field.

replace '#' with ' ' into field.

or

do 2 times.

replace "#' with ' ' into field.

enddo.

Guru.

0 Kudos

if in description "#' occurs many times.

then split the description into one internal table

like

data: begin of it occurs 0,

fld(50),

end of it.

data : text(100).

data : ch(50).

ch = 'teygvwsjsf#wewew#wqdhfd#jdhgfd'.

split ch at '#' into table it.

loop at it.

concatenate it-ch into text sperated by space.

endloop.

u will get the string in variable text after the loop.

guru

0 Kudos

Sorry friend ..didnt check the code before posting,,

here is the correct one..

data: begin of it occurs 0,

fld(50),

end of it.

data : text1(100).

data : ch(50).

ch = 'teygvwsjsf#wewew#wqdhfd#jdhgfd'.

split ch at '#' into table it.

loop at it.

concatenate text1 it-fld into text1 separated by space.

endloop.

0 Kudos

hi is your problem solved..?

Guru.

Former Member
0 Kudos

Did you declare the fields with the correct type? Eg; matnr is character field.

Former Member
0 Kudos

Hi,

did you check in tables from where you selecting? i guess may be the DB table has the same...

Could you paste your code...

Regards,

Pavan

kamesh_g
Contributor
0 Kudos

hi

You might have declared matnr and maktx as character type .

CHeck the value in debug while passing to internal table .

Former Member
0 Kudos

hi

replace all occureences of "#' with space.

it may alos be a tab - try declaring a single tabl like cl_abp-utilities .

reg

Ramya

Edited by: Ramya S on Mar 23, 2009 8:08 AM