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: 

help regd to CHECK statement

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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