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

Report looping skip??

Hi,

iam using function module "Reuse_alv_hiersqe_list_display" for displaying header and item data.

In header and item their is a quantity field and i need to subtract each value of item with the header value and check if the value is -ve or +ve with respect to material no.

means here for every material their will be few items available and i need to check on these items w.r.t material. Now when the value is +ve continue with the same material and if it is -ve skip the material and go for next material with in the same loop.

here if the material-item value in the middle if it is -ve i need to skip that material and go for next material.

So in the middle of the items how should i skip the looping for that material and go for another material.

Please let me and your help will be aphreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2009 at 07:41 AM

    Hi,

    You can use "CONTINUE" Statement as shown in the sample code,

    LOOP at itab.

    if itab is -ve value.

    CONTINUE.

    else.

    your logic.

    endif.

    END LOOP.

    It retrieves the next value and does the process.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      Try this code:

      DATA:
      V_FLAG TYPE FLAG,
      ITAB1 TYPE STANDARD TABLE OF TY_TAB. 
      
      ITAB1[] = ITAB[].
      
      SORT ITAB1[] BY MATNR.
      
      DELETE ADJACENT DUPLICATES FROM ITAB1 COMPARING MATNR.
      
      LOOP AT ITAB1.
        LOOP AT ITAB WHERE MATNR = ITAB1-MATNR.
      * Do your calculations here when net qty is -ve set the flag V_FLAG  = 'X'.
          IF V_FLAG = 'X'.
            EXIT.
          ENDIF.
        ENDLOOP.
        CLEAR V_FLAG.
      ENDLOOP.
      

      Hope this helps.

      BR,

      Suhas

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 08:39 AM

    i have solved

    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.