cancel
Showing results for 
Search instead for 
Did you mean: 

IF statement condition not met

Former Member
0 Kudos

Dear all,

The value for KOMK-FKWRT is 78.67

Could someone tells me why it cannot meet the condition below?


IF &KOMK-FKWRT(C.0)& LT '1000'
INCLUDE 'ZMM_XXX' OBJECT TEXT ID 'ST' LANGUAGE EN  PARAGRAPH K2
ENDIF.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

try:

IF &KOMK-FKWRT(C.0)& LT 1000

INCLUDE 'ZMM_XXX' OBJECT TEXT ID 'ST' LANGUAGE EN PARAGRAPH K2

ENDIF.

gr., Frank

Former Member
0 Kudos

Hi Bernson,

Thanks for your reply.

It is still not working. I think it is because of the wrong comparision type, one is currency type and the other one is integer type.

Please correct me.

But how to solve this problem?

Former Member
0 Kudos

hi Myahsam

For meit is a bit try and error because i have no possibilites from here to test

maybe it works if you try:

IF &KOMK-FKWRT(C)& LT '1000,00'

INCLUDE 'ZMM_XXX' OBJECT TEXT ID 'ST' LANGUAGE EN PARAGRAPH K2

ENDIF.

Gr., Frank

Former Member
0 Kudos

Hi Bernson,

As my value passing from global variable is 8.000,00, which is 8,000.00 As the amount is in EUR.

My solution is as below. Does it make sense? But it is working now.

In ABAP


DATA: gv_netwr     TYPE netwr Value 100000.   " actual value will become 1.000,00

In Sapscript


IF &KOMK-FKWRT(C)& LT gv_netwr
INCLUDE 'ZMM_XXX' OBJECT TEXT ID 'ST' LANGUAGE EN PARAGRAPH K2
ENDIF.

Edited by: myahsam wong on Sep 3, 2009 12:25 PM

Sandra_Rossi
Active Contributor
0 Kudos

I think it's the old problem of not using "fixed point arithmetic" (check this flag in the attributes of the main program). When it is not used, SAP considers all packed fields having no decimal points. Example: if the field has 2 decimals and its value is 1000.50, SAP will consider it as being 100050. All people have to fight with that concept, me too

Former Member
0 Kudos

Hi,

It is correct. No problem you can proceed.

Answers (0)