可以修改任意程序(包括SAP标准程序)的程序

这个程序   使用起来一定要格外小心,他可以把 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.
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值