Skip to Content
author's profile photo Former Member
Former Member

Comparing fields of a table in two systems

Hi All,

I have a requirement where in I need to get the contents of a table from a different SAP environment dynamically and then compare the field values of that table with the fields of the table in my current system. I was able to get the data using READ_RFC_TABLE function module. The output of this Function module is of type char512. But, I need to compare the data field by field. How do I compare this? How do I split the data obtained?

For example, I have two systems A and B. I need to compare the fields F1,F2,F3 in both systems A and B and display the data. If there is any mismatch in the data in any of the fields, I should display a message saying "Conflict".

Appreciate your help to understand how this can be implemented.

Thanks,

Pavan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jun 11, 2013 at 09:11 AM

    Standard report RSCMPADJ does just that, it uses function modules in group SCT1. It looks all pretty complex, but maybe you can analyse it and "borrow" some ideas for your own logic.

    Alternatively, maybe it is sufficient to SUBMIT this standard report and retrieve the list output from memory for further processing.

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2013 at 05:41 AM

    Hi,

    write your own rfc function module and design the export or table parameter exactly the way you need.

    Once you get the data the comparision is not a big problem.

    BG

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2013 at 06:20 AM

    Hi,

    You can get the table contents from table dynamically and then compare the table data in the current system.

    Incase if the client is only different(for comparison), you can simply use CLIENT SPECIFIED to get the data from other client.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jayanthi,

      Here it is a different SAP system. SO Client Specified cannot be used. I was able to get the table contents from the remote system but I need to split the data into different fields for comparison. I tried splitting the contents based on Space and it did not split appropriately. So, any idea as to how the data can be compared?

      Thanks,

      Pavan

  • Posted on Jun 11, 2013 at 06:38 AM

    Hi Pavan,

    If you want all the three fields be matched, Instead of splitting the line item in RFC table, better concatenate the three fields of table in your system.

    Loop your Internal table in your system and concatenate the three field that you wish to compare (as you mentioned f1 f2 and f3) into a string. Now compare this string with the line items of the table you got from the function module, using of-set as per the field lengths of three fields in both the tables.

    Thanks & Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vijay,

      For a single table, we can do it the way as suggested by you as we will be aware of the fields, . But in this case, I will be reading the table dynamically. So, I will not be aware of the number of fields. Can you please suggest?

      Thanks,

      Pavan

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2014 at 02:47 PM

    Like Thomas said,

    I'm trying the same thing as you get two tables from different systems and compare them i even have to make them equal, but studying RSCMPADJ it's a good way to start or using the transaction that this program uses that is SCMP on of it. Also the FM of SCT1 are very helpful to compare and retrieve the data, but the code and the way it does all of this it's very complex though.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.