How to break a loop when if condition is not satisfied

Hi,
I need some help on the following code. I know how to use CONTINUE or EXIT in loop but the problem is inside the loop i am using subroutine in which i am using if conditions. if one of those if conditions are not satified then it has to come out of the subroutine without executing remaing statements.
sample code is as follows:
loop at itab into wa_tab.
perform check. using wa_tab changing it_tab.
endloop.
form check using ix_tab type itab
.                changing ir_tab type it_tab.
if x is not INITIAL.
else.
"COME OUT OF THE ROUTINE"
endif.
if y is not INITIAL.
else.
"COME OUT OF THE ROUTINE"
endif.
in the above code if x is empty i have to come out of the subroutine without executing next if condition.

Hi,
loop at itab into wa_tab.
perform check. using wa_tab changing it_tab.
endloop.
form check using ix_tab type itab
. changing ir_tab type it_tab.
if x is not INITIAL.
else if y is not INITIAL.
else.
"COME OUT OF THE ROUTINE"
endif.
endform.
or
loop at itab into wa_tab.
perform check. using wa_tab changing it_tab changing lv_errflg.
IF LV_FLAG EQ 'X'.
EXIT.
ENDIF.
endloop.
form check using ix_tab type itab
. changing ir_tab type it_tab.
if x is not INITIAL.
else if y is not INITIAL.
else.
"COME OUT OF THE ROUTINE"
lv_flag = 'X'.
endif.
endform.
Thanks,
Mahesh

Similar Messages

  • How to stop while loop when a specified function is terminated?

    I want to make a program which has 2 thread, one of which is to control some devices, and the other is to measure outputs of the devices.
    To do that, I should make a 2 independent loops, but there comes a problem here.
    I want to terminate 2 loops at the same time, but it's difficult for me to do that, because when I try to notify upper sequence's termination to lower loop by some value change, they have some dependency.
    That's why I need your help. I want to know how to stop lower loop when the upper sequence's termination keeping their independency.
    Please let me know. Thank you.
    Attachments:
    help.JPG ‏200 KB

    Is the upper loop commanding the lower loop at all?  I would think you would have some type of communication between the loops.  Just use that communication to send a stop command.  Or the next best way is to just simply use a notifier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I have a new computer and my old drive has my UNSAVED bookmarks on it and I want to import them, how do I do it when the bookmarks are not SAVED?

    I have a new computer and my old drive has my UNSAVED bookmarks on it and I want to import them, how do I do it when the bookmarks are not SAVED?

    You can backup the bookmarks on the old computer and create a JSON or HTML backup and restore or import this file in the Bookmarks Manager (Bookmarks > Show All Bookmarks).
    You can use an USB stick to transfer the saved bookmarks file to the new computer.<br />
    You can also copy the places.sqlite file from that computer to have the bookmarks and the history.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • Regex: How do I match only when a string is not entirely numeric?

    Hi,
    I'm using java regular expression pattern matching. I want to receive a successful pattern-match ONLY when a string is NOT comprised entirely of numeric digits [0-9].
    So, for example, when pattern-matching on the following 3 strings,
    "abcdef" would return match = true and
    "abc123" would return match = true and
    "123456" would return match = falseI have tried using the regex pattern [^0-9] but this only seems to work for strings that are one character long. The pattern [^0-9]+ didn't work either.
    What I need is the equivalent pattern to [^\d+] (which is an invalid pattern).
    Please note that I have to solve this one using regular expressions, even though it would be trivial to solve using straight java code!
    Any help much appreciated.

    What I need is the equivalent pattern to
    [^\d+] (which is an invalid pattern).Well as its an invalid pattern, how exactly do you expect us to know what you mean by it?!?
    Based on your textual description of what you want, and on the basis that you seem not to want to negate theopposite, how's this (I assume we're talking core Java regex's?):
    myString.matches(".*[^\\d].*");

  • How to stop a second while loop when the condition in the first one is met for different VIs

    Hi, am running two seperate Vi's. am new to labview so please help accordingly.
    I have introduced a comparison test  in one Vi through ashift register. i would like now the second Vi to stop when this comparison condition in the first Vi is met. 
    I dont want the first Vi to stop, it should only stop the second Vi while awaiting for the next input.
    waiting for your help guys

    Thanks so much guys. am now starting to pick some ideas. i have attached the Vis as requested for best identification of the help.
    waiting help guys
    best regards
    Alex
    Attachments:
    first Vi.vi ‏132 KB
    second vi.vi ‏149 KB

  • How to exit infinite loop when using gotopage( )

    I have 10 Pages in one script. At page 9, I want to call page 2 , page 3 and page4
    The method is : RSWApp.GotoPage (2)
    At page 9 it will run infinite loop page2-page4, How can I stop this loop at Page4
    Thanks
    Julia

    Hi, I have a question follow up on this.
    For example:
    I have 5 pages:
    Page 1
    Page 2
    Page 3
    Page 4
    Page 5
    In Page 1, I have an VBA that look like this:
    if something then GoToPage 2
    if otherthing then GoToPage 4.
    But I only want when the page get to Page 3, then this iteration is finished and don't want to keep going to Page 4 and Page 5.
    How do I stop it or restart another iteration, start all over from Page 1?
    I have tried "RSWApp.StopIteration", look up some end, exit, etc, doesn't seems work.
    Thanks

  • How I break while loop activity in BPEL process

    Hi Guys,
    I want to do a polling action in my bpel process, I put in the polling code in while activity ,
    I try two way to do the break :
    1. use the Flow activity , one sequence for while loop activity , one sequence for timeout flow , put waiting activity in it ,config timeout ... but Flow activity complete only when all branch complete . so it seems there is no way to break Flow from one branch.
    2.use onalarm branch of scope ... put while activity code in a scope activity , create onalarm branch for this scope ,config the timeout time ... but onalarm branch can't bypass the scope sequence...
    Any advice ?
    Thanks
    Kevin
    Edited by: kyi on Oct 29, 2009 1:01 PM

    The on-alarm branch of the scope should work.
    Maybe not so neat but you could try to do a scope with a flow within that. Put in one of the flow-branches a wait. After the wait throw an exception.
    You can catch that exception in a catch branch of the surrounding scope.
    Regards,
    Martien

  • How to modify "From" header when certain condition met on "Return-Path" header

    We are activating TLS enforcement (STARTTLS) between our customer domain (@tls.customer.com) and their business partner (@tls.partner.com) on internet MTA (Cisco ESA C370 running AsyncOS 8.0.1-023)
    Customer is managing their internal mail infrastructure and have user mail domains based on country. So for example user X in Switzerland will have sender address: [email protected]
    My understanding is that their are using IQ Suite software to re-write sender address into [email protected] to be able to enforce TLS based on this domain.
    So far so good until the business partner at receiving end mentioned that they receive reply-to: [email protected] but from: [email protected]
    And this will interfere with the policy at their end that require both sender header fields to be the same.
    My customer mentioned that they have modified both "From" and "Sender" fields using IQ Suite but somehow on our IronPort we are seeing both appears on "From":
    From: <[email protected]>, <[email protected]>
    And on message tracking I can see DKIM matching on [email protected] rather than on [email protected]
    Message 218480027 (51299 bytes) from [email protected] ready.
    10 Feb 2015 09:13:27 (GMT +01:00)     Message 218480027 matched per-recipient policy DEFAULT for outbound mail policies.
    10 Feb 2015 09:13:27 (GMT +01:00)     Message 218480027 is not signed. No domain key profile matches [email protected]
    10 Feb 2015 09:13:27 (GMT +01:00)     Message 218480027 successfully signed. DKIM ch.customer.com-DKIM matched ch.customer.com.
    10 Feb 2015 09:13:27 (GMT +01:00)     Message 218480027 queued for delivery.
    So I suspect that customer internal mail still has [email protected] on "From" header and [email protected] on "Return-path" header.
    The question is how can I modify "From" header to match that on "Return-path" before sending it to partner.
    Appreciate the feeback.

    From my tests and knowledge.
    We cannot manipulate the From: header to use the variable of the return-path/envelope sender.
    However if you know specifically what to re-write then we can specially re-write the From: header to a specific address.
    This is done as;
    Content filter or message filter condition set
    Action would be:
    insert-header("From", "[email protected]")
    This is all i can think of for this type of request

  • How to work with loops if certain condition to be fulfill.

    Hi,
    I have following conditions.
    itab1
    seq  plant storage loc  material
    01    p1      s1                m1
    02    p2      s2                 m1
    03   p3      s3                m1 
    itab2
    material   plant   storage loc.      date                      qty.            mrp area
    m1              p1       s1                00000000          0 or q1          mr1
    m1              p1       s1                20140102           0 or q1         mr1
    m1              p1       s2               00000000            0 or q1          mr1
    m1              p1       s3                00000000           0 or q1          mr2
    m1              p1       s3                20140102          0 or q1           mr2
    now I have to pick the qty from itab 2 as follow.
    I need to see first seq (01) in itab1 first and for that I have to pick the desired qty (suppose 6). first with the storage loc s1.
    it should search in itab2 for s1 with date 000000.this belongs to mrp area mr1.if it finds the sufficient qty then process the remaing logic otherwise
    it should search with other storage loc s2 in same mrp area MR1 where date is 000000.if not then go with s3 but as s3 has diff mrp area.so now it should come back and search with s1 where date is not 0000000. then with s2 with same condition.after that it should go with other mrp area.
    I am trying but not able to achieve it completely. please help me to code this.

    Hi Prashant,
    Please find the below code.
    "Loop the Header table
    LOOP AT ITAB1 INTO WA_TAB1.
    "Read the Item table
    READ TABLE ITAB2
           INTO WA_TAB2
           WITH KEY MATERIAL = WA_TAB1-MATERIAL
                           PLANT = WA_TAB1-PLANT
                          STORAGE_LOC = WA_TAB1-STORAGE_LOC.
    IF SY-SUBRC = 0.
       IF WA_TAB2-QTY = 0.
         "Copy the Internal Table
         ITAB2_COPY[] = ITAB2[].
        "Delete Internal Table for different MRP
         DELETE ITAB2_COPY WHERE MRP NE WA_TAB2-MRP.
         "Sort the Internal Table
         SORT ITAB2_COPY
             BY MATERIAL
                   PLANT
                   MRP
                   STORAGE_LOC.
         "Delete the Adjacent record for Storage location
         DELETE ADJACENT DUPLICATES ITAB2_COPY COMPARING MATERIAL
                                                                                                         PLANT
                                                                                                         MRP
                                                                                                         STORAGE_LOC.
         "Using Parallel cursor read the next records from Item table
        LOOP AT ITAB2_COPY INTO WA_TAB_CP.
         "Check condition for different materials
           IF MATERIAL = WA_TAB2-MATERIAL
               PLANT    = WA_TAB2-PLANT
               MRP = WA_TAB2-MRP.
              "Exit from the Loop
                EXIT.
      ENDIF.
      "Check Quantity
      IF WA_TAB_CP-QTY <> 0.
         "Move the corresponding value
           MOVE-CORRESPONDING WA_TAB_CP TO WA_FINAL.
          "Assign Quantity
           WA_FINAL-QTY = WA_TAB_CP-QTY.
          "Append Internal Table
           APPEND WA_FINAL TO IT_FINAL.
         "Clear WA
          CLEAR WA_FINAL.
         "Come out from the Loop
           EXIT.
      ELSE.
            "Continue the next Record
           CONTINUE.
      ENDIF.
    ENDLOOP.
    ELSE.
          "Move the corresponding value
           MOVE-CORRESPONDING WA_TAB2 TO WA_FINAL.
         "Assign Quantity
           WA_FINAL-QTY = WA_TAB2-QTY.
          "Append Internal Table
           APPEND WA_FINAL TO IT_FINAL.
          "Clear WA
          CLEAR WA_FINAL.
          "Continue the next Record
           CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    Regards
    Rajkumar Narasimman
    Message was edited by: Rajkumar N

  • How to create a looping music player that does not restart when you go to other pages

    Hello
    I am new to web design. I apologize if I do not use the write
    terminology. I am designing a website. I want to have a song that
    loops continuously throughout the site and does not restart when
    you click on the different pages. I have included a link to a site
    that I found that does what I want to do. (Hopefully this link will
    give you a better idea of what I am trying to describe)
    http://www.marcuscoleministries.com/index2.html
    Thanks for your time and consideration

    You will have to use frames which in itself is a bad idea.
    IMO music that
    plays automatically is a terrible idea. It is likely to drive
    away many
    visitors and is unlikely to retain even a single visitor.
    Avoid frames. Drop the music. You'll be happy you did.
    Walt
    "dbone1" <[email protected]> wrote in
    message
    news:fn36v6$de7$[email protected]..
    > Hello
    >
    > I am new to web design. I apologize if I do not use the
    write terminology.
    > I
    > am designing a website. I want to have a song that loops
    continuously
    > throughout the site and does not restart when you click
    on the different
    > pages.
    > I have included a link to a site that I found that does
    what I want to do.
    > (Hopefully this link will give you a better idea of what
    I am trying to
    > describe)
    http://www.marcuscoleministries.com/index2.html
    >
    > Thanks for your time and consideration
    >
    >

  • Exit a loop when the condition in if succeed

    Hello everbody:
    LOOP ....
    IF ...
    "If the sentence here succeed I want to exit of the loop.
    ENDIF.
    ENDLOOP.
    Some ideas please

    Hi
    Try this
    Loop ....
    if 1=1
    begin
         goto ExitLoop
    end
    ExitLoop:
    Regards

  • How to find the error when client proxy is not successfully triggered?

    Hi all,
    I want to consume a .NET service in SAP.
    But when I want to test the client proxy the following error occur:
    GENERAL_ERROR Error duing proxy processing (PART
    UNKNOWN (NULL) )
    Transaction ST11:
    TRACE SOAP RUNTIME - trace records                                                                               
    E CONTEXT 20090518061404.5255720 : CL_SOAP_CONTEXT ->SET_FAULT   
    SOAP runtime fault handling                                                                               
    E SOAP_RUNTIME 20090518061404.5256990 : CL_SOAP_RUNTIME_CLIENT   
    ->EXEC_PROCESSING Exception handling in SOAP runtime                                                                               
    E CONTEXT 20090518061404.5255620 : CL_SOAP_CONTEXT ->SET_FAULT set
    fault loop detected                                                                               
    E SOAP_RUNTIME 20090518061404.5256920 : CL_SOAP_RUNTIME_CLIENT                                   
    .NullPointerException:                                           
    Transaction SM21:
    SOAP Runtime Protocol: SOAP Fault exception occurred in program CL_SOAP_RUNTIME_ROOT==========CP in include CL_SOAP_RU NTIME_ROOT==========CM004 at position 80
    SOAP Runtime Protocol: Exception message: Severe processing error; SOAP fault handling required
    How can I find what's wrong????
    This error logging is not really helpful to me...
    Any ideas?
    regards

    Hello Mr. Bauer,
    Will you please elaborate on your solution to fix this issue?
    We are facing this issue too.
    Thanks in advance.
    Regards,
    Victor

  • I accidentaly clicked "remove" when using find my iphone...how do I log in when my iphone is not with me to find it?

    i was using "find my iphone" and when given the location it was an old location. A post read that the iphone was either turned off or the wifi was not being used. A remove or cancel  button appears with this message. I accidentally clicked cancel and now when trying to retrive information about the location of my device it says that I must refresh page or set up instructions. There must be a way to reinstate my account without my device physically present but I do not know how...can someone help me?

    What ever device you still have on had.  Go to settings - general - about - name - then the name.
    I have 4 devices 2 iphone and ipad - which I've name differently so I don't get confused when using find my iphone.

  • How to update my iphone when it says im not connected to the internet when i am?

    I know how to update my iphone but it says that im not connected to the internet, when i actually am?!
    Does anybody know how to solve this problem?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Console in the page that opens.
    Select "/var/log/install.log" from the file list. Post the messages from the last installation attempt, starting from the time when you launched the Installer or Software Update.
    Post the log text, please, not a screenshot. If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.

  • How to stop closing RR when sample size is not fully checked

    Hi
    My scenario is as follows:
    My sample size in RR is 10 where as results recorded are only for 7.(Single result). In such cases, RR should not be allowed to close. Should be allowed to close only when results are recorded for 10 nos.
    How to do this?
    Thanks
    Sudhar

    Hi
    use User exit
    QEEM0011 User exit: add. functions before valuating insp. characs.
    here you can check wheather all 10 nos( or as per sample size) char are entered or not.
    Regards
    Sujit

Maybe you are looking for

  • Quality Inspection Order

    Hello every body,          I have got few queries for which I require answer urgently. Kindly revert back immediately.        Whether the following transactions are possible in Standard SAP without any enhancements. 1. After the Goods recept, is it p

  • Declaring a field of an internal table dynamically...

    Hi all,   I've to use an internal table which contains two field... But i want to define its size at run time as per my requirements... structure of internal table is very simple... <b>types:  begin of ty_tab,             f1 (size i want dynamically)

  • Unable to Sync(mac)

    I am currently unable to sync movies with my iphone, i never had any problems. even synced with 2 pc's and nothing now everytime i attempt to sync from itunes to iphone this message comes up: "The iphone cannot be synced. An unknown error occurred (-

  • JavaHelp for struts

    I have a web application which uses struts. I also have made the help file and have compiled it as a jar file. How should I integrate the help jar file in the web application.

  • Calculating RMS value of data samples in RT

    I am using CompactRIO 9014 in my control application. I am acquiring data from NI 9215 module. I want to calculate RMS value of data coming from this module for monitoring of the system. I want to include data samples within 1sec to calculate RMS val