2008 Apr 10 7:45 AM
hi,
may i know why the if statement doesn't work in sapscript?
IF &BSID-BUDAT& GE &RF140-DATU1&
xxxx
ELSE
yyyy
ENDIF
(where &BSID-BUDAT& = 07.01.2008 and &RF140-DATU1& = 01.03.2008)
actually march is greater than january but it still able to perform xxxx.
it should perform yyyy and not xxxx.
can have the advice?
thanks
rgds
2008 Apr 10 8:00 AM
Dear,
you have to do this in order to resove the problem.
create a variable say z_status in your program not in script.
then in program write this.
data: z_staus type C.
if bsid-budat GE rf140-datu1.
clear z_status.
z_status = 'Y'.
else.
clear z_status.
endif.
now in sapscript.
IF z_staus eq 'Y'.
xxxx
ELSE
yyyy
ENDIF
reward if useful.
Amit Singla
2008 Apr 10 7:53 AM
check whether you have given '/:' in the tag column where if, else
and endif are written.
Syntax:
/: IF &var& = char val
/: ENDIF
2008 Apr 10 7:57 AM
hi,
this is the basic requirement. I did that of course.
but the IF statement cannot work.
Any Helps?
thanks
rgds
2008 Apr 10 7:57 AM
Hi,
just see this:
/:IF &BSID-BUDAT& GE &RF140-DATU1&
*xxxx
/ELSE
*yyyy
/:ENDIF
use like this.
Regards,
If helpful reward with points(Don't forget).
2008 Apr 10 8:00 AM
Dear,
you have to do this in order to resove the problem.
create a variable say z_status in your program not in script.
then in program write this.
data: z_staus type C.
if bsid-budat GE rf140-datu1.
clear z_status.
z_status = 'Y'.
else.
clear z_status.
endif.
now in sapscript.
IF z_staus eq 'Y'.
xxxx
ELSE
yyyy
ENDIF
reward if useful.
Amit Singla