2006 Dec 12 2:29 PM
Hi all,
IAM HAVING AN ISSUE WITH CURRENCY FIELD IN MODULE POOL.
My requirement is that i have a quantity column in table control.
The user enters value of 0 sometimes . But it should not be blank.
I have the column declared as MENGE_D -data element(length 13 and 3 decimals)
i have the following code in pai
FIELD ITAB-QUANT MODULE QUANT2.
MODULE QUANT2 INPUT.
if itab-quant is initial.
MESSAGE I999(00) WITH 'Enter the Qty'.
endif.
endmodule.
PROBLEM IS WHEN THE USER ENTER 0 STILL HE GETS THE MESSAGE.
THE USER SHOULD GET MESSAGE ONLY IF THE FIELD IS BLANK I MEAN NO VALUE .
I HAVE ITAB-QUANT IS 0.000 STILL IT GIVES A MESSAGE.
SO I TRIED THIS WAY,
data : testq(16) type p decimals 3.
testq = ITAB-qUANT.
BUT FOR SOME REASON THE LENGTH OF TESTQ IS QUITE BIGGER THAN THAT OF ITAB-QUANT.
SHOULD I DECLARE IT AS
data : testq(13) type p decimals 3.
bUt this will solve the problem .
let me know if anyone has an easier solution .
Thanks
Hi all,
IAM HAVING AN ISSUE WITH CURRENCY FIELD IN MODULE POOL.
My requirement is that i have a quantity column in table control.
The user enters value of 0 sometimes . But it should not be blank.
I have the column declared as MENGE_D -data element(length 13 and 3 decimals)
i have the following code in pai
FIELD ITAB-QUANT MODULE QUANT2.
MODULE QUANT2 INPUT.
if itab-quant is initial.
MESSAGE I999(00) WITH 'Enter the Qty'.
endif.
endmodule.
PROBLEM IS WHEN THE USER ENTER 0 STILL HE GETS THE MESSAGE.
THE USER SHOULD GET MESSAGE ONLY IF THE FIELD IS BLANK I MEAN NO VALUE .
I HAVE ITAB-QUANT IS 0.000 STILL IT GIVES A MESSAGE.
SO I TRIED THIS WAY,
data : testq(16) type p decimals 3.
testq = ITAB-qUANT.
BUT FOR SOME REASON THE LENGTH OF TESTQ IS QUITE BIGGER THAN THAT OF ITAB-QUANT.
SHOULD I DECLARE IT AS
data : testq(13) type p decimals 3.
bUt this will solve the problem .
let me know if anyone has an easier solution .
Thanks
2006 Dec 12 2:31 PM
try this if it works..
if itab-quant is initial and
itab-quant ne '0.000'.
MESSAGE I999(00) WITH 'Enter the Qty'.
endif.
2006 Dec 12 2:34 PM
Hi chandrasekhar,
The problem is when it display, its not displaying if the value is 0.000
LET ME KNOW
THANKS
2006 Dec 12 2:36 PM
It's right, because a P field it's null if it's 0.000.
Try set up the "Leading Zeroes" flag in SE51 - Screen Painter for your field.
I'm not sure it works, but you can simply try!
2006 Dec 12 2:35 PM
can u make the screen field as a character type and pass the value to it .
cause when it is zero character will be space whereas netpr/quant will be 0.000
so then ur condition will be if netpr/quant = ' ' or intial will work if the screen field is of type character .
try this .
regards,
vijay
Message was edited by:
vijay k
2006 Dec 12 2:36 PM
HI,
Try this one
<b>FIELD ITAB-QUANT MODULE QUANT2.
MODULE QUANT2 INPUT.
if itab-quant LE 0..
MESSAGE I999(00) WITH 'Enter the Qty'.
endif.</b>endmodule.
Regs
Manas Ranjan Panda
2006 Dec 12 2:37 PM
Just try it out. If this works or not.
if itab-quant is space
MESSAGE I999(00) WITH 'Enter the Qty'.
endif.
2006 Dec 12 2:44 PM
Hi all,
i cannot change the table control because i am just changing the code that already in production.
I tried to declare
data : testq(13) type p decimals 3.
though my quant field is 13 lenth and 3 decimals , way too smaller than my testq.
whyis that.
its like 26 digits big when i check in debug.
Thanks
2006 Dec 12 2:51 PM
hi preethi ,
just check this code .
data : quant like ekpo-menge, " ur data type
v_quant(13) type c. " --->proposed
quant = 0. " made initial.
v_quant = quant.
write:/ quant.
if quant is initial.
write:/ 'hi'. "gets triggered cause some value is there
endif.
if v_quant is initial.
write:/ 'hi'. "even though value is there dosent get triggered
endif."cause its character.
if u can make the screen field as character then u can have solution in my opinion .
just check if this alternate can help ur code ..
regards,
vijay.
2006 Dec 12 2:59 PM
Hi Vijay,
The problem is that sometimes i may have the value like 12.231.
so in that the char field doesnot hold the decimal value right.
AM I RIGHT.
THANKS
2006 Dec 12 3:03 PM
no problem it will hold u can check the same in the code .
data: v_quant(13) type c,
quant like ekpo-menge value '12.341'.
v_quant = quant.
write:/ v_quant.regards,
vijay