‎2008 May 06 6:12 AM
hi,
Why exit and check can only used in loop , why cannot it be used in if ... else statement ?
this warning message was reported by extended check.
‎2008 May 06 6:21 AM
Hi,
If. endif.
is a conditional statement.
The conditional statement is not a loop statement.
if you use the same in conditional if the check is not satisfied with the condition.the it will go directly to the end of the program.
that is the reason why we not use the same in between if and endif
Regards,
madan
‎2008 May 06 6:21 AM
Hi,
If. endif.
is a conditional statement.
The conditional statement is not a loop statement.
if you use the same in conditional if the check is not satisfied with the condition.the it will go directly to the end of the program.
that is the reason why we not use the same in between if and endif
Regards,
madan
‎2008 May 06 6:25 AM
hi,
if lv_tmp is initial.
return.
endif.
There will be 3 lines,
but
check lv_tmp is not initial.
need only one line.
Why not use it?
Best regards,
‎2008 May 06 6:40 AM
Hi Blake Le,
RETURN
This statement immediately ends the current processing block. It can appear in any area of a processing block and ends this block regardless of which statement block or control structure the statement is in.
After leaving the processing block, the runtime environment, except for the reporting event blockSTART-OF-SELECTION, follows the schema in Leave processing blocks.
After you end the reporting event block START-OF-SELECTIONwith RETURN, the runtime environment does not trigger any further reporting events, rather, it calls the list processor directly to display the basic list.
CHECK
If the statement CHECK is executed outside a loop and log_exp is incorrect, the statement terminates the current process block.
The behavior of the runtime environment after exiting the processing block is described under Exiting Processing Blocks.
SAP recommends to use this procedure with the statement CHECK only inside loops
Hope this helps...
Best regards,
raam
‎2008 May 06 6:47 AM
‎2008 May 06 7:07 AM
Hi,
Blake,
if....else is a condotional statement that iterates only once. There is no chance of iterating more than once.
The main intention behind using EXIT and CHECK is to come out of a situation which is not satisfies a certain condition at some point of time during iteration. This iteration is not possible in IF condition. because it executes only once.It contains ELSE condition.It specifies what to do IF condition fails.
This is the main reason behind SAP suggestion
CHECK is used in loops.
If useful, reward points.
Thank u
Prasad G.V.K