Skip to Content
Author's profile photo Former Member

Smartform Version Comparison

There has long been a requirement, where we need to compare 2 Smartform versions.

In SAP there is no feature for this, there are no past versions maintained and also certainly no remote comparison.

This makes comparison and version management of smartforms a tedious task.

I was faced with such a task too. There were multiple complex smartforms and due to multiple activities and phases of my project working simultaneously, it was very difficult to trace what went wrong and definitely made it a lot of effort to maintain and revert changes in case of any issues.

Thus began my journey down the lane on how to overcome this problem.

My initial research “Google” shed no fruitful results. All I got was it is not possible in SAP to compare the smartforms and we will need to download the XML files and save locally in order to do version management.

And in case we need to compare, we will need to upload and create a temporary version and then compare each window and element.

Well, to me it did not make a lot of sense. Since it would be way easier to create new in a lot of cases and yes, I believe that is what must have been done in most cases.

So I started with my own utility program for Smartform Version Comparison.

I noticed that always on Download and XML file is generated and this remains more or less of a similar structure.

There are tags which we can traverse and identify to compare the smartforms.

And also the entire data in the smartform is present in the XML.

So, why not automate this and voila now I have a working program to compare smartforms.

I have uploaded the source code of the same on Github at https://github.com/sajid-a/SmartformVersionCompare

This is currently a working version with a known bug that it can only compare smartforms upto a certain size. The reason is that currently we are not able to process the complete string provided by the XML in the file. Other than that this can be used to compare smartforms.

The process for comparison is as follows:

1. Download and Maintain the XMLs of the smartform before making any change. This will act as your repository of version management. Alternatively an SVN can be used for this purpose

files.PNG

2. Execute the program and provide the two XML files that you want to compare.

upload.PNG

3. On execution, the changes in the two versions will be displayed.

3.PNG

4.PNG

The program is currently in the Alpha Phase and hence any suggestions or improvements are welcome.

Also all are welcome to collaborate on the source code and help in the development of a comprehensive tool.

The features to be added in the current program are as follows:

1. Only Code Comparison

2. Remote System Comparison

3. Automatic Version Management and Comparison

4. Auto generation of XML by just entering the Smartform Name

5. Bug fixes

Hope this post proves useful to all who are in need for a way to compare smartforms. 🙂

Assigned tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Florian Henninger
      Florian Henninger

      Hi Sajid,

      nice blog. I read that you didn't find a thing so I can give you a hand. Have a look here:

      Basic Smart form "source" scan

      So maybe you could integrate it for further developings and replace the part with the upload.

      ~Florian

      Btw: Depends on the release you are working for, but you should have a look at the new ABAP-Features 😉

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Florian for the tip. 🙂

      I will go through those and update the if any changes.. 🙂

      Author's profile photo Srijan Bhatia
      Srijan Bhatia

      Helpful. Great work.

      Author's profile photo Sriram Ramesh
      Sriram Ramesh

      Useful content! Thanks

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Pretty neat idea. The only drawback is that this option would require thinking ahead and getting (and retaining!) XML extract beforehand. And we usually realize a need for comparison only way after the fact. 😳

      Author's profile photo Juwin Pallipat Thomas
      Juwin Pallipat Thomas

      May be, BADI CTS_EXPORT_FEEDBACK, can be used to generate XMLs and keep in secure location/ Z table, whenever a TR containing SSFO object is released.

      Thanks.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Juwin.

      I will explore the possibilities of this BADI and maybe this can be automated as well. So no need to manually download XMLs.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Jelena,

      Yes, that is something. The idea is that the way SAP maintains versions for each TR, here we will have to manually keep track of the versions. And take XML dumps before each transport / change.

      Author's profile photo Sanjay Kumar
      Sanjay Kumar

      Dear Sajid,

      Thanks for showing us another approach to achieve a long pending functionality.

      I have implemented smartform version one stop repository tool where:

      1. Version Comparison: Node by node comparison including source code comparison

           Here we can compare remotely as well as with different smartforms.

      2. Version Repository : Saving the smartform version on task release and on manual trigger.

      3. Version Restore : Restore local/remote smartform versions

      Though I have used the XML approach, but I have mixed it with ABAP classes to achieve a complete version tool for smartforms.

      Cheers!

      Sanjay

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Sanjay,

      Can you help me understand how you implemented remote comparison? I would like to implement a similar feature.

      Author's profile photo Simone Milesi
      Simone Milesi

      And why not to share with the community, on github? 🙂

      Author's profile photo Vishwa Ranjan
      Vishwa Ranjan

      Hello Sanjay,

       

      Can you share your implementation ( github or here)  please?

      Using Sajid's approach, i have tried comparing smartform. Output is not efficient.

       

      Regards,

      Vishwa Ranjan

       

      Author's profile photo Sue Morton
      Sue Morton

      Hello Sajid,

      This helped me today!  Thank you!

      Sue

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Sue,

      You are welcome. 🙂

      Author's profile photo Spring Long
      Spring Long

      Hello Florian, This supper helpful to me! Thank you greate!!

      Author's profile photo Vishwa Ranjan
      Vishwa Ranjan

      @Sajid!

      Hi Sajid,

      I have used your approach and your code from github.

      Tasks i do:

      1. Give the name of smartform and execute. It will save smartform xml file to AL11 (Application server) with timestamp.
      2. Again to compare , check a checkbox to compare and give the name of smartform and execute.
      3. It shows you an alv with all the records saved on AL11 with timestamp.
      4. Choose two records ( smartforms files or version) you want to compare. Execute comparision.
      5. Rest is based on your code which doesn't work a new node.

      I am still not able to accomplish what i intend. If you have further insights, please share.

      P.S. :- I have requested Sanjay to share his work also.

      Regards,

      Vishwa Ranjan