Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding currency comaprison in select statement

Former Member
0 Likes
843

Hi,

I am tring to compare currency field in the selct statement with GT, LT symbols. Its going for dump.

My selct statement is

SELECT SINGLE * FROM ZMM_SIGN_AUTH INTO

itab WHERE AMOUNT1 LT ITAB_IN-VALUE

AND AMOUNT2 GT ITAB_IN-VALUE AND

PLANT = L_WERKS.

where amount1, amount2, itab_in-value are curr (15 , 2 decimals).

above selct is going for dump by giving the message that unable to interpret trhe value as number.

Please tell me how compare.

thanks,

kishore

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
714

How did you declare itab_in-value? it should be the same type as the ZMM_SIGN_AUTH-AMOUNT1 or AMOUNT2 (Which should both be equal as well).

REgards,

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
715

How did you declare itab_in-value? it should be the same type as the ZMM_SIGN_AUTH-AMOUNT1 or AMOUNT2 (Which should both be equal as well).

REgards,

Ravi

Read only

0 Likes
714

Yes....I have checked now....ITAB_IN-VALUE is an char filed then i need to concert that into curr. How to convert a char field to currency field

kishore

Read only

0 Likes
714

In the definition itselfm, you have to change

begin of itab_in...

<b> value type <ZTABLE>-AMOUNT1,</b>

end of itab_in

Regards,

Ravi

Read only

Former Member
0 Likes
714

Hi,

Refer this sample code it is working

DATA: itab LIKE STANDARD TABLE OF EKPO.
DATA: value(15) TYPE c value '2999.00'.
DATA: val LIKE ekpo-netpr.

<b>val = value.</b>

SELECT * FROM EKPO INTO
         table itab
         WHERE NETWR LT val
         AND BRTWR GT val 
         AND werks = 'IT01'.

Read only

Former Member
0 Likes
714

declare a internal table with field v_amt type wrbtr.

move the ITAB_IN-VALUE to this field and append the internal table....

now, use this internal table in ur select statement.