---
title: "SAP SmartForms 字符处理"
author: "evangxli"
date: "2014-05-14T14:44:34Z"
tags: []
categories: ["编程语言"]
slug: "sap-smartforms"
draft: false
lastmod: "2014-05-14T15:06:12Z"
id: 2066337
url: "https://sapabap.iteye.com/blog/2066337"
---

格式化数字等，在smartforms显示输出的格式。 

Link：

http://help.sap.com/saphelp\_nw04/helpdata/en/1c/f40c6fddf311d3b574006094192fe3/frameset.htm

Overview

Formatting Options for Fields

**Syntax**

**Description**

&field+**&lt;offset&gt;**&

Skips offsets (&lt;offset&gt;) in the field value (character fields only). If the offset is greater than the length of the value, nothing is displayed.

&field(**&lt;length&gt;**)&

Sets the output length to &lt;length&gt;.

&field(\*)&

If the field is defined by a Data Dictionary type, Smart Forms sets the output length to the value specified there.

&field(S)&

Suppresses the sign

&field(&lt;)&

Displays the sign to the left of the number

&field(.**&lt;nat.number&gt;**)&

Limits output of decimal places to &lt;nat.number&gt;

&field(E**&lt;nat.number&gt;**)&

Displays the field value with the fixed exponent &lt;nat.number&gt;. The mantissa is adapted to this exponent by shifting the decimal character and inserting zeros.

&field(T)&

Suppresses thousand indicators when displaying fields of types **DEC**, **CURR**, **INT**, and**QUAN**.

&field(Z)&

Suppresses leading zeros in numbers

&field(I)&

Suppresses display of initial values

&field(K)&

Deactivates a conversion routine specified in the Data Dictionary

&field(R)&

Right-justified display. Use this option only when specifying an output length as well.

&field(F**&lt;filler&gt;**)&

Replaces left-justified blanks in the value by the fill character &lt;filler&gt;.

&field(L)&

Converts a date field to a local date and displays it. The date is then formatted using the edit mask **JPDAT**.

Since this representation uses Japanese characters, it is only to be used in the Japanese version of the SAP System.

&field(C)&

The system takes the field value as a sequence of words separated by blanks. Option C shifts these words to the left and leaves one blank in-between as a separator. Any leading blanks are omitted. This effect corresponds to that of the ABAP statement**CONDENSE.**

 

 

 Case:

保留三位小数，需要&GV\_MENGE\_ZH(.3)&。然后同时取消该字段的参考，如下图：

![](http://dl2.iteye.com/upload/attachment/0097/1066/fcd697cf-961d-3f5a-afbc-14fc2c255ed2.jpg)