2012 Sep 11 10:52 AM
Hi Experts,
I have a requirement to compare SAP Data with Other External Oracle Database & Show it in a ALV Report.
Using Oracle Native Sql i am extracting the data based on SAP data, by looping each SAP record
As the Looping each record & Native Sql is Leading to Performance issue.
Can we have For All entries kind of thing in Oracle Native Sql, if so please send me Syntax.
Please help .
Regards,
Vinay Rao
Hi Experts,
I have a requirement to compare SAP Data with Other External Oracle Database & Show it in a ALV Report.
Using Oracle Native Sql i am extracting the data based on SAP data, by looping each SAP record
As the Looping each record & Native Sql is Leading to Performance issue.
Can we have For All entries kind of thing in Oracle Native Sql, if so please send me Syntax.
Please help .
Regards,
Vinay Rao
2013 Jul 08 8:23 AM
Hi Vinay,
Sorry but for all entries are not supported by Native SQL.
We would required to loop at all the records in SAP R/3 and get corresponding data from ORACLE data base.
Also you can go through the link http://scn.sap.com/thread/1875746
Regards,
Piyush
2013 Jul 08 9:17 AM
Hi Vinay,
I am afraid you don't have option like FOR ALL ENTRIES in Oracle native sql.
You can make use of field-symbols for faster internal table processing.
Once you have both SAP table data and External DB table data in separate internal tables, sort them. Then compare the data by making use of read statement with BINARY SEARCH for faster comparison.
The above process will be very best.
For instance,
sort : isap_ztable,iora_ztable.
loop at isap_ztable ASSIGNING <fs_sap>.
read table iora_ztable ASSIGNING <fs_ora> with key zfield = <fs_sap>-zfield BINARY SEARCH.
if sy-subrc = 0.
if <fs_ora> NE <fs_sap>.
"DATA DIFFERS
endif
endif.
endloop.
Regards.