Paylaş.
FUNCTION UNAME_LOGIN_SSO_TOKEN.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(UNAME) TYPE SY-UNAME
*” VALUE(TOKENSIFRE) TYPE STRING
*” REFERENCE(TARIHDAMGASI) TYPE FLAG OPTIONAL
*” REFERENCE(SAATDAMGASI) TYPE FLAG OPTIONAL
*” EXPORTING
*” REFERENCE(TOKEN) TYPE MD5_FIELDS-HASH
*”———————————————————————-
” ————————————————–
” Single Sign On – Token Login
” creater : Burhan KARADERE
” Date : 12.06.2015
” Versiyon : v1
” ————————————————–
” Kullanımı
” ————————————————–
” Token formülü algoritmasi
” kullaniciadi + gunun tarihi + gununsaati + tokenşifresi
” ————————————————–
data : token_str type string . ” token formul algoritmasi
data : token_tarih(10) type c . ” 12.06.2015
data : token_saat(6) type c . ” 15:30
data : token_lengt type i . ” token string uzunlugu
if tarihdamgasi eq ‘X’.
” tarih 12.06.2015
concatenate sy–datum+6(2) ‘.’ sy–datum+4(2) ‘.’ sy–datum(4) into token_tarih .
ELSE.
CLEAR token_tarih.
ENDIF.
if saatdamgasi eq ‘X’.
” saat 15:30 biçeminde
concatenate sy–uzeit(2) ‘:’ sy–uzeit+2(2) into token_saat .
ELSE.
CLEAR token_saat.
ENDIF.
CONCATENATE sy–uname token_tarih token_saat tokensifre into token_str .
CONDENSE token_str NO–GAPS .
token_lengt = STRLEN( token_str ). ” uzunluk
CALL FUNCTION ‘MD5_CALCULATE_HASH_FOR_CHAR’
EXPORTING
DATA = token_str
LENGTH = token_lengt
VERSION = 1
IMPORTING
HASH = token
* TABLES
* DATA_TAB =
EXCEPTIONS
NO_DATA = 1
INTERNAL_ERROR = 2
OTHERS = 3
.
IF sy–subrc <> 0.
token = ‘Token hesaplanamadı’ .
ENDIF.
ENDFUNCTION.
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Haz 12 2015
SAP Abap Custom SSO token login fonction
Paylaş.
FUNCTION UNAME_LOGIN_SSO_TOKEN.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(UNAME) TYPE SY-UNAME
*” VALUE(TOKENSIFRE) TYPE STRING
*” REFERENCE(TARIHDAMGASI) TYPE FLAG OPTIONAL
*” REFERENCE(SAATDAMGASI) TYPE FLAG OPTIONAL
*” EXPORTING
*” REFERENCE(TOKEN) TYPE MD5_FIELDS-HASH
*”———————————————————————-
” ————————————————–
” Single Sign On – Token Login
” creater : Burhan KARADERE
” Date : 12.06.2015
” Versiyon : v1
” ————————————————–
” Kullanımı
” ————————————————–
” Token formülü algoritmasi
” kullaniciadi + gunun tarihi + gununsaati + tokenşifresi
” ————————————————–
data : token_str type string . ” token formul algoritmasi
data : token_tarih(10) type c . ” 12.06.2015
data : token_saat(6) type c . ” 15:30
data : token_lengt type i . ” token string uzunlugu
if tarihdamgasi eq ‘X’.
” tarih 12.06.2015
concatenate sy–datum+6(2) ‘.’ sy–datum+4(2) ‘.’ sy–datum(4) into token_tarih .
ELSE.
CLEAR token_tarih.
ENDIF.
if saatdamgasi eq ‘X’.
” saat 15:30 biçeminde
concatenate sy–uzeit(2) ‘:’ sy–uzeit+2(2) into token_saat .
ELSE.
CLEAR token_saat.
ENDIF.
CONCATENATE sy–uname token_tarih token_saat tokensifre into token_str .
CONDENSE token_str NO–GAPS .
token_lengt = STRLEN( token_str ). ” uzunluk
CALL FUNCTION ‘MD5_CALCULATE_HASH_FOR_CHAR’
EXPORTING
DATA = token_str
LENGTH = token_lengt
VERSION = 1
IMPORTING
HASH = token
* TABLES
* DATA_TAB =
EXCEPTIONS
NO_DATA = 1
INTERNAL_ERROR = 2
OTHERS = 3
.
IF sy–subrc <> 0.
token = ‘Token hesaplanamadı’ .
ENDIF.
ENDFUNCTION.
By Burhan KARADERE • ABAP, Basis, Bilişim - IT Haber, SAP, Sap Güvenlik - Sap Security, UI5 - HTML5 • 0 • Tags: custom, fonction, login, SAP, token