使用SMARTFORM字段参数设置解决SMARTFORM中数量、金额字段显示问题
在SMARTFORM中,數(shù)量和金額類型的字段在顯示的時候會和其他字段不在同一個水平面上,解決的方法:&ITAB-MENGE(C)&? ,下面是SMARTFORM字段參數(shù)設(shè)置的幾個注意事項:
1、使用SFSY-FORMPAGES顯示總頁數(shù)的時候,如果頁數(shù)大于9,,將會在前10頁顯示成星號。解決辦法:可以添加3ZC,&SFSY-PAGE(3ZC)&/&SFSY-FORMPAGES(3ZC)&,不過可能會出現(xiàn)字體顛倒或者重疊的現(xiàn)象,用一個單獨的窗口來存放顯示頁碼的文本,并且把窗口的類型設(shè)置為L(最終窗口)就OK了。
?2、如果金額或者數(shù)量字段顯示不出來的話,可以在“貨幣/數(shù)量字段”標(biāo)簽中指定相應(yīng)的數(shù)據(jù)類型。
?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、輸出格式設(shè)置說明
Syntax???????????????? 說明?
&field+&?????????????? 對于字符變量設(shè)置從何位置顯示數(shù)據(jù),如果offset大于字符變量長度時,系統(tǒng)就不會顯示任何數(shù)據(jù)?
&field()&?????????????? 設(shè)置輸出長度.?
&field(*)&????????????? 如果該字段類型是abap數(shù)據(jù)字典里定義的類型,系統(tǒng)將按照字典定義的長度設(shè)置輸出長度?
&field(S)&???????????? 禁止輸出符號位?
&field(<)&???????????? 符號位顯示在數(shù)據(jù)的左邊?
&field(.)&????????????? 設(shè)置顯示小數(shù)的位數(shù)?
&field(E)&???????????? 設(shè)置為科學(xué)標(biāo)示法?
&field(T)&????????????? 禁止千分位的顯示(適用于: DEC, CURR, INT和QUAN幾種數(shù)據(jù)類型).?
&field(Z)&????????????? 禁止數(shù)字前導(dǎo)0的顯示?
&field(I)&?????????????? 禁止顯示空值?
&field(K)&???????????? 禁止類型系統(tǒng)按數(shù)據(jù)字典定義的轉(zhuǎn)換函數(shù)進(jìn)行輸出轉(zhuǎn)換?
&field(R)&???????????? 右對齊(只有在定義了輸出長度時才有效)?
&field(F)&????????????? 用指定的字符替換左邊的空格.?
&field(L)&????????????? 將日期轉(zhuǎn)換為本地顯示格式,使用JDAT指定的格式?
&field(C)&???????????? 該設(shè)置效果和ABAP的CONDENSE語句相同.
?
5、Smartform 打印條形碼
先在SE73里定義一個新的BARCODE,注意一定要用新的才可以,舊的是打印不出來的。然后定義一個SMARTFORM的樣式,把你定義的BARCODE放到字符樣式里面去。再做SMARTFORM就可以了,將需要作為條碼的變量的格式選為該BARCODE格式,輸出時會根據(jù)變量不同的數(shù)據(jù)(如物料,批次)得到相應(yīng)的條碼。
(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、調(diào)試
?? 如果在SMARTFORM中添加了代碼,編輯器是不允許設(shè)置斷點的。
一種方法就是,在代碼中加入斷點語句break-point,缺點是,每想設(shè)一個斷點,就需要寫一條斷點語句。
另一種方法是,自己加的代碼都會自帶出一個名字的比如‘%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最有用的,雙擊進(jìn)入,找到 FORM %GLOBAL_INIT。
總結(jié)
以上是生活随笔為你收集整理的使用SMARTFORM字段参数设置解决SMARTFORM中数量、金额字段显示问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 反查BOM, 找出它的上阶
- 下一篇: sap abap 对字符串的操作