cancel
Showing results for 
Search instead for 
Did you mean: 

KEFC - Unicode error whlie loading external COPA data?

Former Member
0 Kudos

Hello everyone,

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181966
Active Contributor
0 Kudos

Check out the OSS # 548016 and 632796 .

Hope this`ll give you some guide line .

Good luck !!

Thanks

Saquib Khan

Former Member
0 Kudos

Thanks Saquib... I looked at those OSS notes but didn't find anything that could help me.

Answers (1)

Answers (1)

Former Member
0 Kudos

Along with that check, it also has another check where it is looking at your structure and seeing if any field of that structure is of type 'P' or 'F' or 'X' or 'I'. Do you have any of these type fields in your structure? May be it is not allowed now.

Srinivas

Former Member
0 Kudos

HI Srinivas,

I see the LOOP statement checking for "ftype" containing "IFPX". However the loop logic doesn't seem to be doing anything other than the check.

At the end of the loop, regardless of whether the check was triggered, SY-SUBRC will always be 0 and L_CHARLEN will also be greater than 1. So I don't see how this loop check will effect the IF statement below it.

Am I missing something in my understanding? It could be, I have been starring at this problem for a while now :-).

Thanks for your input.

- Suresh

Former Member
0 Kudos

Let us say the internal table has a field of type I, then after the LOOP statement, SY-SUBRC will be 0. The IF statement following it has a SY-SUBRC = 0 check along with the L_CHARLEN check.

So, in other words, if I don't any field in my internal table whose type is one of IFPX, then the sy-subrc will be non-zero and so the IF check will fail and it will not dump.

I hope this clarifies.

Srinivas

Former Member
0 Kudos

Hi Srinivas,

Yes you're right. I wasn't paying attention to the loop statement before.

Our config team did define a type "P" field in the upload structure Looks like this is no longer supported in ECC 5.0 as programs have this Unicode check?

Thanks for your clarification anyway!

Former Member
0 Kudos

I guess so. Try searching OSS, if they have anything to say about it.

Also, see if you change the structure to say a decimal field instead of type P, may be it will work.

Please close the thread, if you think this is closed.