11-26-2007 6:19 AM
Hi SDN's
I am working on 4.6C version.
I have an internal table ITAB with Sales Group as one of its field.
I have Sales Group SO_VKGRP on the selection screen as select-options no intervals.
Now my problem is if the SO_VKGRP has some entries in the excluding list,then the check statement is failing.
<b>I know i am wrong at some point. Correct me.</b>
loop at ITAB.
IF NOT p_spart IS INITIAL.
SELECT SINGLE * FROM knvv
WHERE kunnr EQ itab-cust_acct AND
spart EQ p_spart.
CHECK sy-subrc EQ 0.
ENDIF.
IF knvv-spart = 'H1'.
IF NOT so_vkgrp[] IS INITIAL.
CHECK knvv-vkgrp in so_vkgrp.
" wil this be correct if i have entries in the
" excluding tab of select options
ENDIF.
<Some modifications and validation are done here>
ENDIF.
endloop.
Regards
Pratyusha
11-26-2007 6:28 AM
HI
CHECK log_exp.
If the statement CHECK is executed outside a loop and log_exp is incorrect, the statement terminates the current process block. You can specify any logical expression for log_exp.
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 (see CHECK (Loops) ).
11-26-2007 6:28 AM
Hi Pratyusha,
If the check statement is executed outside a loop,if the logical expression is incorrect, it exits the current processing block.
So change your coding accordingly and check.
Regards
Sayee
11-26-2007 6:57 AM
Thanks to both, but my Question is will it consider the values that are given in the exclude tab or not.
That means the SO_VKGRP which is having some entries in the EXCLUDE TAB will they be considered during the check or not?
Thanks
Pratyusha