KEFC - Unicode error whlie loading external COPA data?
I am using transaction KEFC (program RKEVEXT3) to load a flat text file into CO-PA. Our team has defined a custom structure ZCOPAEXT to load this information.
However, when KEFC is executed, the program fails with a message "The file cannot be imported in this format."
Debugging the program shows that this error occures in subroutine CHECK_UNICODE in include RKCDFILEINCFOR. I've provided the code of below.
FORM check_unicode USING value(repid) TYPE kcdu_repid. DATA: subrc LIKE sy-subrc, l_it242s LIKE cfsend_tab OCCURS 100 WITH HEADER LINE, l_charlen TYPE i, l_char TYPE c LENGTH 1. CALL FUNCTION 'KCD_SENDERSTRUC_LOGICAL_READ' EXPORTING repid = repid TABLES e_send = l_it242s EXCEPTIONS OTHERS = 0. DESCRIBE FIELD l_char LENGTH l_charlen IN BYTE MODE. LOOP AT l_it242s WHERE ftype CA 'IFPX'. EXIT. ENDLOOP. IF sy-subrc = 0 AND l_charlen <> 1. subrc = 4. EXPORT subrc TO MEMORY ID 'KCDFILE0'. * Die Datei kann in diesem Format nicht eingelesen werden CALL FUNCTION 'KCD_MESSAGES_COLLECT' EXPORTING repid = repid grpid = grpid msgty = 'A' arbgb = 'DU' msgnr = '027'. MESSAGE a027(du). ENDIF. ENDFORM. "no_floats_and_integers
The error seems to occur with the "DESCRIBE FIELD" statement. The field length in bytes of the 1 character field "l_char" is always 2. This triggers the IF statement where "l_charlen <> 1".
I've searched the OSS notes and this forum, but it doesn't seem like anyone has experienced a similar issue. Any ideas on how to resolve this? I would like to avoid having to copy the program (and includes) and create a custom solution.
Thanks very much for any input you can provide.