‎2006 Dec 04 4:21 PM
I have never used SapScripts before to apologise if this question is a stupid one. How to I check if a field is 0? I have written the following code but it doesn't seem to recognise that the field is 0:
IF &VBDPR-FKIMG& = 0.000Any help would be greatly recieved.
Kind Regards
Carly
‎2006 Dec 05 10:30 AM
HI,
TRY THIS.
/: IF &VBDPR-FKIMG& = ' 0.000'
Carly
/: ELSE
OTHER
/: ENDIF
TRY TO DEBUG THE FORM AND SEE THAT FIELD COPY THE VALUE WITH SPACES AND PASTE IT WITHIN THE QUOTES AND TRY IT AGAIN.
Message was edited by:
Manoharsairam Kavuri
Message was edited by:
Manoharsairam Kavuri
‎2006 Dec 04 4:28 PM
HI
Use
IF &VBDPR-FKIMG& IS INITIAL.
CODE...
ENDIF.
Regs
Manas Ranjan Panda
‎2006 Dec 04 4:52 PM
‎2006 Dec 04 4:52 PM
I have changed the code to
IF &VBDPR-FKIMG& IS INITIAL
and I get the following message:
An error occurred in the text command IF. A parameter is too long.
The command line was ignored.
Can anyone help?
Regards
Carly
‎2006 Dec 04 5:01 PM
I have also tried
/: IF &VBDPR-FKIMG& = '0.000'
E1 Carly,,
/: ELSE
/: other code
/: ENDIF
but when the field is 0.000 it is just moving onto the other code instead of writing Carly.
Regards
Carly
‎2006 Dec 04 5:06 PM
Hi Bond,
Put 0.000 in single qotes. it will work.
Thanks
Vikrnath Khimavath
Message was edited by:
Khimavath Vikranth
‎2006 Dec 05 9:55 AM
This is my code:
/: IF &VBDPR-FKIMG& = '0.000'
E1 Carly,,
/: ELSE
/: Other Code.........
/:ENDIFWhen the field &VBDPR-FKIMG& is 0.000 it doesn't write Carly is just goes into the ELSE statement.
Has anyone got any other ideas as single quotes have not worked?
Cheers
Carly
‎2006 Dec 05 10:09 AM
Hi ,
try this way.
IF not &VBDPR-FKIMG& is initial .
ur code.
else .
ur code
endif.
Regards
SAntosh
‎2006 Dec 05 10:30 AM
HI,
TRY THIS.
/: IF &VBDPR-FKIMG& = ' 0.000'
Carly
/: ELSE
OTHER
/: ENDIF
TRY TO DEBUG THE FORM AND SEE THAT FIELD COPY THE VALUE WITH SPACES AND PASTE IT WITHIN THE QUOTES AND TRY IT AGAIN.
Message was edited by:
Manoharsairam Kavuri
Message was edited by:
Manoharsairam Kavuri
‎2006 Dec 05 10:38 AM
Thank you Manoharsairam Kavuri, that worked. The code should have been
IF &VBDPR-FKIMG& = ' 0.000'Regards
Carly
‎2006 Dec 05 11:06 AM
Hi,
IS INITIAL is nonsense. This is ABAP, not SapScript.
Switch on the DEBUG mode from SE71, set a break point to the element where &VBDPR-FKIMG& is output.
Put the symbol &VBDPR-FKIMG& to the symbols at the bottom. Check what the contents is like when it is 0.
Probably there is no 0.000 but just spaces. The the IF statement should be
IF &VBDPR-FKIMG& = ' '
Regards,
Clemens