01-30-2007 8:21 PM
I developed a code a to validate the serial number (SERNR) ...... The serial number entered is 9 characters... But at the runtime...it is preceeded by 9 zeros making valid entered number invalid.How can i remove those extra zeroes..
01-30-2007 8:27 PM
01-30-2007 8:29 PM
Could u explain in detail with the example of the sample code....
Also what is the syntax of the Shift statement
01-30-2007 8:37 PM
You may also use NO-ZERO with WRITE statement.
NO-ZERO
-
If a field contains only zeros, these are replaced by blanks. For type C and N fields, leading zeros are replaced automatically.
WRITE: '000123',
/ '000123' NO-ZERO.
Output:
000123
123
Thanks,
Santosh
01-30-2007 8:39 PM
If i understand you correctly, you have SERNR as a user-input option, and at runtime, it is left-padded with zeroes. This means that your input parameter is of type N, whose default-value is filled with zeroes.
One way to overcome this would be to change the definition of the parameter to type I or type C, depending upon whether you expect characters or not.
Further, there are conversion-modules to convert a user-input value to the internal format. Check SE37 with the name CONVERALPHAINPUT - you could use either the generic FM, or a specific one for your field.