Application Development and Automation 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: 
Read only

DELETING SPACE IN VARIABLE

Former Member
0 Likes
5,416

HI Experts,

I have a quantity field of 15 length. the value in it is " 12.345". How do i delete the left most space from it.

urgent.

thanks.

Khan

9 REPLIES 9
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
3,132

Hi,

Try CONDENSE string.

Regards,

Sandeep

Read only

Former Member
0 Likes
3,132

Hi,

Use CONDENSE command to remove spaces.

Example:

DATA: l_var TYPE char20.

l_var = ' 12.345'.

WRITE / l_var.

CONDENSE l_var.

WRITE / l_var.

Pls reward if useful.

Regards,

Farheen.

Read only

abdulazeez12
Active Contributor
0 Likes
3,132

Hi Khan

Try moving the value from quantity variable to CHARACTER variable first.

then use CONDENSE command OR

use shift LEFT deleting leading SPACE.

then move the CHARACTER value to quantity variable.

Reward points

Shakir

Read only

0 Likes
3,132

HI

AFTER condence a CHARACTER value & move that to quantity variable, it again show spaces at left side. due to that my command shows error....Is it coz of comma in 765,423.900 or something else.

my Code:-

XMENGE = ITAB-MENGE.

CONDENSE XMENGE.

ITAB-MENGE = XMENGE.

READ LINE line_num FIELD VALUE ITAB-MENGE.

Error:-

Unable to interpret " 765,423.900 " as a number.

Plz help.

Khan

Edited by: khan on Jan 23, 2008 3:04 PM

Read only

0 Likes
3,132

Hi,

Do not move Condensed Character value back to Numeric or Qty field. Just use the Condensed Character value for further processing like printing etc. etc.

Regards

Raju chitale

Read only

Former Member
0 Likes
3,132

Hi,

Use CONDENCE statement

if u use this statement it will delete un necessary priting valies.

reward me if it is use full answer

Read only

Former Member
0 Likes
3,132

Hi,

Use CONDENSE stmt as shown below.

CONDENSE(your variable).

Regds,

Bujji

Read only

Former Member
0 Likes
3,132

hi

good

check this code

Try like this:

codeDATA: VAL(10),

POS TYPE I.

VAL = '1 245.67'.

SEARCH VAL FOR '. .' IN CHARACTER MODE.

IF SY-SUBRC = 0.

POS = SY-FDPOS + 1.

WRITE: 'SPACE at', POS.

ENDIF.[/code]

thanks

mrutyun^

Read only

Former Member
0 Likes
3,132

answred