Application Development and Automation 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: 
Read only

help regd to CHECK statement

Former Member
0 Likes
382

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

3 REPLIES 3
Read only

Former Member
0 Likes
356

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) ).

Read only

Former Member
0 Likes
356

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

Read only

Former Member
0 Likes
356

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