在Form中显示条形码,很常见的需求。
Adobe Form生成条形码
一、介绍
在Form中显示条形码,很常见的需求。
二、功能实现
1.Interface
(1)创建对象
使用事物代码 SFP 打开Form的维护界面。填入Interface的名称与描述等信息创建对象。

(2)创建输入参数
为Interface添加一个用于生成条形码的输入参数。
1 | IV_AUFNR TYPE AUFNR |

完成之后保存并激活Interface对象。
2.Adobe Form
(1)创建Form
回到刚才的创建界面或使用事物代码 SFP 填入Form的名称,然后点击创建按钮,新建Form对象。

(2)导入参数
将从Interface导入的输入参数拖动到Context列表中。

(3)设置Layout
打开Layout页签,将Data View页签下的输入参数拖动到Form中进行展示。

(4)打开Toolbar
在右侧如果找不到一个名为Object Library的标签选项,按照 Palettes -> Object Library打开该页签。

(5)条形码列表
使用上面的方式打开对应的内容后,展开Barcodes页签,可以在其中看到很多不同的条形码类型。根据项目的需求选择合适的条形码类型进行开发即可。

(6)添加条形码
本次练习使用Code 128C对象作为练习对象。从列表中拖动该类型的条形码到Form中。然后适当的调整他的展示位置与大小信息。

(7)绑定条形码值
选中条形码,转到Object —> Binding页签下,将数据与输入参数的IV_AUFNR变量进行绑定。

完成这些操作之后保存并激活该Form对象。
三、Form测试
1.直接执行
激活完成Form对象之后,点击运行按钮,传入一个编号值。


2.执行结果

可以使用手机或其他扫码设备,查看条形码的内容。
四、参考资料
SAP Adobe Form Tutorial. Part XIV. How to Generate Barcode in Adobe