2

When I'm creating a purchase order that have 10 items (or above), a run time error occurred. Below is the error message.

Category:          ABAP Programming Error
Runtime Errors: CONVT_NO_NUMBER
ABAP Program: SAPLMEPO
Include              MM06EF0B_BUCHEN
Application Component MM-PUR

An exception occurred that is explained in detail below.

This exception cannot be caught in the context of the current statement. The reason for the exception is: An attempt was made to interpret value "*" as a number. As this value contravenes the rules for displaying numbers correctly, this was not possible.

Below is the code where an exception occurred:

DATA indx.
     indx = 1.
* Need to merge KNT and XEKKN
* algorithm is: if knt is old, use knt. Else use the equivalent from xekkn
     LOOP AT knt.
       IF knt-updkz EQ oldpos.
         MOVE-CORRESPONDING knt TO lt_ekkn.
       ELSE.
        READ TABLE xekkn INDEX indx.
         MOVE-CORRESPONDING xekkn to lt_ekkn.
         indx = indx + 1.
       ENDIF.
       APPEND lt_ekkn.
     ENDLOOP.                    "v 2068862

It seems that the data type of indx (char 1), but when PO item index = 9, then index = 10 (actual value is * in debug mode ), so exception is happened.

How should I solve this problem?

I also post this issue here: https://scn.sap.com/message/16146617

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
user3561096
  • 23
  • 1
  • 4

1 Answers1

1

You are right in assuming that indx is a C(1) since you (or the author of the code) did not specify a type. Changing the line to

DATA indx TYPE i.

should solve the issue.

vwegert
  • 18,371
  • 3
  • 37
  • 55
  • Thanks for your suggest. That code in SAP standard system. I think I need a SAP note or enhancement package to solve this issue. – user3561096 Aug 06 '15 at 06:56
  • Hi vwegert, I found a SAP note 2068862 and applied that. Now it is ok, That is the same your idea. Many thanks :) – user3561096 Aug 06 '15 at 09:02