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

script currency Problem

Former Member
0 Likes
1,408

Hi Friends,

KOMK-FKWRT is amount field.

i am using

IF &KOMK-FKWRT& > 10000. in script window.

do ...

But it is not comparing that one . I mean it is always getting failed.

Could you please help me.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,375

IF &KOMK-FKWRT& > '10000' . -> Should be single quotation

But better to write the code in print program..

13 REPLIES 13
Read only

Former Member
0 Likes
1,375

Hi

Activate the debugger for the script and check whether the value

is coming into the field &KOMK-FKWRT& or not

If some value is coming then it is fine. more than 10000 may not be coming.

then something wrong with the declaration.

check complete code or paste it then it is clear to check.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
1,376

IF &KOMK-FKWRT& > '10000' . -> Should be single quotation

But better to write the code in print program..

Read only

0 Likes
1,375

Hi Seshu,

Thanks for your reply.

I tried it is not working.

Read only

0 Likes
1,375

Hi Murali

Then the best solution is just activate ur debugger and check what value is coming over there

Reward all helpfull answers

Regards

Pavan

Read only

0 Likes
1,375

Hi pavan,

i am printing the value in previous line only.

It is coming. Currency is in Euros..is it will be the problem.

Read only

0 Likes
1,375

And one more thing..how to activate debugger.

Read only

0 Likes
1,375

Hello Murali,

It should work

If ur field = '10000.<b>000'</b> -> how many decimals do you have ,check with debugging.

endif

Read only

0 Likes
1,375

Hi Murali ,

Try this

<b>IF &KOMK-FKWRT& GE '____________1,000.00'

ENDIF.</b>

Here _ is space , as when i posted the space got deleted.

I tried it and it worked for me.

Please check that in your system also 1000 is represeneted as 1,000.00.

The reason for this is given in the help for IF statements used in SAP Scripts.

i am pasting some portion of it here for more info please read the complete help on this.

<i>The comparison is always performed on literal values, that is, the symbols are formatted as character strings before they are compared. This is particularly significant in the case of program symbols, because the formatting of these may depend on various parameters. For example, the formatted form of a currency field employs a variable number of decimal places and a variable ‘decimal point’ symbol (a period or a comma) depending on the applicable currency key</i>

Assign points if reply is helpful.

Regards

Arun

Message was edited by:

Arun R

Read only

0 Likes
1,375

Hi murali

come out of ur script by activating it then on the menu bar goto Utilities--> Activate Debugger

then execute it through spool requests then it will direct u to the script coding part

In this there is no need to keep a breakpoint it will go step by step so watch keenly from which statement the data is coming and form which statement data is not coming

Reward all helpfull answers

Regards

Pavan

Read only

0 Likes
1,375

just goto SE71 -> give ur form name -> utilities ->activate debugger

Read only

Former Member
0 Likes
1,375

Hi

Activate the debugger for the script and check whether the value

is coming into the field &KOMK-FKWRT& or not

If some value is coming then it is fine. more than 10000 may not be coming.

then something wrong with the declaration.

check complete code or paste it then it is clear to check.

Reward points for useful Answers

Regards

Anji

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,375

Hi Murali

Just give it as

<b>

IF &KOMK-FKWRT& > '10000'</b>

and check now.

Regards,

Sree

Read only

Former Member
0 Likes
1,375

Hi Murali

How do u want to compare it whether

if &KOMK-FKWRT& = 1000

or

if &KOMK-FKWRT& > 1000

or

if &KOMK-FKWRT& < 1000

or

IF &KOMK-FKWRT& <>10000

Reward all helpfull answers

Regards

Pavan