生成Solution Manager Key 的 ABAP 程序_第1页
生成Solution Manager Key 的 ABAP 程序_第2页
生成Solution Manager Key 的 ABAP 程序_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、*&-* *& Report Z_SLK_YC *& *&-* *& *& *&-* REPORT Z_SLK_YC. types: begin of dswpclientkey, INSTNO type num10, DBID(3, BUNDLE_ID(8, SERVICE_KEY(40, end of dswpclientkey. *data: dswpclientkey_w type standard table of dswpclientkey. DATA: P_VALUE(10, P_INSTNO(10. PARAMETERS:

2、 P_SID(3, P_SYSNO(2, P_SERVER(15. START-OF-SELECTION. PERFORM GET_SP_VALUE USING P_SID P_SYSNO P_SERVER P_INSTNO CHANGING P_VALUE. END-OF-SELECTION. WRITE P_VALUE. *&-* *& Form get_sp_value *&-* * text *-* * ->P_PF_SID text * ->P_PF_SYSNO text * ->P_PF_SERVER text * <-P_PF_VA

3、LUE text *-* FORM get_sp_value USING P_PF_SID P_PF_SYSNO P_PF_SERVER P_PF_INSTNO CHANGING P_PF_VALUE. CONSTANTS: lc_part_len TYPE i VALUE 5, lc_pw_len TYPE i VALUE 10, lc_allowed_chars(38 TYPE c VALUE '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_'. data: lf_string(20 type c, lf_key type i, ls_key

4、type dswpclientkey, lf_part(lc_part_len type c, lf_finalf(lc_pw_len type c, lf_finalx type xstring, lf_xbuffer type xstring, lf_opf(10 type c, lf_langu like sy-langu, lf_subrc like sy-subrc, lf_len type i, lo_conv_to_x TYPE REF TO cl_abap_conv_out_ce. clear: lf_string, lf_finalx, lf_opf. concatenate

5、 p_pf_sid p_pf_sysno p_pf_server into lf_string. * Large letters only translate lf_string to upper case. lf_langu = sy-langu. SET LOCALE LANGUAGE 'E'. lo_conv_to_x = cl_abap_conv_out_ce=>create( encoding = '1100' . lf_len = STRLEN( lf_string . IF lf_string(lf_len CN lc_allowed_cha

6、rs. else. * Fold the input string to a lc_part_len long string WHILE lf_len > 0. lf_part = lf_string(lc_part_len. SHIFT lf_string BY lc_part_len PLACES. lf_len = STRLEN( lf_string . CALL METHOD lo_conv_to_x->reset. CALL METHOD lo_conv_to_x->write( data = lf_part n = -1 . lf_xbuffer = lo_con

7、v_to_x->get_buffer( . lf_finalx = lf_finalx BIT-XOR lf_xbuffer. ENDWHILE. lf_key = 12. PERFORM scramble USING lf_finalx lf_key lc_part_len CHANGING lf_finalf lf_subrc. if not lf_finalf is initial. p_pf_value = lf_finalf. ls_key-dbid = p_pf_sid. ls_key-instno = p_pf_instno. ls_key-bundle_id = '

8、;SM_KEY'. ls_key-service_key = lf_finalf. if not p_pf_instno is initial. * insert dswpclientkey_w from ls_key. if sy-subrc <> 0. * update dswpclientkey_w from ls_key. endif. endif. else. clear p_pf_value. endif. endif. ENDFORM. " get_sp_value *&-* *& Form scramble *&-* * t

9、ext *-* * ->P_LF_FINALX text * ->P_LF_KEY text * ->P_LC_PART_LEN text * <-P_LF_finalf text * <-P_LF_SUBRC text *-* FORM scramble USING iv_xstring TYPE xstring iv_key TYPE i iv_src_len TYPE i CHANGING lf_finalf lf_subrc LIKE sy-subrc. CONSTANTS: lc_max_len TYPE i VALUE 20, lc_mask(4 TY

10、PE x VALUE '0000003F', lc_random(64 TYPE x VALUE 'F0ED53B83244F1F876C67959FD4F13A2' & 'C15195EC5483C234774943A27DE26596' & '5E5398789A17A33CD383A8B829FBDCA5' & '55D702778413ACDDF9B83116610E6DFA'. DATA: lv_key_index(4 TYPE x, lv_rand_index(4 TYPE x,

11、 lv_xkey(4 TYPE x, lv_xkey_shl_1(4 TYPE x, lv_xkey_shr_5(4 TYPE x, lv_scramble_byte TYPE x, lv_dest(lc_max_len TYPE x, lv_index TYPE i, lv_len TYPE i. CLEAR lf_subrc. IF iv_src_len EQ 0. EXIT. ENDIF. lv_len = XSTRLEN( iv_xstring . IF iv_src_len GT lc_max_len OR iv_src_len GT lv_len. lf_subrc = 2. EX

12、IT. ENDIF. lv_xkey = iv_key. lv_xkey_shl_1 = iv_key * 2. lv_xkey_shr_5 = iv_key DIV 32. lv_rand_index = lv_xkey BIT-XOR lv_xkey_shr_5 BIT-XOR lv_xkey_shl_1. lv_rand_index = lv_rand_index BIT-AND lc_mask. lv_index = 0. DO iv_src_len TIMES. CATCH SYSTEM-EXCEPTIONS compute_int_times_overflow = 1. lv_key_index = ( iv_key * lv_index * lv_index - lv_index. ENDCATCH. IF sy-subrc <> 0. lf_subrc = 1. EXIT. ENDIF. lv_scramble_byte = lc_random+lv_rand_index(1 BIT-XOR lv_key_index+3(1. lv_dest+lv_index(1 = iv_xstring+lv_index(1 BIT-XOR lv_scramble_byte. lv_index = lv_index + 1. lv_rand_index = lv_r

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论