当前位置:首页>开发知识>ABAP开发>Form打印>[Smart] 使用SMARTFORM字段参数设置解决SMARTFORM中数量、金额字段显示问题

[Smart] 使用SMARTFORM字段参数设置解决SMARTFORM中数量、金额字段显示问题

在SMARTFORM中,数量和金额类型的字段在显示的时候会和其他字段不在同一个水平面上,解决的方法:&ITAB-MENGE(C)&  ,下面是SMARTFORM字段参数设置的几个注意事项:

1、使用SFSY-FORMPAGES显示总页数的时候,如果页数大于9,,将会在前10页显示成星号。解决办法:可以添加3ZC,&SFSY-PAGE(3ZC)&/&SFSY-FORMPAGES(3ZC)&,不过可能会出现字体颠倒或者重叠的现象,用一个单独的窗口来存放显示页码的文本,并且把窗口的类型设置为L(最终窗口)就OK了。

 2、如果金额或者数量字段显示不出来的话,可以在“货币/数量字段”标签中指定相应的数据类型。

 3、Field not outputting more than 255 characters in a loop. This is happening because when you send a string to smartform with length >255 characters then it takes only first 255 characters. I overcomed this problem by splitting the string which was of around 500 char into two and then sending it to smartform as individual vairables and displaying the two variables one after the other in the smartform.

将文本字段拆分成几个字符变量再连接在一起显示。

 

4、输出格式设置说明

Syntax                 说明

&field+&               对于字符变量设置从何位置显示数据,如果offset大于字符变量长度时,系统就不会显示任何数据

&field()&               设置输出长度.

&field(*)&              如果该字段类型是abap数据字典里定义的类型,系统将按照字典定义的长度设置输出长度

&field(S)&             禁止输出符号位

&field(<)&             符号位显示在数据的左边

&field(.)&              设置显示小数的位数

&field(E)&             设置为科学标示法

&field(T)&              禁止千分位的显示(适用于: DEC, CURR, INT和QUAN几种数据类型).

&field(Z)&              禁止数字前导0的显示

&field(I)&               禁止显示空值

&field(K)&             禁止类型系统按数据字典定义的转换函数进行输出转换

&field(R)&             右对齐(只有在定义了输出长度时才有效)

&field(F)&              用指定的字符替换左边的空格.

&field(L)&              将日期转换为本地显示格式,使用JDAT指定的格式

&field(C)&             该设置效果和ABAP的CONDENSE语句相同.

 

5、Smartform 打印条形码

先在SE73里定义一个新的BARCODE,注意一定要用新的才可以,旧的是打印不出来的。然后定义一个SMARTFORM的样式,把你定义的BARCODE放到字符样式里面去。再做SMARTFORM就可以了,将需要作为条码的变量的格式选为该BARCODE格式,输出时会根据变量不同的数据(如物料,批次)得到相应的条码。

(1).In the transaction se73 , choose a barcode font that suits your

requirements (do this by checking the system barcodes radio button)

(2).Click on the Printer barcodes radiobutton and make sure that the

barcode you chose in step 1 exists for the device type of your

printer.

If you need to create a new barcode font , create it in step1 , and

enterthe hex barcode prefix and suffix ( can be obtained from your

printer manual) , then in step 2 , define a new z_ device type as a

copy of the device type of your printer and assign the system barcode

to the printer.

(3). in your layout set , define a character string with the barcode

font chosen above in the Bar code field .

Format the string that you want to print as a barcode using this

character string.

 

6、调试

   如果在SMARTFORM中添加了代码,编辑器是不允许设置断点的。

一种方法就是,在代码中加入断点语句break-point,缺点是,每想设一个断点,就需要写一条断点语句。

另一种方法是,自己加的代码都会自带出一个名字的比如‘%CO1’。

Environment -> Function Module Name,

he function that generated for this smartforms is ‘/1BCDWB/SF00000227’(自动生成的SMARTFORM程序名)

T-code se37 -> /1BCDWB/SF00000227 -> Goto -> Main Program

最后一个INCLUDE是对DEBUG最有用的,双击进入,找到 FORM %GLOBAL_INIT。

给TA打赏
共{{data.count}}人
人已打赏
Form打印

[Smart] SAP下载SE78的图片

2022-11-21 16:44:06

Form打印

[Smart] 条形码打印多出来一个字母,如何去掉

2022-11-21 16:49:20

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索