Skip to Content
author's profile photo Former Member
Former Member

help regd to CHECK statement

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06: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) ).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.