cancel
Showing results for 
Search instead for 
Did you mean: 

Error in field routine

former_member363950
Participant
0 Kudos

Please, may you help me to check what is wrong in this field routine code: By moving data from a DSO to another.

In the DTP i get this error in the first Data packet:

"The Argument '6,000' cannot be recognised as number". The message number is "Message nr. RS_EXCEPTION000

"

"One exception occurs" Message nr. SY530

Meldungsnr. RSBK231

The program just take a string and check if it contains a character different to '1234567890,' and if yes, the "EXIT" instruction stop the DO ENDDO statement. SEE the code down:

Data: istkosten(8) TYPE p DECIMALS 3,

count type i,

answer type string,

cnt type i,

richtig type i.

richtig = 1.

cnt = 0.

count = strlen( SOURCE_FIELDS-/Infoobject ).

if count is not initial.

do count times.

answer = ( SOURCE_FIELDS-/Infoobject ) - cnt.

if answer CN '1234567890,'.

    • CN Contain not only

richtig = 0.

EXIT.

ENDIF.

cnt = ( cnt + 1 ).

enddo.

endif.

if richtig = 1.

move SOURCE_FIELDS-/Infoobject to istkosten.

ENDIF.

if istkosten >= 0 and istkosten < 2.

RESULT = '<2'.

ELSEIF istkosten >= 2 and istkosten < 5.

RESULT = '<5'.

ELSEIF istkosten >= 5 and istkosten < 10.

RESULT = '<10'.

ELSEIF istkosten >= 10.

RESULT = '>=10'.

ENDIF.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member363950
Participant
0 Kudos

A ABAP expert just help me in the whole programming code

thanks

Former Member
0 Kudos

Hi,

I think the problem is with the below line of code.

answer = ( SOURCE_FIELDS-/Infoobject ) - cnt.

The source_field should be a CHAR and since you are trying to subtract char with number, it is throwing an error.

Assign the data of this field to sum numeric field and then subtract.

Hope this helps.

former_member363950
Participant
0 Kudos

Thank Akhan for helping,

Please can you give me the right code i need here.

How do i Assign the data of this field to sum numeric?

Thanks

Arnaud

Former Member
0 Kudos

Can you explain me the what you are trying to perform with DO LOOP.

If you are trying find if source field contains any of digits from 1 to 9, the use CA instead of CN. This will avoid looping and subtraction.

Edited by: Akhan_BI on Aug 19, 2009 11:10 PM

former_member363950
Participant
0 Kudos

Hello Akhan,

I want only to check whether a string is a number and contains only characters between 1234567890,

If this is it, i fill a field with a value, if not the field is not filled.

Thanks

Arnaud