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

If condition

Former Member
0 Likes
841

I am using an IF condition in the script

if &wk_result& eq '0'.

,,&VBDPL-VGPOS+2&,,&VBDPL-MATNR&,,<C>&WK_ARKTX(C)&</>,,&WK_ORD_QTY&

,,&WK_HOLD_KCMENG&,,&WK_BO_QTY&,,&VBDPL-VRKME(03)&,,

else

,,&VBDPL-VGPOS+2&,,&VBDPL-MATNR&,,<C>&WK_ARKTX(C)&</>,,&WK_ORD_QTY&

,,&WK_RESULT&,,&WK_BO_QTY&,,&VBDPL-VRKME(03)&,,

endif

if wk_result is 0 also it is executing the Else part.

what is the problem?

Regards

Sai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
817

try this

/: if &wk_result(c)& eq '0'.

regards

shiba dutta

6 REPLIES 6
Read only

Former Member
0 Likes
817

Hi

Remove the quotes for Zero and see

/: IF &WK_RESULT& EQ 0

,,&VBDPL-VGPOS+2&,,&VBDPL-MATNR&,,<C>&WK_ARKTX(C)&<>,,&WK_ORD_QTY&

,,&WK_HOLD_KCMENG&,,&WK_BO_QTY&,,&VBDPL-VRKME(03)&,,

/: ELSE

,,&VBDPL-VGPOS+2&,,&VBDPL-MATNR&,,<C>&WK_ARKTX(C)&<>,,&WK_ORD_QTY&

,,&WK_RESULT&,,&WK_BO_QTY&,,&VBDPL-VRKME(03)&,,

/: ENDIF.

Activate the script debugger in SE71 and execute the script and see the value that is coming into WK_RESULT and see where it goes now.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

0 Likes
817

In debugging mode wk_result value is 0.If i use without quotes also it is going to else part.

Regards,

Sai

Read only

Former Member
0 Likes
817

Hi,

See how u have declared the variable &wk_result&. If it's a numeric, u can use the syntax

&wk_result& EQ 0

Else if its character, may be u gotta use

&wk_result& EQ '0'

Please see if this is the reason,

Thanks,

Viji

Read only

Former Member
0 Likes
817

Hi Sai

Try like this.

/: IF &EKPO-PSTYP& = '9'

&EKPO-NETPR&

/: ELSE

&EKPO-ZWERT&

/: ENDIF

Regards

Pavan Kumar

Read only

Former Member
0 Likes
818

try this

/: if &wk_result(c)& eq '0'.

regards

shiba dutta

Read only

0 Likes
817

Thx its working now..

Regards,

Sai