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

原来为了你

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

 
 
 

日志

 
 
 
 

[转]一只可以修改任意程序(包括SAP标准程序)的程序  

2011-11-15 16:32:32|  分类: ABAP基础知识 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

这个程序 使用起来一定要格外小心,他可以把SAP的标准程序都改掉而且不需要ACCESS KEY.
我特别喜欢这个万用程序。在PRODUCTION 环境中是禁制修改或是开发新程序的。这只程序只要偷偷上到 PRODUCTION...内行的就知道是多麽POWERFUL 。等於帮你开了一个康庄大道....

report z_prog_modify no standard page heading
                  
message-id ypp.

data code(72occurs 10.

selection-screen begin of line.
selection-screen comment 1(36t001.
parametersp_file1 like ibipparms-path.
selection-screen end of line.


selection-screen begin of line.
selection-screen comment 1(36t003.
parametersprogram like tstc-pgmna.
selection-screen end of line.

selection-screen skip.
selection-screen begin of line.
parametersp_chk1 as checkbox.
selection-screen comment 4(60t002.
selection-screen end of line.

selection-screen skip.
selection-screen comment /1(72a001.
selection-screen comment /1(72a002.
selection-screen comment /1(72a003.
selection-screen comment /1(72a004.


tablestrdir.
data itrdir like trdir.
data rc like sy-subrc.

initialization.
  t001 
'Select the upload program text file'.
  t002 
'Do you want to exectue the program directly?'.
  t003 
'Program name to be replaced/created'.
  a001 
'Be Careful'.
  a002 
'The program could be modify directly without warning'.
  a003 
'You can create the program even in the production environment'.
  a004 
'Take care the SAP program can also be modified'.

*----------------------------------------------------------------------
at selection-screen on value-request for p_file1.
*----------------------------------------------------------------------
  
call function 'F4_FILENAME'
    
importing
      file_name 
p_file1.

start
-of-selection.
  
select single from trdir where name program.
  
move-corresponding trdir to itrdir.
  rc 
sy-subrc.

  
read report program into code.

  
refresh code.
  
clear code.

  
call function 'WS_UPLOAD'
    
exporting
      filename                
p_file1
      filetype                
'ASC'
    
tables
      data_tab                
code
    
exceptions
      file_open_error         
1
      file_read_error         
2
      no_batch                
3
      gui_refuse_filetransfer 
4
      invalid_type            
5
      
others                  6.

  
if sy-subrc <> 0.
    
message e000 with 'Error uploading file'.
  
endif.

  
check program(1) = 'Y' or program(1) = 'Z'."安全限制:否则容易修改标准程序,那将会是一件很危险的事情!
  
insert report program from code.

  
if sy-subrc <> 0.
    
message e000 with 'Insert program error!'.
  
endif.

  
if not p_chk1 is initial.
    
submit (programvia selection-screen and return.
  
endif.

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

历史上的今天

评论

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

页脚

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