Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare files, spool files, etc.

Former Member
0 Kudos

We want to compare outputs from report programs. What ways are available to compare flat files or spool files? (The more intelligent the compare program, the happier we'd be.)

Is best way to RFC/JCO to some extant Java utilities, or does SAP provide such functionality?

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You could write an abap that submits both reports outputing to memory, retrieves the lists from memory into itab, and converts the lists to ascii. Then read each line of each internal table to see if they are equal, if not, then output that line. I don't know of any SAP delivered program that will do this for you.

Regards,

Rich Heilman

Former Member
0 Kudos

The fastest file compare is definitely at the operating system level. However, you need to have some shell scripting experience to write such a program. Once you have the shell ready, you can execute it inside an ABAP program as an external command (defined in SM69)with 'SXPG_EXECUTE_COMMAND' function.

Another option is using "open dataset in text mode" to load file into an internal table and then comparing it with .