with a Priority 2 issue stating, “Possible sequential read on a generically typed table”. And the title of the ATC message was even scarier, “Low Performance Operations on Internal Tables”.
How on earth can one get this Quality Approved if it shows Low Performance error? ☹ On top of it, we all know how strict those Quality Reviewers are. They just look for opportunity to reject your development and make you put extra effort just to pass the QA review even though it might just be some cosmetic issue or typo.
By the way, ATC does not mean Air Traffic Controller in SAP. It is ABAP Test Cockpit. Pun is intended in the featured image of this article. ?
Let me elaborate the issue. In one of the implicit enhancements I was forced to write the below logic to meet the demands of the complex business requirement. Should we use implicit enhancement or not, let’s keep that debate for some other day. Today, we have another cat to bell. ?
ACCOUNT_LINES is from standard SAP object and gets populated in a standard class and I wanted to DELETE a line from that table. Straight forward. Isn’t it?
I planned to move ACCOUNT_LINES data to <FS_ACCOUNT_TAB> using dynamic DATA(ps_tabname) = ‘account_lines’ and then ASSIGN (ps_tabname) to <FS_ACCOUNT_TAB>.
Well I was trying to delete an entry from dynamic tabledeclared as ANY TABLE and there was no syntax error and code worked fine. Theywhy was ATC check showing the DELETE line as an issue?
This is the ATC message which I got.
I tried to fool ATC using pseudo comment “#EC CI_ANYSEQ. But it did not suppress the issue.
Having exhausted all my options, I tried taking help from our SAP Technical Telegram Group. We have more than 5000 SAP Consultants. And I hoped another set of eyes might help me solve this mystery. Below are some of the positive questions I received from the group members.
Investigative Questions from group members and my response:
If you use DELETE TABLE you must specify primary key, in your case it works because it uses implicit full-table key, I assume. Did you try using only DELETE statement?
Ans: If I use DELETE I’m getting error.
Can you share declaration of FS_ACCOUNT_LINES and <FS_ACCOUNT_TAB> please?
Ans: <FS_ACCOUNT_TAB> is of TYPE ANY TABLE.
FS_ACCOUNT_LINES is an in-linedeclaration in the loop
Before <FS_ACCOUNT_TAB> you can use: DELETE <FS_ACCOUNT_TAB> WHERE (‘KOART‘) EQ ‘K‘ AND (‘SHKZG‘) EQ ‘S‘.
Ans: I tried that, but ATC check still cries foul. ☹
What is ATC telling?
Ans: ATC message below.
Have you tried DELETING with INDEX?
Ans: Yes, all works fine code wise but getting the same error in ATC.
Where do you fill ACCOUNT_LINES table?
Ans: ACCOUNT_ LINES is filled in a standard class and I want to delete a line from that table.
Look the group members fired some questions. Although they could not provide me the exact solution, but they surely did try to help me. Do not worry about the outcome. Your intentions should be right.
When one member asked me to show the ATC message, I happened to read it one more time. The message says, Possible sequential read on a generically typed table. This keyword Generically caught my eyes. I wondered, isn’t TYPE ANY TABLE a generic type?
In fact, the hint was already there in the message. Something clicked in my mind and I planned to declare it as TYPE INDEX TABLE. I do not remember using TYPE INDEX TABLE that often.
How frequently do you use TYPE INDEX TABLE?
Check, initially I had declared <FS_ACCOUNT_TAB> TYPEANY TABLE.
I redeclared it as TYPE INDEX TABLE.
Since <FS_ACCOUNT_TAB> is of TYPE INDEX TABLE, I tried to DELETE using INDEX. And, Bingooo…. It worked. ATC liked my new way. No more ATC issue for the DELETE statement.
Also Check – My First Program in ADT and S/4HANA.
Lesson learnt: If we try to DELETE a row of table of TYPE ANY using INDEX or DELETE using Work Area, ATC treats it as an issue. May be it considers the table to be too generic. So, in such cases, declare the table as INDEX Table and confidently DELETE using INDEX.
This way you kill two birds with one arrow. Wondering who the two birds are? ATC and your Quality Reviewer. ?
I know, you might feel it was too simple an article. And you may even question, did this issue warrant a blog post? I would say, Yes. It is always better to learn from others mistake and experience. Next time you or someone you know gets such generic message, you know what to try.
This is my first article at SAPYard. Your comments, criticism and feedback is most welcome. If you want to read more articles from me, please do let me know.
Not many girls would like if you comment on them. But I insist.. ?
We have a very active Telegram (App) SAP Technical Group with more than 5000+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.
Free Step by Step Core Data Services Exercises
- CDS Part 1. Core Data Services – Introduction
- CDS Part 2. Core Data Services – Deep Dive
- ABAP on SAP HANA. Part XII. Open SQL, CDS or AMDP, which Code to Data Technique to use?
- CDS Part 3. Expose CDS Views as OData Service through Annotation
- CDS Part 4. Data Access in S/4HANA Cloud – CDS View Introduction
- CDS Part 5. ABAP CDS Views With Authorization
- CDS Part 6. Basic Expressions & Operations Available for CDS View – I
- CDS Part 7. Basic Expressions & Operations Available for CDS View – II
- CDS Part 8. Usage of Built-In Functions in CDS – I
- CDS Part 9. Usage of Built-In Functions in CDS – II
- CDS Part 10. Usage of Built-In Functions in CDS – III
- CDS Part 11. How to Consume CDS View in Smart Business Service KPI Fiori Apps?
- CDS Part 12. Useful 6 CDS Related Tools in ADT
- CDS Part 13. Key Definition in CDS Views
- CDS Part 14. ABAP Annotations for Translatable Texts in CDS Views
- CDS Part 15. Associations in CDS Views – I
- OData Service from CDS Annotation Not Working in Browser Mode
- CDS Part 16. Usage of Built-In Functions in CDS – IV
- CDS Part 17. How to Overcome GUID Mismatch Linking Problem in ABAP CDS?