03-19-2024 7:14 AM - edited 03-19-2024 7:55 AM
Hello Experts, I want my code to look short and also perform fast and I need some expert to confirm which is the right way from below two.
PARALLEL CURSOR CODE:
Sadly we cant shorten this with new syntaxes. (maybe line_index can help?)
LOOP AT WHERE CODE:
This is shorter to code, but I am sure its not faster.
Maybe parallel cursor can be written with line_index since it is similar to READ TABLE TRANSPORTING NO FIELDS. Is it advisable?
Thank You!
The two nested LOOP AT is the same speed as "parallel cursor" provided that pt_pf_cm is declared as TYPE SORTED TABLE (with either primary key or secondary key).
So that your question makes sense, the SORT statement or TYPE SORTED TABLE declaration should be clearly mentioned.
Note that your "parallel cursor" code might be slightly faster if all the lines of pt_pf_cm are used, by removing the READ TABLE and starting from position 1.
NB: please don't post code as image, just use text with formatting option (buttons "..." and "</>") e.g.
LOOP AT lt_sales_cm ASSIGNING <ls_log>.
READ TABLE pt_pf_cm ...
...
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.