2020 Nov 14 1:49 AM
Dear Gurus,
after downloading a file thru an API process (files comes as binary in a string in the http response), and transforming it to a XSTRING (with SCMS_STRING_TO_STRING and with cl_abap_conv_out_ce) I receive an infinite loop dump while loading the XSTRING to the cl_abap_zip->load method. In POSTMAN it works OK, I just download the file with no issue.It seems the method cannot entirely analyze the structure of the zip file (it see it has an object 11 chars long "records.txt" but it is trying to loop the files in the ZIP but it is not finding any.
I don't know what to do overpass the situation. I am attaching two screenshots of the dump.
Any input will be highly appreciated.
2020 Nov 14 1:14 PM
The short dump is not attached. Please attach the full text version, not the screenshot of the first page!
If the failure is inside CL_ABAP_ZIP, then either you don't call it with the correct parameters, or there is a patch that corrects -> search SAP notes (if it's an "infinite loop" inside CL_ABAP_ZIP then it's a SAP bug for sure).
2020 Nov 15 4:38 PM
Sandra,
Thanks for your response. The images were not uploaded. I don't know if there is something wrong with the encoding of the ZIP, because I could not find any SAP note or KBA regarding this issue.
2020 Nov 15 4:46 PM
If you see the method LOAD, you will see that the structure <ext> structure is populated. Many of those fields are populated, but some don't. One of them is FIELDNAME.
2020 Nov 15 5:12 PM
Please use the COMMENT button. The button ANSWER is only for solutions, dixit SAP "before answering".
2020 Nov 15 5:24 PM
Thanks for the short dump. "CX_SY_FIND_INFINITE_LOOP" happens in FIND when the searched string is empty (length 0).
Maybe the issue is that you provide an invalid string of bytes, and CL_ABAP_ZIP doesn't fully validate it and falls into an unexpected situation.
Please tell us whether the first 4 bytes of the XSTRING are 504B0102? If no, you incorrectly generated the XSTRING variable. If yes, the issue is possibly due to the use of Unicode encoding of file names (I don't see why it fails, though, it's just a guess), otherwise could you provide the bytes after 02014B50 (those 4 bytes should be located more or less close to the end of the XSTRING).
To unzip by using the Unicode encoding of file names:
DATA(zipper) = NEW cl_abap_zip( ).
zipper->support_unicode_names = ABAP_TRUE.
" Unzip after that
2020 Nov 19 3:31 PM
SOLVED by changing from CL_ABAP_ZIP to CL_CSI_ZIP (same methods, different way to read the ZIP).