Skip to Content
author's profile photo Former Member
Former Member

runtime error in abap report

error analysis as in ST22 TRANSACTION:

AN EXCEPTION OCCURED THE EXCEPTION ASSIGNED TO CLASS CX_SY_CONVERSION_NO_NUMBER WAS NOT CAUGHT WHICH LED TO AN ERROR. THE REASON FOR THIS EXCEPTION IS :

THE PROGRAM TRIED TO INTERPRET VALUE ':4' AS NUMBER SINCE THE VALUE CONTRAVENES THE CORRECT NUMBER FORMAT THIS WAS NOT POSSIBLE.

ATTACHED IS MY PROGRAM

REPORT ZVXR0303

LINE-COUNT 60(3)

LINE-SIZE 132

MESSAGE-ID VN.

Tables: VBEP, VBAP, NAST.

DATA: BEGIN OF HEADER,

ORDER(15) VALUE 'ORDER',

LINE(5) VALUE 'LINE',

MATERIAL(14) VALUE 'MATERIAL',

DUE(15) VALUE 'DUE (MAD)',

CREATED(10) VALUE 'CREATED',

QTY(10) VALUE 'QUANTITY',

KEY(5) VALUE 'KEY',

TYPE(5) VALUE 'TYPE',

END OF HEADER.

DATA: Begin of IDAT OCCURS 0,

VBELN LIKE VBAP-VBELN,

POSNR LIKE VBAP-POSNR,

werks LIKE VBAP-WERKS,

cuobj LIKE vbap-CUOBJ,

MBDAT LIKE vbep-mbdat,

ERDAT LIKE VBAP-ERDAT,

MATNR LIKE VBAP-MATNR,

KWMENG LIKE VBAP-KWMENG,

QTY TYPE I,

END of IDAT.

class cl_abap_char_utilities definition load.

constants: tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.

DATA: t_record(1000) TYPE C.

DATA: C_KWMENG(20) TYPE C.

data: OUTFILE(50) value '/usr/users/ftpsapfi/locks_540318'.

DATA: BEGIN OF TKOMCON OCCURS 50.

INCLUDE STRUCTURE CONF_OUT.

DATA: END OF TKOMCON.

DATA: iKEY TYPE I,

offset TYPE I,

KeyTypeLOC TYPE I,

KeyNumberLOC TYPE I,

type(15) TYPE C.

select-options: sVBELN FOR VBEP-VBELN obligatory,

sMAD FOR VBEP-MBDAT obligatory,

sERDAT FOR VBAP-ERDAT,

sMATNR FOR VBAP-MATNR,

sWERKS FOR VBAP-WERKS,

sKWMENG FOR VBAP-KWMENG.

SELECT

vbap~vbeln

vbap~POSNR

vbap~werks

vbap~cuobj

VBEP~MBDAT

VBAP~ERDAT

VBAP~MATNR

VBAP~KWMENG

INTO CORRESPONDING FIELDS of IDAT

FROM ( VBEP INNER JOIN VBAP ON vbepvbeln = vbapvbeln

AND vbepposnr = vbapposnr )

WHERE BMENG > 0

AND vbep~MBDAT IN sMAD

AND VBEP~VBELN in sVBELN

AND VBAP~werks IN sWERKS

AND VBAP~ERDAT IN sERDAT

AND VBAP~MATNR IN sMATNR

AND VBAP~KWMENG IN sKWMENG

AND VBAP~ABGRU = SPACE.

APPEND IDAT.

ENDSELECT.

PERFORM TOP-OF-PAGE.

if sy-batch = 'x'.

OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER t_record TO OUTFILE.

endif.

IF SY-SUBRC = 0.

LOOP at IDAT.

write IDAT-KWMENG DECIMALS 0 TO C_KWMENG.

REFRESH TKOMCON.

CALL FUNCTION 'VC_I_GET_CONFIGURATION'

EXPORTING

INSTANCE = idat-cuobj

LANGUAGE = NAST-SPRAS

TABLES

CONFIGURATION = TKOMCON

EXCEPTIONS

OTHERS = 4.

LOOP AT TKOMCON

WHERE ATNAM = 'S_SK_SPEC_KEY' OR ATNAM = 'S_MK_SPEC_KEY'

OR ATNAM = 'S_SK_CONSC_KEY' OR ATNAM = 'S_MK_CONSC_KEY'.

IF TKOMCON-ATNAM = 'S_SK_CONSC_KEY'

OR TKOMCON-ATNAM = 'S_MK_CONSC_KEY'.

KeyTYPELOC = 0.

keynumberloc = 2.

TRANSLATE TKOMCON-ATWRT+KeyNumberLOC(4) USING ': '.

IF TKOMCON-ATWRT+KeyNumberLOC(4) CO '0123456789 '.

iKey = TKOMCON-ATWRT+KeyNumberLOC(4).

IF ( TKOMCON-ATWRT+KeyTypeLOC(2) = 'FR' AND iKey >= 454 )

OR ( TKOMCON-ATWRT+KeyTypeLOC(2) = 'XF' AND iKey >= 1150 ).

PERFORM OUT-OF-RANGE-FOUND.

ENDIF.

ENDIF.

Else.

Offset = 0.

DO.

IF offset <= 9.

offset = offset + 1.

If TKOMCON-ATWRT+Offset(1) = ':'.

KeyTypeLOC = Offset + 1.

KeyNumberLOC = Offset + 3.

EXIT.

ENDIF.

ELSE.

EXIT.

ENDIF.

ENDDO.

TRANSLATE TKOMCON-ATWRT+KeyNumberLOC(4) USING ': '.

IF TKOMCON-ATWRT+KeyNumberLOC(4) CO '0123456789 '.

iKey = TKOMCON-ATWRT+KeyNumberLOC(4).

IF ( TKOMCON-ATWRT+KeyTypeLOC(2) = 'FR' AND iKey >= 454 )

OR ( TKOMCON-ATWRT+KeyTypeLOC(2) = 'XF' AND iKey >= 1150 ).

IDAT-KWMENG = TKOMCON-ATWRT(3).

PERFORM OUT-OF-RANGE-FOUND.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDLOOP.

ENDIF.

CLOSE DATASET OUTFILE.

----


  • FORM OUT-OF-RANGE-FOUND *

----


  • ........ *

----


FORM OUT-OF-RANGE-FOUND.

WRITE: / IDAT-VBELN.

WRITE: 10 IDAT-POSNR.

WRITE: 20 IDAT-MATNR.

WRITE: 35 IDAT-MBDAT.

WRITE: 50 IDAT-ERDAT.

WRITE: 65(3) IDAT-KWMENG DECIMALS 0.

WRITE: 75 TKOMCON-ATWRT+KeyTypeLOC(6).

IF TKOMCON-ATNAM = 'S_SK_CONSC_KEY'

OR TKOMCON-ATNAM = 'S_MK_CONSC_KEY'.

WRITE: 85 'Consecutive'.

ELSE.

WRITE: 85 'Specific'.

ENDIF.

IF TKOMCON-ATNAM = 'S_SK_CONSC_KEY'

OR TKOMCON-ATNAM = 'S_MK_CONSC_KEY'.

TYPE = 'Consecutive'.

ELSE.

TYPE = 'Specific'.

ENDIF.

  • * PREPARING A RECORD TO BE SENT TO FILE

CONCATENATE

IDAT-VBELN

IDAT-POSNR

IDAT-MATNR

IDAT-MBDAT

IDAT-ERDAT

C_KWMENG

TKOMCON-ATWRT+KeyTypeLOC(6)

TYPE

INTO t_record SEPARATED BY tab.

if sy-batch = 'x'.

TRANSFER t_record TO OUTFILE.

endif.

ENDFORM.

----


  • FORM TOP-OF-PAGE *

----


  • ........ *

----


FORM TOP-OF-PAGE.

WRITE: / 'ORDER'.

WRITE: 10 'LINE'.

WRITE: 20 'MATERIAL'.

WRITE: 35 'DUE (MAD)'.

WRITE: 50 'CREATED'.

WRITE: 65 'QTY'.

WRITE: 75 'KEY'.

WRITE: 85 'TYPE'.

  • PREPARING A RECORD TO BE SENT TO FILE

CONCATENATE

header-ORDER

header-LINE

header-MATERIAL

header-DUE

header-CREATED

header-QTY

header-KEY

header-TYPE

INTO t_record SEPARATED BY tab.

ENDFORM.

THIS IS WORKING FINE WITH DIFFERENT RANGES BUT WHEN I USE RANGE

Sales Order 1250000 TO 2250000

MAD 01/18/2005 TO 03/02/2005

Material LOCK9250FR TO LOCK9250XF

PLANT 4500

IT GIVES THE RUNTIME ERROR I MENTIONED ABOVE

ANY HELP WOULD BE GREATLY APPRECIATED

THANKS.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:25 PM

    hi,

    i guess problem with assign quantity value into any other variable

    write IDAT-KWMENG DECIMALS 0 TO C_KWMENG.

    idat-kwmeng may be like '10.00 EA'

    you try to assign to c_kwmeng that cause problem

    for that you eliminate 'EA' like

    idat-kwmeng+0(15) to c_kwmeng

    you check other places also

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      As sasi said, I too think the problem must be there.

      KWMENG is 15 char long with 3 decimal places and you are trying to move that value using write in to a char variable of length 20.

      Thanks,

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:31 PM

    Noor,

    In the short dump, can you look at what is the field to which the value of .4 is being assigned. Then take a look at the data type of the variable.

    I am guessing it might have been declared as I and then a decimal is being passed.

    Regards,

    Ravi

    Note : Please reward points, if this helps you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:30 PM

    It could be a problem with one of the translate statements: (TRANSLATE TKOMCON-ATWRT+KeyNumberLOC(4) USING ': '.). The dump should tell you what line it ocurred in. Could you show us please?

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.