ABAP-用Shift去掉字符串的前导'0'


SHIFT str LEFT DELETING LEADING '0'.
如果要在layout显示不出前面的0 格式: &字段(zc)&
如果要在layout显示不出小数点后面的0 格式:   &字段(.0)&
关于shift
1.Shift a structure by a given number of postions
SHIFT <c> [BY <n> PLACES] [<mode>].
This statement shifts the field <c> by <n> positions. If you omit BY <n> PLACES, <n> is
interpreted as one. If <n> is 0 or negative, <c> remains unchanged. If <n> exceeds the length
<c>, <c> is padded with blanks. <n> can be variable.
With the different (<mode>) options, you can shift the field <c> in the following ways:
· LEFT:
Shift <n> positions to the left and pad with <n> blanks on the right (default setting).
· RIGHT:
Shift <n> positions to the right and pad with <n> spaces on the left.
· CIRCULAR:
Shift <n> positions to the left so that <n> characters on the left appear on the right.
2.Shift a structure up to a given string
To shift field contents up to a given string, use the SHIFT statement as follows
Syntax
SHIFT <c> UP TO <str> <mode>.
ABAP searches the field contents of <c> until it finds the string <str> and shifts the field <c> up to
the field margin. The (<mode>) options are the same as described in the section Shifting a
Structure by a Given Number of Positions [Page 201]. <str> can be a variable.
If <str> is not found in <c>, SY-SUBRC is set to 4 and <c> is not shifted. Otherwise, SY-SUBRC is set to 0.
3.Shifting a structure according to the first or last character
You can use the SHIFT statement to shift a field to the left or to the right, provided the first or last
character satisfies a certain condition. To do this, use the following 
syntax:
SHIFT <c> LEFT DELETING LEADING <str>.
SHIFT <c> RIGHT DELETING TRAILING <str>.






ABAP用移位去掉字符串的前导'0'(转)
SHIFT STR左删除领先'0'。
如果要在布局显示不出前面的0格式:&字段(ZC)
如果要在布局显示不出小数点后面的0格式:&字段(0.0)
关于转变
由给定数目的志愿服务岗位1.Shift的结构
SHIFT<C>[BY<N>旅游][<MODE>]。
这条语句转移的字段<c>由<N>位置。如果省略按<N>的地方,<n>是
解释为一体。如果<n>是0或负数,<C>保持不变。如果<N>的长度超过
<C>,<C>用空格填充。可以是可变<N>。
不同(<MODE>)选项,你可以转移字段<c>以下方式:
·左:
移位<N>位置的左侧和右侧(默认设置<N>空白垫)。
·正确的:
移位<N>位置的权利和垫与在左边的<N>空间。
·通告:
移位<N>位置左侧,以使在左边的<N>字符会出现在右边。
2.Shift到一个给定的字符串的结构
字段内容转移到一个给定的字符串,如下表使用SHIFT
句法
SHIFT的<c> UP TO<str><MODE>。
ABAP搜索领域的内容,直到它找到的<c>字符串<str>和移动字段<c>
农田边界。一节中所描述的一样移一个选项(<MODE>)
按给定的位置数[201]的结构。 <str>可以是一个变量。
如果被发现,但在<C><str>,则将SY-SUBRC设置为4不移位的<c>。否则,则将SY-SUBRC设置为0。
3.Shifting根据第一个或最后一个字符的结构
您可以使用SHIFT语句的左侧或右侧,提供了第一个或最后一个领域转移
字符满足目标条件。要做到这一点,请使用以下
语法:
SHIFT<C>左删除领先<str>的。
SHIFT的<c> RIGHT删除尾随<str>,。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值