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

New to SapScript

Former Member
0 Likes
921

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.000

Any help would be greatly recieved.

Kind Regards

Carly

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
892

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

10 REPLIES 10
Read only

Former Member
0 Likes
892

HI

Use

IF &VBDPR-FKIMG& IS INITIAL.

CODE...

ENDIF.

Regs

Manas Ranjan Panda

Read only

Former Member
0 Likes
892

Hi,

/: IF &VBDPR-FKIMG& = '0.000'

/:

/: ENDIF.

Regards

Sudheer

Read only

Former Member
0 Likes
892

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

Read only

Former Member
0 Likes
892

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

Read only

Former Member
0 Likes
892

Hi Bond,

Put 0.000 in single qotes. it will work.

Thanks

Vikrnath Khimavath

Message was edited by:

Khimavath Vikranth

Read only

Former Member
0 Likes
892

This is my code:

/:   IF &VBDPR-FKIMG& = '0.000'                                              
E1   	Carly,,                                                                
/:   ELSE
/:              Other Code.........
/:ENDIF

When 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

Read only

Former Member
0 Likes
892

Hi ,

try this way.

IF not &VBDPR-FKIMG& is initial .

ur code.

else .

ur code

endif.

Regards

SAntosh

Read only

Former Member
0 Likes
893

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

Read only

Former Member
0 Likes
892

Thank you Manoharsairam Kavuri, that worked. The code should have been

IF &VBDPR-FKIMG& = '            0.000'

Regards

Carly

Read only

Clemenss
Active Contributor
0 Likes
892

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