Issue: we are not able to open the downloaded file of DMS. Error says 'file is corrupted'.
1) Document created in DMS manual CV01N or through some standard FM’s called by our custom fiori application. The document can be opened by double clicking through CV03N transaction.
2) download FMs.
a)The FM 'CV120_KPRO_MASTER_DATA_GET' which gives the file in PTX_DATA based on input DMS document number pf_doknr.
b)The unique id i.e. PHIO id of PTX_DATA is passed to FM CV120_KPRO_CHECKOUT_TO_TABLE it will return Binary content in PTX_CONTENT and one of column ORLN holds the size of document.
c)The ORLN i.e. SIZE & Binary content i.e. PTX_CONTENT is passed to FM SCMS_BINARY_TO_XSTRING to get XSTRING.
d)XSTRING is passed to UI though ODATA service to download the file.
3)It is downloading but can’t be opened and getting error it is damaged or corrupted. for example, it is noticed that the file on desktop having size 105 KB but same downloaded one has 107 KB, there is difference is size which causing issue but not sure why it is so. in order to try same FM called in some test se38 program and found the same issue there is difference in download file and couldn't be opened.
The strange thing is it was working and tested with all type of files but suddenly causing issue.