ABAP reports are widely used in ECC systems especially with transaction codes, but quite often a user needs to run an ABAP query. For this reason, when defining custom transactions, job steps an so on, calling the query generated report is preferred instead of invoke the query itself.

In this blog I would like to share with the SCN community the tool I developed to massively convert these kind of transactions.

Release Upgrade, the same old story

After a release upgrade, these transactions no longer work generating always the same ABAP short dumps:

  • The generated program does not exists.
  • The generated program mismatches the query definition.
  • Short dump of the type IMPORT_ALIGNMENT_MISMATCH in program SAPLAQRUNT

/wp-content/uploads/2015/02/dump_saplaqrunt_651987.png

How can we solve this issues?

The SAP OSS Note 393160 – SAP Query: Using queries provides the guidelines for the conversion of such transactions. In brief it suggests to wrap the query call in a parameter transaction instead of running the query generated report.

The standard transaction REISSQMAIN has been created for our scope; we just need to create a parameter transaction and assign values to the below selection screen parameters:

  • Query Work Area
  • Query User Group
  • Query Name
  • Query Variant

Ok, I’ve to say that fixing this kind of issues is very simple 😀

How should we manage the conversion in case our system contains a lot of transactions defined as above?

Here it comes the hard part!

For each transaction that dumps we should execute the below steps:

  1. Given the generated report name (you can get it from the short dump details), go to transaction SE37 and execute the function module ‘RSAQ_DECODE_REPORT_NAME’ to get: User Group; Work Area; and Query NameDECODE_AQ_NAMEs.png
  2. Create a parameter transaction that runs the REISSQMAIN transaction with the parameters returned as results of the FM processing in step 1

SAP_QUERY_CALL.png

The ABAP query will be regenerated once the query call has been executed.

OK, now that you got it, repeat these steps for all transactions that might dumps! 😥

The accelerator

During an upgrade project we discovered more than 400 transactions defined as above. For this reason I decided to develop a simple tool; in case you have a clear commitment from the customer, you can perform a mass conversion in few seconds.

/wp-content/uploads/2015/02/front_page_652027.png

The ABAP code that I’m sharing in this blog is quite “vintage”, but you should keep in mind that it was developed during the project, with the aim to speed-up this annoying activity, not to share high quality source code. The rule in my mind was: OK Andrea, develop it rude and… don’t worry about Doctor Zedge 😉

Watch the video demo

The following video would show how the tool works; I know the quality is not excellent but let me say, the steps to follow are really for dummies 😉

How to download

Code is shared here using SAPLink.

ℹ Before to start the tool, don’t forget to “remote enable” both function modules in function group ZSDN_UPG_AQ as shown below

RFC.Enable.png

Remarks

The import in production of this tool is not required. After the first run in DEV, the scheduling of the tool as periodic job should avoid the spread of AQ* report transactions…

Related Discussions/Forums

Related Blogs

The superb blog Dragging SAP Query enabled folks into the development process by Otto Gold provides a lot of technical stuffs.

Related Notes

393160 – SAP Query: Using queries

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Otto Gold

    Hello,

    nice blog! and thanks for a mention! When I wrote it, it didn’t attract much attention so I concluded that either not many people are using queries or not many peoples are using queries correctly (also authorization wise etc. from my own experience) or the people that do use queries don’t like to talk on SCN 🙂 Anyway I will follow this blog of yours and hope for a nice discussion here 🙂

    cheers Otto

    (0) 
    1. Santo Mota

      Regards Otto Gold, I saw one of your discussions about to create an external abap editor. That was long time ago, i guess, the thing is that I like to learn new things about SAP. So if you have any blogs to follow or if don’t mind to establish contact, I would be pleasure.

      Right now i am working in a SAP template for abapers. it’s something small for now.

      But i dont have problem to share it.

      (0) 
    2. Andrea Olivieri Post author

      Ciao Otto,

      first of all thanks for your comment. I am very pleased that you enjoyed my blog.

      In my experience I have been involved in so many upgrade projects, so I had the fortune to deep dive into the code custom of several SAP ERP systems.

      My response is that ABAP queries are widely used, mainly by “Power users” as well as by lot of “Lazy Abapers”…That’s Incredible! They are so lazy that they’re still using SQVI/SQ01 as kind of “robot” to generate ABAP code 😯 ignoring the existence of incredible tools shared by the SCN community members such as “ALV robot”, “ABAP report wizard” and so on…

      Best,

      Andrea

      (0) 

Leave a Reply