2005 Nov 17 12:01 PM
Hello,
I want to delete leading spaces of one field, which is of type STPOX-MNGLG its a quantity field.
Regards,
Amey
2005 Nov 17 12:06 PM
Hi,
Use Condense statement if it is Script or Smartform &STPOX-MNGLG(C)& : Script or Smartform
In case of others move that variable to a char type var of same length and use condense statement after that.
It works....
2005 Nov 17 12:07 PM
Hi,
Why you want to delete leading space in Qty field.
If this is for display in the outout, you can use WRITE wtih LEFT-JUSTIFIED option.
If my understanding is not corerct, Can you please give more details about your issue.
Thanks,
Ramakrishna
2005 Nov 17 12:07 PM
Hi Amey,
For quantity fields first you need to move to char field and do it.
SHIFT V_CHAR LEFT DELETING LEADING space.
Or else it wont work. Even I got the same problem long back.I dint in that way only.
Thanks & Regards,
Siir.
2005 Nov 17 12:07 PM
2005 Nov 17 12:09 PM
Hi Amey,
pass it to a character variable and then remove the leading spaces by
using the condense command.
Regards,
ravi
2005 Nov 17 12:09 PM
Amey,
You can try "condense" with "No-gaps" options
Here is an example
DATA: BEGIN OF NAME,
TITLE(8) VALUE ' Dr.',
FIRST_NAME(10) VALUE 'Michael',
SURNAME(10) VALUE 'Hofmann',
END OF NAME.
CONDENSE NAME NO-GAPS.
The contents of NAME is now "Dr.MichaelHofmann".
Since the field string NAME is interpreted and handled like a
type C field, the CONDENSE statement treats it as a whole and
ignores any sub-fields. The contents of the sub-field would
therefore now be as follows:
NAME-TITLE = 'Dr.Micha'
NAME-FIRST_NAME = 'elHofmann '
NAME-SURNAME = ' '
2005 Nov 17 12:10 PM
Hi Amey,
2 ways to do it:
1. Declare another variable <Var1> of type C of 15 characters long.
WRITE <varible of type STPOX-MNGLG> to <var1>.
condense <Var1>.
2. Since it is a quantity field, the value is right justified, try formatting the output as left justified.
Naveen.