Hi Rahul, i think total iteration should be 11 as we are also hitting exit statement three times so loop will run 8 times for the data record and 3 times for exit statement. Correct me if i'm wrong.
Hi Sir Please tell about the parallel processing concept sir I have one query can we do a parallel processing technique for submitting reports by using job open and job close if you have any info on that please share any blogs
Great explaination. I have a question. Does the sy-tabix returns current loop iteration or returns the index number from where data transferred to work area?
Thank you. If you are Looping or reading based upon a condition then in that case, it will return the index of the matching record based upon that condition. In some cases, we need index of matching record in that case we don't even use work area.
Heloo sir my query is - Loop at it_data1 into lwa_data1 from lv_index . Let say lv_index is 4 so it read from 4th row after that how it read from 5th row because we havent incremented lv_index it should always read from 4th row only please clarify this is from v_index will work only for first time from next time it will not consider. ???
LOOP means - It will process the records one by one. If loop is processing for 4th record, so in next iteration, it will process the record 5, 6 and so on. We started the loop from Index - 4, but it will point to next record in next iteration.
Hello Sir, how does it make difference in performance if we sort both tables based on key first and then use nested loops with where condition using key field without using parallel cursor?
LOOP always take all the records in to consideration. Suppose an internal table has 10000 records and based upon where condition there are 2000 records. So loop takes 10000 records in to consideration not 2000. Yes for 2000 the condition is true. We need to stop those 8000 extra iterations. So we make of parallel cursor.
@@mohammednabeel4381 I am not getting the question. How we can put a where condition on main loop as main loop needs to take all records into consideration. Please elaborate your question.
@@sapabapbyrahulmehta , what I meant is below. sort itab1 by matnr. sort itab2 by matnr. loop at itab1 into lwa1. loop at iatb2 into lwa2 where matnr = lwa1-matnr. endloop. endloop. Now the nested loop will execute only based on material number from main loop which has multiple line items in sub loop. It will not execute for other material numbers. Correct? In this way how parallel cursor is more efficient?
@@mohammednabeel4381 No, the second loop takes all the records into consideration. Example - Suppose outer internal table has 5 records and inner internal table has 1000 records. So, for record of outer loop inner loop will continue 1000 times. Passing the where condition only means that it displays the matching records. We need to reduce these 5000 iterations to only 1000 iterations. So we are using parallel cursor.
@@sapabapbyrahulmehta I have the similar question sir, What if it is not in sequence as Order No 1,2,3,4,5,6 and so on. What if the order numbers are like 001abc, 005xyz, means the sequence is not followed it could be anything numeric characters. then how can do this parrellal cursor sir?
Hi. Thanks for great explanation. From my understanding, each loop has its own sy-tabix value, right? When these values are reseted? When program finishes?
Hello Grewicz, Thank you for the feedback. Your understanding is right, each loop has it's own sy-tabix value. When the loop ends, it will reset at that time.
@@sapabapbyrahulmehta but the internal loop keeps its sy-tabix incrementing even when external loop goes to next iteration ( its tabix goes from 0 to 1). Does that mean that inner loop is truly finished (sy-tabix resets) only when outer loop, that contains it, is finished?
@@grzewicz1109 When we see any internal table in the Debugging Mode, the first column is always the index of the rows, the name of the colum is ROW. Whatever the records processed in the first iteration Internally it will mark as processed and in the next iteration SAP simply check the value of ROW column for the new record and that will act as SY-TABIX.
In the parallel curser also we have do the bug analysis like if we add new record in header table. It was not reflecting in the output. You have explained about bug analysis for the normal process. Do We have to do the same process for the parallel cursor? ruclips.net/video/t9H0aGah3ow/видео.htmlsi=2VUvDPlWGQ96WQXv
U are god sir thank u
Now clearly understood when we go for read table,nestedloops,parellel cursor
Great Rajasekhar 👍
Thankyou so much sir 😊
Crystal clear explanation. Thank you so much sir
Thank you very much.
Hi Rahul, i think total iteration should be 11 as we are also hitting exit statement three times so loop will run 8 times for the data record and 3 times for exit statement. Correct me if i'm wrong.
Hi Sir Please tell about the parallel processing concept
sir I have one query can we do a parallel processing technique for submitting reports by using job open and job close if you have any info on that please share any blogs
Great explaination. I have a question. Does the sy-tabix returns current loop iteration or returns the index number from where data transferred to work area?
Thank you. If you are Looping or reading based upon a condition then in that case, it will return the index of the matching record based upon that condition. In some cases, we need index of matching record in that case we don't even use work area.
Heloo sir my query is - Loop at it_data1 into lwa_data1 from lv_index . Let say lv_index is 4 so it read from 4th row after that how it read from 5th row because we havent incremented lv_index it should always read from 4th row only please clarify this is from v_index will work only for first time from next time it will not consider. ???
LOOP means - It will process the records one by one. If loop is processing for 4th record, so in next iteration, it will process the record 5, 6 and so on. We started the loop from Index - 4, but it will point to next record in next iteration.
Hello Sir, how does it make difference in performance if we sort both tables based on key first and then use nested loops with where condition using key field without using parallel cursor?
LOOP always take all the records in to consideration. Suppose an internal table has 10000 records and based upon where condition there are 2000 records. So loop takes 10000 records in to consideration not 2000. Yes for 2000 the condition is true. We need to stop those 8000 extra iterations. So we make of parallel cursor.
@@sapabapbyrahulmehta , correct but that can stopped if we use nested loops with where condition based on main table?
@@mohammednabeel4381 I am not getting the question. How we can put a where condition on main loop as main loop needs to take all records into consideration. Please elaborate your question.
@@sapabapbyrahulmehta , what I meant is below.
sort itab1 by matnr.
sort itab2 by matnr.
loop at itab1 into lwa1.
loop at iatb2 into lwa2 where matnr = lwa1-matnr.
endloop.
endloop.
Now the nested loop will execute only based on material number from main loop which has multiple line items in sub loop. It will not execute for other material numbers. Correct? In this way how parallel cursor is more efficient?
@@mohammednabeel4381 No, the second loop takes all the records into consideration. Example - Suppose outer internal table has 5 records and inner internal table has 1000 records. So, for record of outer loop inner loop will continue 1000 times. Passing the where condition only means that it displays the matching records. We need to reduce these 5000 iterations to only 1000 iterations. So we are using parallel cursor.
Hi, can we use parallel cursors for more than 2 loops..?
If you have 3 nested loops, then same way we will apply parallel cursors for 3rd loop also.
@@sapabapbyrahulmehta ok sir, Thank you.
@@sireeshaande9102 👍
Sirji, what if key columns are not in order?
Hello Yuvraj, Can you please explore your query?
@@sapabapbyrahulmehta I have the similar question sir, What if it is not in sequence as Order No 1,2,3,4,5,6 and so on. What if the order numbers are like 001abc, 005xyz, means the sequence is not followed it could be anything numeric characters. then how can do this parrellal cursor sir?
@@GauravSingh-lz8mb Hello Gaurav, order number is a numeric field, So a-z is not allowed. It will only accept numbers.
@@sapabapbyrahulmehta Sir, So can we say that for implementing parallel cursor conditional column of both the internal table should be sorted?
@@VISHALKUMARSHARMA-u7y At least the inner internal table on which we are applying the Binary Search, that must be sorted.
Hi Rahul Do you give online training on Abap?
Hello Ali. I am not providing any online training as such,but if you stuck somewhere, you can ask those queries.
@@sapabapbyrahulmehta thanks for the reply, can you pls share your email. thanks Ali
@@AliAsim-ks8br My Email address is rahul3620023@gmail.com.
Hi. Thanks for great explanation. From my understanding, each loop has its own sy-tabix value, right? When these values are reseted? When program finishes?
Hello Grewicz, Thank you for the feedback. Your understanding is right, each loop has it's own sy-tabix value. When the loop ends, it will reset at that time.
@@sapabapbyrahulmehta but the internal loop keeps its sy-tabix incrementing even when external loop goes to next iteration ( its tabix goes from 0 to 1). Does that mean that inner loop is truly finished (sy-tabix resets) only when outer loop, that contains it, is finished?
@@grzewicz1109 When we see any internal table in the Debugging Mode, the first column is always the index of the rows, the name of the colum is ROW. Whatever the records processed in the first iteration Internally it will mark as processed and in the next iteration SAP simply check the value of ROW column for the new record and that will act as SY-TABIX.
In the parallel curser also we have do the bug analysis like if we add new record in header table. It was not reflecting in the output. You have explained about bug analysis for the normal process. Do We have to do the same process for the parallel cursor?
ruclips.net/video/t9H0aGah3ow/видео.htmlsi=2VUvDPlWGQ96WQXv
Yes. As the requirement is same. You can add there also.