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。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章