Loop within a loop

is there anything wrong with this code
clear wa_bseg.
loop at t_final into wa_final.
  loop at t_bseg1 into wa_bseg where belnr = wa_final-belnr
                               and   gjahr = wa_final-gjahr.
*and   zfbdt  = wa_final-zfbdt.
if sy-subrc eq 0 .
wa_final1 = wa_final.
append wa_final1 to t_final1.
clear wa_final1.
endif.
clear wa_bseg.
endloop.
*clear wa_final.
endloop.

Hi,
Instead of using loop within loop , use read statement within loop it will improve program performance.
try this below logic..
clear wa_bseg.
loop at t_final into wa_final.
read table t_bseg1 into wa_bseg with key belnr = wa_final-belnr
                                                            gjahr = wa_final-gjahr.
if sy-subrc eq 0 .
   wa_final1 = wa_final.
   append wa_final1 to t_final1.
endif.
clear: wa_bseg, wa_final1,wa_final.
endloop.
Regards,
N M Poojari.
Edited by: Nilambari Poojari on May 27, 2008 9:06 AM

Similar Messages

  • Student lost ability to audition loops within the loop browser

    Colleagues,
    My students were composing songs using GarageBand 3.0.4 in our Mac Lab.
    Two of my students showed me that, after they'd laid down three or four tracks by dragging loops into the main window, they could no longer get loops to play inside the loop browser. They would click on a loop, and nothing would happen.
    The loop would play once it was clicked and dragged into the window, but it would not play from inside the loop browser.
    Does anyone have any idea what my students might have done that could cause them to be unable to audition loops from within the loop browser?
    Thanks in advance for any insight you might be able to provide.
    Paul Daniels
    Pennridge Central MS
    144 North Walnut Street
    Perkasie, PA 18944

    Just drop them on the Loop Browser and the rest should be taken care of.

  • Avoiding performance issue due to loop within loop on internal tables

    Hi Experts,
                    I have a requirement where in i want to check whether each of the programs stored in one internal table are called from any of the programs stored in another internal table. In this case i am looping on two internal tables (Loop within a loop) which is causing a major performance issue. Program is running very very slow.
    Can any one advise how to resolve this performance issue so that program runs faster.
    Thanks in advance.
    Regards,
    Chetan.

    Forget the parallel cursur stuff, it is much to complicated for general usage and helps nearly nothing. I will publish a blog in the next days where this is shown in detail.
    Loop on loop is no problem if the inner table is a hashed or sorted table.
    If it must be a standard table, then you must make a bit more effort and faciliate a binary search (read binary search / loop from index exit)
    see here the exact coding Measurements on internal tables: Reads and Loops:
    /people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables
    And don't forget, the other table must not be sorted, the loop reaches anyway every line. The parallel cursor requires both tables to be sorted. The additional sort
    consumes nearly the whole advantage of the parallel cursor compared to the simple but good loop in loop solutions.
    Siegfried

  • Help me please someone...In the middle of auditioning loops within a project, all my loops started sounding all wobbly like they are out of phase or something. what can i do to fix this. Thanks

    Help me please someone...In the middle of auditioning loops within a project, all my loops started sounding all wobbly like they are out of phase or something. what can i do to fix this. Thanks

    raise your I/O buffer and raise your Process Buffer Range.
    Logic Pro>Preferences>Audio>Devices>Coreaudio

  • MDS persistence for column within a loop

    Hello,
    I am trying out basic setup of MDS. I was able to make it work for most of my columns except for a column within a loop. I also tried using the ADF Read Only Dynamic table and it is not persisting any of the columns of the table, since it is inside the loop.
    I would like to know if this is a bug when you apply MDS to component that has id that is dynamically incremented/generated.
    mds customization file - c18 i s missing which should correspond to the dynamic column
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <mds:customization version="11.1.1.60.13" xmlns:mds="http://xmlns.oracle.com/mds">
    <mds:modify element="c17">
    <mds:attribute name="displayIndex" value="1"/>
    </mds:modify>
    <mds:modify element="c21">
    <mds:attribute name="displayIndex" value="2"/>
    </mds:modify>
    <mds:modify element="c16">
    <mds:attribute name="displayIndex" value="3"/>
    </mds:modify>
    <mds:modify element="c20">
    <mds:attribute name="displayIndex" value="4"/>
    </mds:modify>
    <mds:modify element="c19">
    <mds:attribute name="displayIndex" value="5"/>
    </mds:modify>
    <mds:modify element="c28">
    <mds:attribute name="displayIndex" value="6"/>
    </mds:modify>
    <mds:modify element="c27">
    <mds:attribute name="displayIndex" value="11"/>
    </mds:modify>
    <mds:modify element="c22">
    <mds:attribute name="displayIndex" value="12"/>
    </mds:modify>
    <mds:modify element="c15">
    <mds:attribute name="displayIndex" value="0"/>
    </mds:modify>
    </mds:customization>
    jspx related to the display, just to show the component id. In blue is the logic/code for dynamically displaying a column and the dropdown and contents of the dropdown
    <af:forEach
    items="#{pageFlowScope.SearchRules.filterBeans}" varStatus="index" var="def">
    *<af:column id="c18" headerText="#{def.parameterDisplayName}">*
    <af:selectOneChoice value="#{row.dataProvider.ruleColumns[index.index].attributeId}"
    disabled="#{!(sessionScope.usersession.ruleAuth.isRoleForCreateEditRule and row.dataProvider.ruleColumns[index.index].isEdit)}"
    clientComponent="true"
    helpTopicId="#{row.dataProvider.ruleColumns[index.index].ruleTypeParameterID}"
    autoSubmit="true" shortDesc="#{row.message}"
    id="soc4445" valuePassThru="true"
    valueChangeListener="#{pageFlowScope.SearchRules.ccsChange}">
    <af:forEach items="#{bindings.Rule.rangeSet}" varStatus="att" >
    <af:selectItem label="#{row.dataProvider.ruleColumns[index.index].attributes[att.index].assignedAttributeValue}"
    value="#{row.dataProvider.ruleColumns[index.index].attributes[att.index].assignedAttributeID}"
    rendered="#{row.dataProvider.ruleColumns[index.index].attributeSize > att.index}"
    id="si4"/>
    </af:forEach>
    <!--f:selectItems value="#{row.dataProvider.ruleColumns[index.index].attributes}"
    id="si4"/-->
    </af:selectOneChoice>
    </af:column>
    </af:forEach>
    Thanks,
    Catherine

    Hi,
    the problem actually is that the id is the same for all of the occurences. So the forEach loop should create unique IDs for each occurence of a component.
    Frank

  • Looping within table query

    Hi all,
    I've run into a problem... Is there anyway where we can do looping in a table in a single SQL query. Basically the scenario is like this :
    *Consider a table with sample data as follows:
    SQL> select * from TEST2;
    EMPNO JOB REL_DT
    1 SALESMAN 01-NOV-06
    2 MANAGER 01-NOV-06
    1 SALESMAN 01-OCT-06
    2 MANAGER 01-OCT-06
    1 CLERK 01-SEP-06
    *Basically the table has a relationship start date i.e. b/w an Employee and a job title.
    *Is there anyway to know the previous job title held by an employee. Basically the logic is as follows:
    get the max(rel_dt) and get the empno.
    for the same empno. traverse the table for rel_dt<max(previous rel_dt) and where job<>previous job.
    Basically this involves looping within the table to find a previous job. This can be done with a procedure. But is there a way we can construct a single SQL query to meet this requirement?
    Thanks in advance :)

    Woops... Okay.. there's a slight problem .. :(
    consider the table below with sample data:
    SQL> select * from test2;
    EMPNO JOB REL_DT
    1 SALESMAN 01-NOV-06
    2 MANAGER 01-NOV-06
    1 SALESMAN 01-OCT-06
    2 MANAGER 01-OCT-06
    1 CLERK 01-SEP-06
    1 HOUSEKEEPING 23-SEP-06
    How do I select the first date that empno=1 was a 'SALESMAN'? In the above table, he was a 'SALESMAN' first on '01-OCT-06' and was 'HOUSEKEEPING' before this?
    *Basically how do i retrieve empno=1 his first REL_DT for his CURRENT job title?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Sending E-mail with attachment within a loop not working.

    Hi,
    I'm trying to send e-mails with attachment to multiple users with "subject & an attachment" within an ITAB loop.
    SUBJECT for each mail to corresponding user is being sent properly.
    But ATTACHMENT contents are not being sent properly.
    1st ATTACHMENT contents are going to 2nd user(supposed to go to 1st user) & 2nd ATTACHMENT contents are going to 3rd user etc..
    in almost all attempts, last ATTACHMENT contents within the loop were delivered properly to the last user.
    As a test, I'm debugging by sending with same "SUBJECT" & "ATTACHMENT CONTENTS". still it's not working.
    Following is the code for sending mail with same "SUBJECT" & "ATTACHMENT CONTENTS".
    I even refreshed the file contents for each record within the ITAB. Greatly appreciate any help.
    assume that ITAB has a field GROUP with values 501, 502, 503 & 504.
    SUBJECT is the subject of e-mail & DIST_LIST is the e-mail id of the corresponding user.
    DATA:
        MAIL_FILE(20) TYPE C,
        MAIL_TEXT(200) TYPE C,
        COMMAND(512) TYPE C,
        DIST_LIST(425) TYPE C,
        SUBJECT(60) TYPE C.
    DATA: BEGIN OF ITAB  OCCURS 0.
            DATA GROUP LIKE /BI0/PGRP-GRP.
    DATA: END OF ITAB.
    LOOP AT ITAB.
    SUBJECT = ITAB-GROUP.
    IF ITAB-GROUP = '501'.
    DIST_LIST = '[email protected]'.
    ENDIF.
    IF ITAB-GROUP = '502'.
    DIST_LIST = '[email protected]'.
    ENDIF.
    IF ITAB-GROUP = '503'.
    DIST_LIST = '[email protected]'.
    ENDIF.
    IF ITAB-GROUP = '504'.
    DIST_LIST = '[email protected]'.
    ENDIF.
    clear MAIL_FILE.
    clear MAIL_TEXT.
    UNASSIGN <FILE1>.
    CONCATENATE '/tmp/' SY-UNAME '.txt' INTO MAIL_FILE.
    TRANSLATE MAIL_FILE TO LOWER CASE.
    OPEN DATASET MAIL_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      MAIL_TEXT = ITAB-GROUP.
      TRANSFER MAIL_TEXT TO MAIL_FILE LENGTH 200.
    CLOSE DATASET MAIL_FILE.
    clear MAIL_TEXT.
      CONCATENATE '< ' MAIL_FILE INTO MAIL_TEXT SEPARATED BY SPACE.
      ASSIGN MAIL_TEXT TO <FILE1>.
    *Create UNIX MAIL Command
      CONCATENATE 'mailx -s'
      '"' SUBJECT '"' '"'  DIST_LIST  '"' <FILE1>
        INTO COMMAND SEPARATED BY SPACE.
    Send the E-mail
      CALL FUNCTION 'RFC_REMOTE_EXEC'
        DESTINATION 'SERVER_EXEC'
        EXPORTING
          COMMAND = COMMAND
        EXCEPTIONS
          OTHERS  = 04.
    ENDLOOP.

    Hi Zhenglin,
    thanks for your reply.
    Now, it's working after I changed attachment file name (user name) with ITAB-GROUP.
    but, I'm not clear on why it was not working even if the file name is same in every loop, as I'm unassigning the file contents and loading new contents at the start of each loop.
    anyhow, it's working and many thanks for your help.

  • Adding loops to the loop browser.

    I'm using mac os 10.4.11. I have placed all my loops on an external hard drive.
    1) Are only apple loops allowed to be added or aiff loops in general as well?
    2) when adding loops to the loop browser should one add an entire folder if they are in a folder or just the files within a folder? I added a folder of flutes but can not find flutes anywhere in the loop browser file list.
    3) As I didn't want the loops within the jam pack voices, and rhythm section installer packages to be added to garageband I removed the loops folders from the packages, and dropped them onto the loop browser. When looking in the jam pack management it shows the rhythm section but not the voices. When I again attempted to drop the voices folder it said it was already there, although I still can't see it.
    4) Once I understand how to do this correctly should I trash the loop browser apple loops index file and re-drop all the loops on the browser again to get everything cataloged correctly?
    Thank you,
    Robert

    Select "Add to Loop Library" from the Edit menu!

  • Excel Sheet Looping: For each loop from variable Enumerator

    Hi,
    Is it possible to do excel sheets looping using For each loop Enumerator as "For Each loop from Variable enumerator" ? If yes, please help.
    Also,
    I have an excel file with 10 sheets, but want to loop only 5 sheets. Please help..how can i achieve this. 
    Actually i tried with
    1> stored the 5 sheets name into a variable (say 'SheetsName') of type string using script task
    2> For each loop container
       enumerator - 'For each ADO Schema Rowset enumerator'
       connection: ADO
       schema: 'Tables'
       variable mapping: 'User::SheetsName'
    3> Within For each loop container added a data flow task
    4> Inside DFT - excel source - 
       Data access Mode: 'Table Name or view name variable'
       Variable Name: 'SheetsName'
    but this loops through all the 10 sheets irrespective of only 5 sheets names stored in the variable "SheetsName".
    Please help...
    Please Mark as Answer if my post solved your problem or Vote As Helpful if this helps. Blogs: www.sqlserver2005forum.blogspot.com

    >> Is it possible to do excel sheets looping using For each loop Enumerator as "For Each loop from Variable enumerator" ? If yes, please help.
    I don't think so. To loop through all worksheets of Excel For ADO.NET Schema Rowset Enumerator is the only option.
    Please refer:
    https://msdn.microsoft.com/en-us/library/ms345182(v=sql.110).aspx
    >> I have an excel file with 10 sheets, but want to loop only 5 sheets
    So you have configured For Each loop container which loops throgh all sheets and returns you sheet name to variable "SheetName".
    Drag and drop one Sequence Container inside ForEach Loop Container and connect it to Data Flow Task.
    Right click on connector and use expression: (which will check if current sheet is one of 5 required sheets)
    @User::SheetName == "FirstSheet" ||  @User::SheetName == "SecondSheet" || .....
    Below blog demonstrates kind of simillar steps:
    http://www.bidn.com/blogs/MikeDavis/ssis/559/ssis-skip-certain-files-in-a-for-each-loop 
    -Vaibhav Chaudhari

  • Installed Jam Pack but see no new loops in Garageband loop browser. Why not?

    I successfully installed Jam Pack but don't see new loops in Garageband loop browser. Is there some extra step I'm supposed to do? Before, I had about 57 Rock/Blues loops, and I still have just that. I had 14 instruments under All Drums, and guess what? Still only 14.
    I know the install completed successfully - it said so, anyway.
    Clues?

    Have you filters set on the Loop Browser?  Make sure the GarageBand Preference "Loops > Keyword Browsing > Filter for more relevant content" is off.  Otherwise you will  see a fraction of the available loops.
    To see, if the JamPack has been installed, set the pop-up meu at the top of the Loop Browser to "Rhythm Section". Is that available?
    Did you reindex your Loops after installing the Jam Pack? And did you restart the Mac? In Mt. Lion only restarting a Mac will ensure, that an application is not resumed from a cache, when you launch it again.Restarting the Mac will terminate GarageBand for sure.
    If restarting the Mac does not make the JamPack Loops show, rebuild the Loop index.  See:  Rebuilding the Loop Index in GarageBand 6 or earlier - Apple Support

  • When I Drag Loops To The Loop Browser...

    All my loops are in the folder /Library/Application Support/GarageBand/Apple Loops. I dragged them over from the finder to the loop browser in GB, and it looks like it copied all of them to another folder user/Library/Audio/Apple Loops/User Loops/GarageBand/Apple Loops. ***?! What a mouthful. Is this the new default location for all of my loops? Can I change that? Can I erase the Application Support/Garageband folder now? I would like to reclaim the 12+ GB of space.

    As far as I can make out GB needs to store your loops in both Application Support and Audio. The Application Support/GB folder also contains other resources, such as software instruments and channel presets etc., so DON'T DELETE IT!!
    In the Audio folder the GB loops will normally be stored in Apple Loops/Apple/Apple Loops for GarageBand, not in the User Loops Folder. When you dragged them to the browser, GB thought they were a new set of loops and put them in User Loops; so as long as they are still in Apple Loops/Apple/Apple Loops for GarageBand, go ahead and delete them from the User Loops folder. Like I said above, GB seems to store the loops in two locations by default (no Idea why), and I think it's best not to screw around with stuff in the Library under OSX.
    BTW, why did you drag them to the browser in the first place? Had they not appeared there when you installed?

  • Apple Loops and the Loop Browser

    maybe I'm missing something here, but whenever I save an edited audio file (or loop) with Apple Loops I can never seem to find the same file in the Loop Browser.
    (unless that is how the app is suppose to behave ...)
    I assumed the Loop Browser behaves somewhat like Logic's Project Manager, referencing and finding files that are associated with Logic Sessions.
    Long story shot, how can i save my edited Apple Loop files and still find them using the Loop Browser
    Thanks.

    The additional content is not just the loops. It is also all the samples for the instruments etc.
    You are correct, however, in the method of moving the loops.

  • How do you turn third-party midi loops into Apple Loops?

    Does anyone know how to turn third-party midi loops into Apple Loops? I've got hundreds of short midi files that I purchased, and I would like to be able to use them in the loop browser of Logic Studio. I tried some of the obvious ways of doing this, like using Apple Loop Utility, but it doesn't seem to recognize .mid files. Seems like .mid files would be right up its alley, so maybe I'm doing something wrong...

    Yes, have the same problem but with wav loops. i have 75000 wav loops from third part and do not find how to "logicized" it. For the moment i can use them into a project but they are not adapting when i change the bpm of the projetc for exemple.
    If you know the solution i would be rescued

  • Smart form - loop inside a loop

    Dear Techies,
      I am new to smartforms. I have a query, in one of the code examples there is a context menu on the main window called "complex selection", but i dont find the same in my editor, what is the reason.
      I want this because i have data in two internal tables. Different tables are generated from secondary depending on the entries in first table. how do i achieve this on the main window.
    Similar to loop inside a loop, depending on my first table entries, all the entries belonging to that entry are to be put in table of second entry. i will have tables equal to the entries in first internal table. hope my question is clear.
    Please help.
    Regards
    imran.

    Hye..
      Loop in main area will fill only the current table, but i want several tables depending on entries in the first internal table.  The number of tables in the main window will be the number records in the first table.
    Regards
    imran.

  • Loop in a loop

    Hello!
    How do you feel is it ok to use a loop in a loop in a web application?
    for (Iterator i = collection1.iterator(); i.hasNext();)  {
          for (Iterator l = collection2.iterator(); l.hasNext();) {
               collection3.add(l.next());
    }

    Hello!
    How do you feel is it ok to use a loop in a loop in a web application?Sure, why not? A loop in the body of another loop is fine ...
    > for (Iterator i = collection1.iterator(); i.hasNext();)  {
    for (Iterator l = collection2.iterator(); l.hasNext();) {
    collection3.add(l.next());
    }But in this particular case you can rewrite the above as:for (Iterator i= collection1.iterator(); i.hasNext(); )
       collection3.addAll(collection2);kind regards,
    Jos

Maybe you are looking for

  • Neo V very Slow after ICS Update.. :(

    Updated to ICS on my Neo V and facing many issues. The major issue is that ph.is very slow and hangs a lot if 2-3 apps are running at the same time and at the time when ph. hangs not even the power button works, the only option is to reinsert the bat

  • It's happened again! Problem with replacement screen (mysterious dark O ring in the centre)

    I had my screen replaced for a dark O ring appearing in the centre about half a year ago. It must be caused by the apple logo on the reverse. It's now starting to happen again and my 3 year applecare has run out What can I do? Does a new screen come

  • How using ABAP function in fox formula ?

    Hello, I want to launch standard function :"RSW_CURRENCY_TRANSLATION" by Fox formula. I declare this function in SAP Table :rsplf_fdir, and I can call this function by fox, with all parameters. But when I want to use it, I've a problem with the first

  • Anonymous user placing order

    Is there any way to reinitialize the profileId after an anonymous profile places order. Basically, I need a different profile Id for every order in case of anonymous user.

  • [Solved]running dota 2

    Hi Are are there any good links to running dota 2 from arch linux ? Thanks Last edited by neoDEH (2014-10-02 18:19:51)