02-25-2011 7:23 AM
Hii all..
I have a report in which i have attached a LDB...in this report I want that GET statement should get execute depending on One check condition otherwise i am fetching data in report itself...
CHECK NOT p_abc IS INITIAL
AND NOT p_xyz IS INITIAL.
GET zxyz_hdr.
but even if this condition is false GET statement is getting executed and data is coming from LDB...
Is there any way that i can stop execution of GET statement depending on some condition???
Regards Dhiraj B,
02-25-2011 7:47 AM
Since, it is an event you cannot control the call of the event based on the condition. But what you can do alternatively is control the flow after the event is triggered.
May be you can reverse your condition. Something like this,
GET zxyz_hdr.
if p_abc is initial and p_xyz is initial.
reject.
endif.
Or you can also use STOP statement so that control will go to End of Selection if your condition is not met. Something like this,
if p_abc is initial and p_xyz is initial.
STOP.
endif.
GET zxyz_hdr.
Regards
Ranganath
02-25-2011 7:45 AM
Hi,
try it with an if condition instead of check.
if p_abc <> initial and p_xyz <> initial.
get....
endif.
regards Nicole
02-25-2011 8:47 AM
Dear Nicole,
IF condition will gives an ERROR...because GET can not be written between IF..ENDIF.
02-25-2011 7:47 AM
Since, it is an event you cannot control the call of the event based on the condition. But what you can do alternatively is control the flow after the event is triggered.
May be you can reverse your condition. Something like this,
GET zxyz_hdr.
if p_abc is initial and p_xyz is initial.
reject.
endif.
Or you can also use STOP statement so that control will go to End of Selection if your condition is not met. Something like this,
if p_abc is initial and p_xyz is initial.
STOP.
endif.
GET zxyz_hdr.
Regards
Ranganath
02-25-2011 9:18 AM
Hi ,
Yes..u can write "Return" in the if , endif statement and that will retrun from the current block. And certainly, it will not execute GET statement.
Rakesh