10-02-2009 11:16 AM
I've tried the method cl_abap_zip=>crc32 but the output don't work for my parameters.
Other solutions?
thanks for answers.
10-02-2009 11:47 AM
check this fm FI_MT100_CRC_CALC it calculates CRC but i'm not if its standard CRC32
10-02-2009 11:54 AM
10-02-2009 11:57 AM
10-02-2009 12:39 PM
check this code
method crc32.
constants: magic_nr(4) type x value 'EDB88320',
mffffffff(4) type x value 'FFFFFFFF',
m7fffffff(4) type x value '7FFFFFFF',
m00ffffff(4) type x value '00FFFFFF',
m000000ff(4) type x value '000000FF',
m000000(3) type x value '000000'.
if xstrlen( crc32_map ) = 0.
do 256 times.
data: c(4) type x, low_bit(4) type x.
c = sy-index - 1.
do 8 times.
low_bit = '00000001'. low_bit = c bit-and low_bit. " c & 1
c = c div 2. c = c bit-and m7fffffff. " c >> 1 (top is zero, but in ABAP signed!)
if low_bit is not initial.
c = c bit-xor magic_nr.
endif.
enddo.
concatenate crc32_map c into crc32_map in byte mode.
enddo.
endif.
data: len type i, n type i. "#EC *
data: crc(4) type x value mffffffff, x4(4) type x, idx(4) type x.
len = xstrlen( content ).
do len times.
n = sy-index - 1.
concatenate m000000 content+n(1) into idx in byte mode.
idx = ( crc bit-xor idx ) bit-and m000000ff.
idx = idx * 4.
x4 = crc32_map+idx(4).
crc = crc div 256. crc = crc bit-and m00ffffff. " c >> 8
crc = x4 bit-xor crc.
enddo.
crc = crc bit-xor mffffffff.
crc32 = crc.
endmethod.
Got the code from here http://www.sapnet.ru/viewtopic.php?p=6364
Edited by: Kartik Tarla on Oct 2, 2009 5:09 PM
10-02-2009 12:47 PM
In fact this is the exact code of CL_UJF_ZIP=>CRC32 (take a look at [Note 1283040 - Replacement of CL_ABAP_ZIP for supporting of Unicode|https://service.sap.com/sap/support/notes/1283040] Correction Instruction of CL_UJF_ZIP CRC32 if you don't have this object/method on your system...)
Regards,
Raymond
10-02-2009 10:17 PM
Raymond, I don't see any difference between codes of CL_ABAP_ZIP=>CRC32 and CL_UJF_ZIP=>CRC32.
Avalor, maybe the problem is about the XSTRING parameter you passed to CRC32 method, are you really sure it's correct, what code did you use to load the xstring?