Application Development 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: 

GET statement in report

dhiraj_bhatia1
Explorer
0 Kudos

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,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Hi,

try it with an if condition instead of check.

if p_abc <> initial and p_xyz <> initial.

get....

endif.

regards Nicole

0 Kudos

Dear Nicole,

IF condition will gives an ERROR...because GET can not be written between IF..ENDIF.

Former Member
0 Kudos

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

Former Member
0 Kudos

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