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

原来为了你

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

 
 
 

日志

 
 
 
 

Smartform调用模板  

2011-01-07 14:55:32|  分类: smartform |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

data fm_name type rs38l_fnam.  "表格对应函数名称

call function 'SSF_FUNCTION_MODULE_NAME'
  
exporting
    formname           
'ZSMARTFORM_001'  "自定义的smart forms
  
importing
    fm_name            
fm_name
  
exceptions
    no_form            
1
    no_function_module 
2
    
others             3.

call function fm_name
  
exporting
    im_rowsbypage 
10        "exporting后面的参数都是在form中导入参数中定义的,需要在这里导入.定义为每页10行数据.
  
tables
    it_sflight    
it_sflight.


*---Smartformcontrol_parameters的用法:
对于下面的form不多说,它是alvi_callback_user_command  'USER_COMMAND' 的实现:

form user_command   using     rf_ucomm  like sy-ucomm
                              rs        
type slis_selfield.
data fm_name type rs38l_fnam.
datalc_control_parameters type ssfctrlop.

lc_control_parameters
-no_dialog 'X'.
"lc_control_parameters-preview = 'X'.
lc_control_parameters
-no_open 'X'.
lc_control_parameters
-no_close 'X'.

case rf_ucomm.
  
when '&PREVIEW'."打印预览(wa)
    lc_control_parameters
-no_dialog 'X'.
    lc_control_parameters
-no_open 'X'.
    lc_control_parameters
-no_close 'X'.
    lc_control_parameters
-preview 'X'.
*---取得Formd对应函数
    
call function 'SSF_FUNCTION_MODULE_NAME'
      
exporting
        formname           
'ZFIR006'
      
importing
        fm_name            
fm_name
      
exceptions
        no_form            
1
        no_function_module 
2
        
others             3.
*---Open
    
call function 'SSF_OPEN'
      
exporting
        control_parameters 
lc_control_parameters
      
exceptions
        formatting_error   
1
        internal_error     
2
        send_error         
3
        user_canceled      
4
        
others             5.
*---Call Function
    
loop at gt_print into wa_print.
      
call function fm_name
        
exporting
          p_print            
wa_print
          control_parameters 
lc_control_parameters.
    
endloop.
*---Close
    
call function 'SSF_CLOSE'
      
exceptions
        formatting_error 
1
        internal_error   
2
        send_error       
3
        
others           4.
  
when '&PRT'打印
    lc_control_parameters
-preview ''.
*---取得Formd对应函数
    
call function 'SSF_FUNCTION_MODULE_NAME'
      
exporting
        formname           
'ZFIR006'
      
importing
        fm_name            
fm_name
      
exceptions
        no_form            
1
        no_function_module 
2
        
others             3.
*---Open
    
call function 'SSF_OPEN'
      
exporting
        control_parameters 
lc_control_parameters
      
exceptions
        formatting_error   
1
        internal_error     
2
        send_error         
3
        user_canceled      
4
        
others             5.
*---Call Function
    
loop at gt_print into wa_print.
      
call function fm_name
        
exporting
          p_print            
wa_print
          control_parameters 
lc_control_parameters.
    
endloop.
*---Close
    
call function 'SSF_CLOSE'
      
exceptions
        formatting_error 
1
        internal_error   
2
        send_error       
3
        
others           4.
endcase.
endform.                    "user_command

*---内表数据传递:
datafield(50).
field-symbols<fs> type any.
field '(ZSD_R_001)GT_HEAD[]'.
assign (fieldto <fs>.
ig_header[] 
<fs>

注意:
call function lf_fm_name
  
exporting
    control_parameters 
lc_control_parameters
  
exceptions
    formatting_error   
1
    internal_error     
2
    send_error         
3
    user_canceled      
4          "加上用户取消异常,可以处理用户取消操作
    
others             5

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

历史上的今天

评论

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

页脚

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