Entering content frame

TRIM(x,y) Locate the document in its SAP Library structure

TRIM(x,y) is a string function that removes all of the characters specified in the character string y from the start of the character string  x. The result of TRIM(x,y), therefore, starts with the first character that was not specified in y.

TRIM(x,y) also removes the blanks (code attribute ASCII, UNICODE) or binary zeros (code attribute BYTE) from the end of the character string x and then all of the characters specified in the character string y. The result of TRIM(x,y), therefore, ends with the last character that was not specified in y.

 

Result of the TRIM(x,y) Function

TRIM(x)

Only blanks (code attribute ASCII, UNICODE) or binary zeros (code attribute BYTE) are removed from x.

x is a NULL value

NULL Value

Example

SELECT hno, TRIM(price,'0') & ' EURO' price
FROM room WHERE price > 200

Removing the zeros after the point in prices

HNO

PRICE

50

500. EURO

60

500. EURO

80

400. EURO

90

300. EURO

120

350. EURO

130

270. EURO

130

700. EURO

140

600. EURO

150

450. EURO

See also:

LTRIM(x,y)

RTRIM(x,y)

 

Leaving content frame