‎2020 Aug 04 10:54 AM
Hi Experts,
We have a custom transaction code that has a runtime issue as it takes very long to process . Per checking via SAT, long runtime (almost 90% runtime) is happening in check_data(1) TO check_data(4) of standard FM FAGL_SEGMENT_CONTAINS_DATA since inside these subroutines there is a select from a generic identifier. Since this is standard SAP, I didn't expect to see a code where nested loop is performed.
LOOP AT lt_ledgers.
LOOP AT lt_tka02.
WHILE ( ld_akt_year <= ld_end_year AND
ld_akt_year <= ld_syyear ) .
PERFORM check_data USING ...
PERFORM check_data(2) USING ...
PERFORM check_data(3) USING ...
PERFORM check_data(4) USING ...
ENDWHILE.
ENDLOOP.
ENDLOOP.
Is this kind of code okay?
We have always been taught to avoid retrieving from the database within a loop and to also avoid nested loops. But in this FM, retrieving from database is inside a nested loop. Please correct me if I'm wrong.Thank you.
Regards,
Kath
‎2020 Aug 04 10:58 AM
Hello kdarunday
Yeah, sometimes these happen... Check SAP OSS note #2219690 - it might help.
Kind regards,‎2020 Aug 04 10:58 AM
Hello kdarunday
Yeah, sometimes these happen... Check SAP OSS note #2219690 - it might help.
Kind regards,‎2020 Aug 04 11:25 AM
Hi Mateusz,
Thanks for the confirmation. I have checked the OSS Note however, per checking the software component is SAP_FIN 720

And we are still currently on SAP_FIN 617:

Does this mean the correction cannot be applied to our system?
Thank you.
Regards,
Kath
‎2020 Aug 04 2:10 PM
Yes, it would appear so. In this case I would raise a ticket with SAP as this is a standard code's issue.
‎2020 Aug 04 11:03 AM
What SAP version do you currently have?
Did you check support.sap.com. There is a SAP note from late 2016 concerning this issue. And looking at the code changes from that SAP note, it should address your problem, as your posted coding would be affected by it:
‎2020 Aug 04 11:29 AM
Hi Michael,
Thanks for this. Per checking the OSS Note, software component is SAP_FIN 720 but we are still currently on SAP_FIN 617.

Does this mean the correction cannot be applied to our system?
Thank you.
Regards,
Kath
‎2020 Aug 04 2:32 PM
kdarunday, since you are on 617, and the correction is only offered for 720, I strongly assume that the SAP note cannot be applied to your system (neither through trx. SNOTE, nor 'manually' by your development through modification).