태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

2014.03.25 09:44

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

ERP_Work/ABAP2012.07.05 16:07

유니코드 Byte 변환


FUNCTION YFRANK_CONV_HANGUL_LEN .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(TEXT)
*"     VALUE(LEN) TYPE  I
*"  EXPORTING
*"     VALUE(OUT_TEXT)
*"     VALUE(OUT_LEN) TYPE  I
*"----------------------------------------------------------------------
  DATA : LV_TELEN TYPE I,
         LV_V_LEN TYPE I.

  CALL METHOD CL_ABAP_LIST_UTILITIES=>DYNAMIC_OUTPUT_LENGTH
    EXPORTING
      FIELD TEXT
    RECEIVING
      LEN   LV_TELEN.
  IF LV_TELEN > LEN.
    LV_TELEN LEN.
  ENDIF.

  OUT_LEN LV_TELEN / 2 .
  DO LEN TIMES.
    IF OUT_LEN >= LV_TELEN.
      EXIT.
    ENDIF.
    OUT_LEN OUT_LEN + 1.
    OUT_TEXT TEXT(OUT_LEN).
    CALL METHOD CL_ABAP_LIST_UTILITIES=>DYNAMIC_OUTPUT_LENGTH
      EXPORTING
        FIELD OUT_TEXT
      RECEIVING
        LEN   LV_V_LEN.
    IF LV_V_LEN >= LEN.
      IF LV_V_LEN > LEN.
        OUT_LEN OUT_LEN 1.
        OUT_TEXT TEXT(OUT_LEN).
      ENDIF.
      EXIT.
    ENDIF.
  ENDDO.

ENDFUNCTION.

Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2011.08.03 07:56
saplogon.ini 은 PC를 포멧시 백업을 받아 해당 디렉토리로 복사를 하면 쉽게 SAP을 설정할 수 있다.

SAPgui 720 이후 디렉토리

C:\Documents and Settings\"윈도우즈사용자ID"\Application Data\SAP\Common


SAPgui 720 이전 디렉토리
C:\WINDOWS\
Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2011.08.03 07:50

SAP Gui 바로가기의 패스워드를 입력가능하게 하게 하는 레지스트리
버젼별로 디렉토리가 상이 하다.

EnablePassword.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend Server\Security]
"EnablePassword"="1"
[HKEY_CURRENT_USER\Software\SAP\SAPShortcut]
[HKEY_CURRENT_USER\Software\SAP\SAPShortcut\Security]
"EnablePassword"="1"
 

Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2010.08.26 10:26
 

FUNCTION CONVERSION_EXIT_ZTELN_INPUT.

*"----------------------------------------------------------------------

*"*"Local interface:

*"  IMPORTING

*"     VALUE(INPUT) TYPE  CLIKE

*"  EXPORTING

*"     VALUE(OUTPUT) TYPE  CLIKE

*"----------------------------------------------------------------------

* 20100826 : Make by Franklee

*"----------------------------------------------------------------------

 

  OUTPUT = INPUT.

 

  REPLACE ALL OCCURRENCES OF REGEX '\D' IN OUTPUT WITH ''.

 

ENDFUNCTION.

 

FUNCTION CONVERSION_EXIT_ZTELN_OUTPUT.

*"----------------------------------------------------------------------

*"*"Local interface:

*"  IMPORTING

*"     VALUE(INPUT) TYPE  CLIKE

*"  EXPORTING

*"     VALUE(OUTPUT) TYPE  CLIKE

*"----------------------------------------------------------------------

* 20100826 : Make by Franklee

*"----------------------------------------------------------------------

  DATA: LV_LENGTH TYPE I.

*번호 용도

*001 ~ 009 국제전화

*010 ~ 019 무선전화, 무선호출, 부가통신망

*020, …, 090 공통 서비스 (개인번호 등)

*02x ~ 06x 지역번호

*071 ~ 079 (예비)

*081 ~ 089 시외전화

*091 ~ 099 (예비)

*100 ~ 109 사업자의 민원 및 통신업무

*110 ~ 129 긴급 민원사항

*1300 ~ 1399 생활정보 등

*1400 ~ 1499 (예비; 부가서비스 용도)

*1500 ~ 1599 사업자 자율 부가서비스

*1600 ~ 1699 공통 부가서비스

*1700 ~ 1999 (예비; 일부 사용되고 있음)

  OUTPUT = INPUT.

  REPLACE ALL OCCURRENCES OF REGEX '\D' IN OUTPUT WITH ''.

* 자리수

  LV_LENGTH = STRLEN( OUTPUT ).

  if OUTPUT+0(2) = '00'.

      CONCATENATE OUTPUT+0(3) OUTPUT+3

             INTO OUTPUT SEPARATED BY ')'.

  else.

    IF LV_LENGTH = 11.

      CONCATENATE OUTPUT+0(3) OUTPUT+3(4) OUTPUT+7(4)

             INTO OUTPUT SEPARATED BY '-'.

    ELSEIF LV_LENGTH = 10.

      CONCATENATE OUTPUT+0(3) OUTPUT+3(3) OUTPUT+6(4)

             INTO OUTPUT SEPARATED BY '-'.

    ELSEIF LV_LENGTH = 9.

      CONCATENATE OUTPUT+0(2) OUTPUT+2(3) OUTPUT+5(4)

             INTO OUTPUT SEPARATED BY '-'.

    ELSEIF LV_LENGTH = 8.

      CONCATENATE OUTPUT+0(4) OUTPUT+4(4)

             INTO OUTPUT SEPARATED BY '-'.

    ENDIF.

  endif.

 

ENDFUNCTION.

 


Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2010.08.09 14:31


FUNCTION Z_CALC_VAT.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(BIAMT) OPTIONAL
*"     REFERENCE(MWSKZ) LIKE  T007A-MWSKZ
*"  EXPORTING
*"     VALUE(KBETR) LIKE  KONP-KBETR
*"     VALUE(BITAX)
*"     VALUE(BITOT)
*"----------------------------------------------------------------------
* Make by Franklee
*"----------------------------------------------------------------------
  DATA : LS_A003 LIKE A003,
         LS_KONP LIKE KONP.

  CLEAR : KBETR, BITAX, BITOT.
  CLEAR : LS_A003, LS_KONP.

  LS_A003-MWSKZ = MWSKZ.

  SELECT SINGLE * INTO LS_A003
    FROM A003
   WHERE KAPPL EQ 'TX'
     AND ALAND EQ 'KR'
     AND MWSKZ EQ LS_A003-MWSKZ.
  CHECK SY-SUBRC = 0.

  SELECT SINGLE * INTO LS_KONP
    FROM KONP
   WHERE KNUMH EQ LS_A003-KNUMH
     AND LOEVM_KO EQ ''.
  CHECK SY-SUBRC = 0.

  KBETR = LS_KONP-KBETR / 1000.
  BITAX = KBETR * BIAMT.
  BITOT = BIAMT + BITAX.

ENDFUNCTION.

'ERP_Work > ABAP' 카테고리의 다른 글

SAP Shotcut EnablePassword  (0) 2011.08.03
전화번호 Conversion Exit  (0) 2010.08.26
공급가액에 따른 부가세 자동계산 (KR)  (0) 2010.08.09
주민등록번호 외국인등록번호 Check 프로그램  (0) 2009.03.20
임시전표 Table에 대한 고찰  (0) 2009.03.09
FIEB_PASSWORD  (0) 2009.02.27
Posted by 프랭크리
TAG ABAP, SAP, VAT

댓글을 달아 주세요

ERP_Work/ABAP2009.03.20 16:12

FUNCTION YFRANK_CHECK_SOCIAL_NUMBER.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(SOCIAL_NUMBER)
*"     VALUE(LAND1) TYPE  LAND1 DEFAULT 'KR'
*"  EXCEPTIONS
*"      INVALID_NUMBER
*"      INVALID_BIRTH_DAY
*"----------------------------------------------------------------------
*" Make by Franklee
*"----------------------------------------------------------------------

  DATA: LV_LENGTH TYPE I,
        LV_BIRTH_DAY TYPE CHAR8,
        LV_PARITY TYPE I.
  IF LAND1 = 'KR'.
    REPLACE ALL OCCURRENCES OF '-' IN SOCIAL_NUMBER WITH ''.
* 자리수 체크
    LV_LENGTH = STRLEN( SOCIAL_NUMBER ).
    IF LV_LENGTH <> 13.
      RAISE INVALID_NUMBER.
    ENDIF.
* 숫자 체크
    IF SOCIAL_NUMBER CN '0123456789 '.
      RAISE INVALID_NUMBER.
    ENDIF.
    CASE SOCIAL_NUMBER+6(1).
      WHEN '1' OR '2'  "1900년대 내국인
        OR '5' OR '6'. "1900년대 외국인
        CONCATENATE '19' SOCIAL_NUMBER+0(6) INTO LV_BIRTH_DAY.
      WHEN '3' OR '4'  "2000년대 내국인
        OR '7' OR '8'. "2000년대 외국인
        CONCATENATE '20' SOCIAL_NUMBER+0(6) INTO LV_BIRTH_DAY.
      WHEN '9' OR '0'. "1800년대 내국인
        CONCATENATE '18' SOCIAL_NUMBER+0(6) INTO LV_BIRTH_DAY.
      WHEN OTHERS.
        RAISE INVALID_BIRTH_DAY.
    ENDCASE.
*날짜 check
    CALL FUNCTION 'RP_CHECK_DATE'
      EXPORTING
        DATE         = LV_BIRTH_DAY
      EXCEPTIONS
        DATE_INVALID = 1.
    IF SY-SUBRC <> 0.
      RAISE INVALID_BIRTH_DAY.
    ENDIF.
* 페리티 계산
    LV_PARITY = SOCIAL_NUMBER+00(1) * 2
              + SOCIAL_NUMBER+01(1) * 3
              + SOCIAL_NUMBER+02(1) * 4
              + SOCIAL_NUMBER+03(1) * 5
              + SOCIAL_NUMBER+04(1) * 6
              + SOCIAL_NUMBER+05(1) * 7
              + SOCIAL_NUMBER+06(1) * 8
              + SOCIAL_NUMBER+07(1) * 9
              + SOCIAL_NUMBER+08(1) * 2
              + SOCIAL_NUMBER+09(1) * 3
              + SOCIAL_NUMBER+10(1) * 4
              + SOCIAL_NUMBER+11(1) * 5.
    LV_PARITY = LV_PARITY MOD 11.
    LV_PARITY = 11 - LV_PARITY.
    LV_PARITY = LV_PARITY MOD 10.
* 외국인 추가
    CASE SOCIAL_NUMBER+6(1).
      WHEN '5' OR '6'  "1900년대 외국인
        OR '7' OR '8'. "2000년대 외국인
        LV_PARITY = LV_PARITY + 2.
        LV_PARITY = LV_PARITY MOD 10.
    ENDCASE.
* 페리티 체크
    IF LV_PARITY NE SOCIAL_NUMBER+12(1).
      RAISE INVALID_NUMBER.
    ENDIF.
  ENDIF.

ENDFUNCTION.

'ERP_Work > ABAP' 카테고리의 다른 글

SAP Shotcut EnablePassword  (0) 2011.08.03
전화번호 Conversion Exit  (0) 2010.08.26
공급가액에 따른 부가세 자동계산 (KR)  (0) 2010.08.09
주민등록번호 외국인등록번호 Check 프로그램  (0) 2009.03.20
임시전표 Table에 대한 고찰  (0) 2009.03.09
FIEB_PASSWORD  (0) 2009.02.27
Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2009.03.09 11:50

VBSEGA 전표임시저장에 대한 전표세그멘트 - 자산 데

VBSEGD 고객전표임시저장에 대한 전표세그멘트

VBSEGK 구매처전표임시저장에 대한 전표세그멘트

VBSEGS 전표임시저장에 대한 전표세그멘트 - G/L계정

   

   

VBKPF 전표임시저장에 대한 전표헤더

KOARS        KOARS_003 계정 유형 허용

에 최대 5자로 ADKSM 이 들어가게됨

   

5자리 케릭터의 이니셜이 위에 임시전표테이블이며

해당 라인을 읽는다..

   

M의 경우에는 모듈별로 들어가게 되며 VBSEG* 류에는 들어가지 않는다.

   

PRELIMINARY_POSTING_DOC_READ

   

*-----------------------------------------------------------------------

* FORM VBKPF_LESEN

*-----------------------------------------------------------------------

*

*-----------------------------------------------------------------------

form vbkpf_lesen.

refresh: t_vbkpf, xvbkpf1.

* select * from vbkpf into table xvbkpf1 where

* ausbk eq bukrs and

* gjahr eq gjahr and

* belnr eq belnr.

* if sy-subrc ne 0.

* message id 'FP' type 'A' number 045

* with 'VBKPF' bukrs gjahr belnr

* raising document_not_found.

* endif.

* loop at xvbkpf1.

* move-corresponding xvbkpf1 to t_vbkpf.

* append t_vbkpf.

* endloop.

* ----------------------------------------------------------------------

* Replaced for performance reasons: Note 529771

* ----------------------------------------------------------------------

select * from vbkpf into corresponding fields of table t_vbkpf

where ausbk eq bukrs and

gjahr eq gjahr and

belnr eq belnr.

if sy-dbcnt eq 0.

message id 'FP' type 'A' number 045

with 'VBKPF' bukrs gjahr belnr

raising document_not_found.

endif.

* ----------------------------------------------------------------------

loop at t_vbkpf where "Ausgangsbuchungskreis

ausbk eq bukrs and "mu?erster Eintrag sein

bukrs eq bukrs.

if sy-tabix ne 1.

hlp_i = sy-tabix.

delete t_vbkpf index hlp_i.

insert t_vbkpf index 1.

endif.

exit.

endloop.

endform. "vbkpf_lesen

   

*eject

*-----------------------------------------------------------------------

* FORM VBSEG_LESEN

*-----------------------------------------------------------------------

*

*-----------------------------------------------------------------------

form vbseg_lesen.

refresh: t_vbseg, xvbsega1, xvbsegk1, xvbsegs1.

if t_vbkpf-koars ca 'A'.

clear t_vbseg.

* select * from vbsega into table xvbsega1 where

* ausbk eq bukrs and

* gjahr eq gjahr and

* belnr eq belnr.

* if sy-subrc ne 0.

* message id 'FP' type 'A' number 045 with

* 'VBSEGA' bukrs gjahr belnr

* raising document_line_not_found.

* endif.

* loop at xvbsega1.

* move-corresponding xvbsega1 to t_vbseg.

* t_vbseg-koart = 'A'.

* append t_vbseg.

* endloop.

* endif.

* ----------------------------------------------------------------------

* Replaced for performance reasons: Note 529771

* ----------------------------------------------------------------------

select * from vbsega into corresponding fields of table t_vbseg

where ausbk eq bukrs and

gjahr eq gjahr and

belnr eq belnr.

if sy-dbcnt eq 0.

message id 'FP' type 'A' number 045

with 'VBSEGA' bukrs gjahr belnr

raising document_line_not_found.

endif.

t_vbseg-koart = char_a.

modify t_vbseg transporting koart where koart eq space.

endif.

* ----------------------------------------------------------------------

if t_vbkpf-koars ca 'D'.

clear t_vbseg.

* select * from vbsegd into table xvbsegd1 where

* ausbk eq bukrs and

* gjahr eq gjahr and

* belnr eq belnr.

* if sy-subrc ne 0.

* message id 'FP' type 'A' number 045 with

* 'VBSEGD' bukrs gjahr belnr

* raising document_line_not_found.

* endif.

* loop at xvbsegd1.

* move-corresponding xvbsegd1 to t_vbseg.

* t_vbseg-koart = 'D'.

* append t_vbseg.

* endloop.

* endif.

* ----------------------------------------------------------------------

* Replaced for performance reasons: Note 529771

* ----------------------------------------------------------------------

select * from vbsegd appending corresponding fields of table t_vbseg

where ausbk eq bukrs and

gjahr eq gjahr and

belnr eq belnr.

if sy-dbcnt eq 0.

message id 'FP' type 'A' number 045

with 'VBSEGD' bukrs gjahr belnr

raising document_line_not_found.

endif.

   

t_vbseg-koart = char_d.

modify t_vbseg transporting koart where koart eq space.

endif.

* ----------------------------------------------------------------------

if t_vbkpf-koars ca 'K'.

clear t_vbseg.

* select * from vbsegk into table xvbsegk1 where

* ausbk eq bukrs and

* gjahr eq gjahr and

* belnr eq belnr.

* if sy-subrc ne 0.

* message id 'FP' type 'A' number 045 with

* 'VBSEGK' bukrs gjahr belnr

* raising document_line_not_found.

* endif.

* loop at xvbsegk1.

* move-corresponding xvbsegk1 to t_vbseg.

* t_vbseg-koart = 'K'.

* append t_vbseg.

* endloop.

* endif.

* ----------------------------------------------------------------------

* Replaced for performance reasons: Note 529771

* ----------------------------------------------------------------------

select * from vbsegk appending corresponding fields of table t_vbseg

where ausbk eq bukrs and

gjahr eq gjahr and

belnr eq belnr.

if sy-dbcnt eq 0.

message id 'FP' type 'A' number 045

with 'VBSEGK' bukrs gjahr belnr

raising document_line_not_found.

endif.

   

t_vbseg-koart = char_k.

modify t_vbseg transporting koart where koart eq space.

endif.

   

* ----------------------------------------------------------------------

* Following lines of source code haven't been changed by Note 529771 !

* ----------------------------------------------------------------------

if t_vbkpf-koars ca 'S'.

clear t_vbseg.

select * from vbsegs into table xvbsegs1 where

ausbk eq bukrs and

gjahr eq gjahr and

belnr eq belnr.

if sy-subrc ne 0.

message id 'FP' type 'A' number 045 with

'VBSEGS' bukrs gjahr belnr

raising document_line_not_found.

endif.

loop at xvbsegs1.

move-corresponding xvbsegs1 to t_vbseg.

if t_vbkpf-tcode(2) eq 'MR'.

clear t_vbseg-buzid.

endif.

t_vbseg-hkont = t_vbseg-saknr.

t_vbseg-koart = xvbsegs1-koart.

append t_vbseg.

endloop.

endif.

sort t_vbseg by buzei.

   

* correct wrong authority flag

loop at t_vbseg where xskfb = char_a.

if t_vbseg-koart co 'DK' and

t_vbseg-umskz eq space and

t_vbseg-skfbt is initial.

* try to rebuild cash discount calculated flag

t_vbseg-xskfb = 'X'.

else.

clear t_vbseg-xskfb.

endif.

modify t_vbseg.

endloop.

   

endform. "vbseg_lesen

   

   

   

   

   

'ERP_Work > ABAP' 카테고리의 다른 글

SAP Shotcut EnablePassword  (0) 2011.08.03
전화번호 Conversion Exit  (0) 2010.08.26
공급가액에 따른 부가세 자동계산 (KR)  (0) 2010.08.09
주민등록번호 외국인등록번호 Check 프로그램  (0) 2009.03.20
임시전표 Table에 대한 고찰  (0) 2009.03.09
FIEB_PASSWORD  (0) 2009.02.27
Posted by 프랭크리

댓글을 달아 주세요

ERP_Work/ABAP2009.02.27 17:01

FUNCTION FIEB_PASSWORD_DECRYPT.

*"----------------------------------------------------------------------

*"*"Lokale Schnittstelle:

*" IMPORTING

*" VALUE(IM_ENCRYPTED_PASSWORD) TYPE FIEB_ENCRYPTED_PASSWD

*" EXPORTING

*" VALUE(EX_DECRYPTED_PASSWORD) TYPE FIEB_DECRYPTED_PASSWD

*"----------------------------------------------------------------------

   

* decrypt the encrypted password

perform decrypt_password

using

im_encrypted_password

changing

ex_decrypted_password.

   

ENDFUNCTION.

FUNCTION FIEB_PASSWORD_ENCRYPT.

*"----------------------------------------------------------------------

*"*"Lokale Schnittstelle:

*" IMPORTING

*" VALUE(IM_DECRYPTED_PASSWORD) TYPE FIEB_DECRYPTED_PASSWD

*" EXPORTING

*" VALUE(EX_ENCRYPTED_PASSWORD) TYPE FIEB_ENCRYPTED_PASSWD

*"----------------------------------------------------------------------

   

* encrypt the decrypted password

perform encrypt_password

using

im_decrypted_password

changing

ex_encrypted_password.

   

ENDFUNCTION.

   

   

   

   

LFIEB_PASSWORDF01

   

*----------------------------------------------------------------------*

***INCLUDE LFIEB_PASSWORDF01 .

*----------------------------------------------------------------------*

*&---------------------------------------------------------------------*

*& Form CHECK_IF_CARACTERS_ARE_VALID

*&---------------------------------------------------------------------*

* Checks if all characters of the imported decrypted password are

* valid password-characters.

*----------------------------------------------------------------------*

* -->P_DECRYPTED_PASSWORD text

* <--CH_BOOLEAN 'X' if all characters are valid

*----------------------------------------------------------------------*

FORM CHECK_IF_CARACTERS_ARE_VALID

USING

P_DECRYPTED_PASSWORD

CHANGING

ch_BOOLEAN.

   

if p_decrypted_password CO co_password_characters.

ch_boolean = 'X'.

else.

ch_boolean = ' '.

endif.

   

ENDFORM. " CHECK_IF_ALL_CARACTERS_ARE_VAL

   

*&---------------------------------------------------------------------*

*& Form ENCRYPT_PASSWORD

*&---------------------------------------------------------------------*

* Encrypt the imported (decrypted) password.

*----------------------------------------------------------------------*

* -->IM_DECRYPTED_PASSWORD text

* <--ch_ENCRYPTED_PASSWORD text

*----------------------------------------------------------------------*

FORM ENCRYPT_PASSWORD USING IM_DECRYPTED_PASSWORD

CHANGING CH_ENCRYPTED_PASSWORD.

   

* We use a simple 'Vigenere-Chiffre' (but with a long key) and

* add a accumulated index to it.

* By now the encrypted and the decrypted password have the same

* length (32)

   

data:

l_index type i,

l_number type i,

l_key_val type i,

l_passwd_val type i,

l_accumulate type i.

   

clear ch_encrypted_password.

   

l_index = 0.

l_accumulate = 0.

* encrypt the maximal length of the decrypted password, not just the

* filled part of the decrypted password

do co_password_length times.

* check out the index in the key

perform character_search

using

co_password_characters

co_key+l_index(1)

changing

l_key_val.

* check out the index in the decrypted password

perform character_search

using

co_password_characters

im_decrypted_password+l_index(1)

changing

l_passwd_val.

* calculate the index of the character for the encrypted password

l_number = ( l_accumulate + l_key_val + l_passwd_val ) mod

co_number_of_characters.

ch_encrypted_password+l_index(1) =

co_password_characters+l_number(1).

l_index = l_index + 1.

* Accumulate the index of the characters in the decrypted password

l_accumulate = l_accumulate + l_passwd_val.

enddo.

   

ENDFORM. " ENCRYPT_PASSWORD

   

   

*&---------------------------------------------------------------------*

*& Form DECRYPT_PASSWORD

*&---------------------------------------------------------------------*

* Decrypt the imported (encrypted) password.

*----------------------------------------------------------------------*

* -->IM_ENCRYPTED_PASSWORD text

* <--CH_DECRYPTED_PASSWORD text

*----------------------------------------------------------------------*

FORM DECRYPT_PASSWORD USING IM_ENCRYPTED_PASSWORD

CHANGING CH_DECRYPTED_PASSWORD.

   

* We use a simple 'Vigenere-Chiffre' (but with a long key) and

* add a accumulated index to it.

* By now the encrypted and the decrypted password have the same

* length (32)

   

data:

l_index type i,

l_number type i,

l_key_val type i,

l_passwd_val type i,

l_accumulate type i.

   

clear ch_decrypted_password.

   

l_index = 0.

l_accumulate = 0.

* encrypt the maximal length of the decrypted password, not just the

* filled part of the decrypted password

do co_password_length times.

* check out the index in the key

perform character_search

using

co_password_characters

co_key+l_index(1)

changing

l_key_val.

* check out the index in the encrypted password

perform character_search

using

co_password_characters

im_encrypted_password+l_index(1)

changing

l_passwd_val.

* calculate the index of the character for the encrypted password

l_number = ( l_passwd_val - l_accumulate - l_key_val ) mod

co_number_of_characters.

ch_decrypted_password+l_index(1) =

co_password_characters+l_number(1).

l_index = l_index + 1.

* Accumulate the index of the characters in the decrypted password

l_accumulate = l_accumulate + l_number.

enddo.

   

ENDFORM. " DECRYPT_PASSWORD

   

   

*&---------------------------------------------------------------------*

*& Form character_search

*&---------------------------------------------------------------------*

* Search a character in the imported field and returns the

* position of the character. Note that '*' and other special

* characters are treated as normal characters here.

*----------------------------------------------------------------------*

* -->im_string

* -->im_character

* <--ch_pos "position of the character (-1 if not found)

*----------------------------------------------------------------------*

FORM character_search USING im_string

im_character

CHANGING ch_pos type i.

   

data:

l_index type i,

l_length type i.

   

* describe field im_string length l_length.

   

ch_pos = -1.

l_index = 0.

do l_length times.

if im_string+l_index(1) = im_character.

ch_pos = l_index.

exit.

endif.

l_index = l_index + 1.

enddo.

   

ENDFORM. " character_search

   

   

LFIEB_PASSWORDTOP

   

FUNCTION-POOL FIEB_PASSWORD. "MESSAGE-ID ..

   

constants:

* This are the characters that are allowed for the decrypted password

co_password_characters(94) type c value

' !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ' &

'RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~', "#EC NOTEXT

* number of passwrod characters

co_number_of_characters type i value 94,

* max length of the encrypted and of the decrypted password

co_password_length type i value 32,

* This is the key

co_key(32) type c value

'Wz=M?LrU&N\`E!@mBb K/n)e;SvR+Da['. "#EC NOTEXT

'ERP_Work > ABAP' 카테고리의 다른 글

SAP Shotcut EnablePassword  (0) 2011.08.03
전화번호 Conversion Exit  (0) 2010.08.26
공급가액에 따른 부가세 자동계산 (KR)  (0) 2010.08.09
주민등록번호 외국인등록번호 Check 프로그램  (0) 2009.03.20
임시전표 Table에 대한 고찰  (0) 2009.03.09
FIEB_PASSWORD  (0) 2009.02.27
Posted by 프랭크리

댓글을 달아 주세요