‎2008 Jan 23 8:02 AM
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
‎2008 Jan 23 8:07 AM
‎2008 Jan 23 8:08 AM
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.
‎2008 Jan 23 8:10 AM
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
‎2008 Jan 23 9:28 AM
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
‎2008 Jan 23 9:53 AM
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
‎2008 Jan 23 8:48 AM
Hi,
Use CONDENCE statement
if u use this statement it will delete un necessary priting valies.
reward me if it is use full answer
‎2008 Jan 23 8:52 AM
Hi,
Use CONDENSE stmt as shown below.
CONDENSE(your variable).
Regds,
Bujji
‎2008 Jan 23 8:53 AM
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^
‎2008 Jan 23 11:00 AM