04-07-2009 8:31 AM
Hi Experts ,
Right now i am using FM MD5_CALCULATE_HASH_FOR_CHAR for text files and MD5_CALCULATE_HASH_FOR_RAW for binary files. My report is working fine with file sizes upto 65535 characters
.Ex.DATA:l_mstring(65535) TYPE c.
. When file size exceeds it gives wrong MD5 content. I have tried to pass string but it leads to runtime error as it takes only c type data. I also tried to pass internal table but i found calculated MD5 hash value is different for both string and internal table.
My code is
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = l_mstring
length = l_strlen
* VERSION = 1
IMPORTING
hash = l_md5hash
* TABLES
* data_tab = i_file
EXCEPTIONS
internal_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
.
Please let me know any solution for large files.
Thanks and regards,
Shivanand Kalagi.
03-14-2011 8:40 AM
can you please explain the solution for the problem as we are facing with the issue.
Regards,
Vachana
04-08-2009 3:48 PM
07-09-2009 8:39 AM
Hi, i hope you still read my post.
Can you please share your solution with me.
I have the same problem - ok i can use
CALL FUNCTION 'MD5_CALCULATE_HASH_FOR_CHAR'
EXPORTING
data = l_mstring
length = l_strlen
* VERSION = 1
IMPORTING
hash = l_md5hash
* TABLES
* data_tab = i_file
EXCEPTIONS
internal_error = 1
OTHERS = 2.
the data_tab for bigger files, but the main problem is that the method is marked as obsolete.
So I am asking you if you have found a solution without a obsolete method.
Greeting Gerald
10-07-2009 5:35 AM
I am having the same problem - I wonder if you could share your solution.
Regards,
Gareth
05-21-2010 9:51 PM
Hi, can you help me using MD5_CALCULATE_HASH_FOR_CHAR for files with more than one line?
It works fine with 1 line but 2 or more it doesnt work fine.
Thanks in advance
09-29-2010 1:45 PM
please can you tell me how to solve this issue? since I have the same problem.
Thank you very much
03-14-2011 8:40 AM
can you please explain the solution for the problem as we are facing with the issue.
Regards,
Vachana
03-22-2011 2:05 PM
You can use FMs 'CALCULATE_HASH_FOR_CHAR' or 'CALCULATE_HASH_FOR_RAW' alternatively for string.
Ex.
* Get contentmd5 for CHAR
STR_LEN = STRLEN( L_STRING ).
CALL FUNCTION 'CALCULATE_HASH_FOR_CHAR'
EXPORTING
ALG = 'MD5'
DATA = L_STRING
LENGTH = STR_LEN
IMPORTING
HASH = L_MD5_HASH.
* Get contentmd5 for raw
STR_LEN = XSTRLEN( DATA ).
CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
EXPORTING
ALG = 'MD5'
DATA = DATA
LENGTH = STR_LEN
IMPORTING
HASH = L_MD5_HASH.
Regards,
Shivanand Kalagi