登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

原来为了你

我的人生就是要一次次的超越

 
 
 

日志

 
 
 
 

ALV 设置输出小数位数  

2011-08-24 15:54:40|  分类: ALV |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

report ztest_alv.

typesbegin of typ_alv,
  zsel
(1),
  field_1
(10type c,
  field_2 
type i,
  field_3 
type ekpo-menge,
  
end of typ_alv.
dataitab type table of typ_alv,
      wa 
type typ_alv.

type-poolsslis.
datait_field  type slis_t_fieldcat_alv,
      wa_field  
like line of it_field,
      gs_layout 
type slis_layout_alv.

define m_alv_fieldcat.
  wa_field
-fieldname &1.
  wa_field
-reptext_ddic &2.
  wa_field
-decimals_out 4.      "设置小数位数
  
append wa_field to it_field.
  
clear wa_field.
end-of-definition.

wa
-field_1 'aaa'.
wa
-field_2 1.
wa
-field_3 '100.001'.
append wa to itab.

wa
-field_1 'bbb'.
wa
-field_2 2.
wa
-field_3 '200.002'.
append wa to itab.

wa
-field_1 'ccc'.
wa
-field_2 3.
wa
-field_3 '300.003'.
append wa to itab.

m_alv_fieldcat 
'FIELD_1' '字段1' .
m_alv_fieldcat 
'FIELD_2' '字段2' .
m_alv_fieldcat 
'FIELD_3' '字段3' .

*---设置输出格式
gs_layout
-zebra 'X'.
gs_layout
-colwidth_optimize 'X'.
gs_layout
-box_fieldname 'ZSEL'.

*---输出
call function 'REUSE_ALV_GRID_DISPLAY'
  
exporting
    i_callback_program 
sy-repid
    it_fieldcat        
it_field
    is_layout          
gs_layout
    i_default          
'X'
    i_save             
'A'
  
tables
    t_outtab           
itab.

  评论这张
 
阅读(1044)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018