Skip to Content
First, I want to thank Sridhar K, Suresh Datti, Rob Burbank, and Rich Heilman for spending quite a bit of time racking their brains trying to figure out a way to get post-ECC5 upgrade SQ01/SQ02 to regenerate the actual code for a query program when the infoset and the query haven’t changed in anyway. Although they’ve been “rewarded” point-wise down in the Forums, I wanted to also thank them up here because I believe the effort was “above and beyond” the call of duty. Second, if any SDN-er knows how to force post-ECC5 SQ01/02 to regenerate actual query code without those pesky hyphens in structure field names, please let us know. Until then – the steps outlined below are a reasonable work-around. Note in particular Step 5 below regarding creation of a new parameter transaction, NOT a new report/select-screen transaction. Steps to Repair SQ01/02 InfoSet/Queries After ECC5 Upgrade Step 1. Make a local object copy of the query program that is not compiling. The query program will have a name that begins with ‘AQ’ and has “equal signs” in it, like: AQ30ZM0001======ZM0004======== Name your local object something temporary – this will not be the final version. In this example, we’ll call the local copy ZM0004_FIX. Step 2. Do all necessary repairs on your local object ZM0004_FIX. Typically, these repairs will be mainly due to hyphens in structure field names within the generated code. For example, you may see data declarations like: data: begin of %t01, MCMSEG-WERKS(004), MCMSEG-MTART(004), MCMSEG-ZPRODHIER1(003), MCMSEG-ZPRODHIER2(003), MCMSEG-ZPRODHIER3(003), MCMSEG-MATNR(08), MCMSEG-BUDAT(010), MCMSEG-MENGE(09), MCMSEG-ZGRFRZNWGH(09), MCMSEG-ZGRCURRWGH(09), MCMSEG-ZRCVRMATFR(09), MCMSEG-ZRCVRTLBFR(09), MCMSEG-ZRCVRFBLFR(09), MCMSEG-ZRCVRTOVFR(09), MCMSEG-ZRCVRFOVFR(09), MCMSEG-ZRCVRFSCFR(09), MCMSEG-ZRCVRADDFR(09), MCMSEG-ZRCVRMLDFR(09), MCMSEG-ZRCVRMATCR(09), MCMSEG-ZRCVRTLBCR(09), MCMSEG-ZRCVRFLBCR(09), MCMSEG-ZRCVRTOVCR(09), MCMSEG-ZRCVRFOVCR(09), MCMSEG-ZRCVRTSCCR(09), MCMSEG-ZRCVRFSCCR(09), MCMSEG-ZRCVRADDCR(09), MCMSEG-ZRCVRMLDCR(09), and code that operates on these fields like: T01-MCMSEG-WERKS = MCMSEG-WERKS. T01-MCMSEG-MTART = MCMSEG-MTART. T01-MCMSEG-ZPRODHIER1 = MCMSEG-ZPRODHIER1. T01-MCMSEG-ZPRODHIER2 = MCMSEG-ZPRODHIER2. T01-MCMSEG-ZPRODHIER3 = MCMSEG-ZPRODHIER3. T01-MCMSEG-MATNR = MCMSEG-MATNR. T01-MCMSEG-BUDAT = MCMSEG-BUDAT. The hyphens in the field names must be changed to underscores. Step 3. To have an auditable “trace”, use your local copy (ZM0004_FIX) to make a repair copy of the original program (AQ30ZM0001======ZM0004========) First, get an access key for the original query program AQ30ZM0001======ZM0004========. This will allow you edit the original query program in “restricted” insert/delete mode. (It doesn’t matter what package you put this in – it is an intermediate program that will not be copied.) In particular, highlight all code and press the “Delete” button. This will not actually remove the code, but instead will comment it out. Then, in a second session, open up your ZM0004_FIX copy and highlight/copy all code. Then, paste this code into AQ30ZM0001======ZM0004======== using the insert button. Syntax check and activate AQ30ZM0001======ZM0004========. Step 4. Copy the repaired program (AQ30ZM0001======ZM0004========) to a Z program that preserves the name of the original (like Z_AQ30ZM0001======ZM0004) When you make the final copy Z_AQ30ZM0001======ZM0004, save it to a transportable package and create a new transport for the request. 5. The most important step: make a NEW parameter transaction to run the final Z program. In SE93, create a new parameter transaction with the same name as the original parameter transaction that ran the original query (after deleting the original transaction.) Make sure this is designated as a parameter transaction, NOT a report/selection screen transaction. Enter your final Z program name as the report associated with this new parameter transaction. Save this new parameter transaction in the same transport as you saved your original Z program. 6. Test the transaction in DEV and transport to QA, PROD. Test in QA and Prod also before releasing to customers. Note 1: The reason why you must create a new transaction is that if you just change the report name in the original parameter transaction, SAP will get confused because there is a user group and user query in this original transaction. Note 2: The reason why you must create a new parameter transaction (and not just a report/selection screen transaction) is because the mechanics of the original query program (and your final repaired copy of it) require the program to be executed from the START_REPORT invoked by a parameter transaction.

To report this post you need to login first.

4 Comments

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

    1. David Halitsky Post author
      … then it would make life as easy as possible for customers with SQ01/02 queries …

      So if SAP DOES have a way of forcing the regeneration without doing repairs, it sure would be good to let prospective ECC5 migration customers know …

      (0) 
  1. David Halitsky Post author
    has confirmed that there is no automated way to regenerate pre-ECC5 SQ01 query code without hyphens in structure names.  So customers will either have to regenerate the queries or repair the existing ones using the method outlined in this post.
    (0) 
  2. David Halitsky Post author
    After you get your post-ECC5 SQ01 query working by doing the repairs mentioned in this blogpost, your users will be quick to tell you that the ALV button isn’t working (the one on the first display screen that pops.)

    What we did was to intercept this call:

    AT USER-COMMAND.
    case sy-ucomm.

    when ‘ALV’.
      perform %download using ‘ALV’.

    and replace it with:

       perform fill_alv.
       CALL SCREEN 100.

    On screen 100, we pop an ABAP OO ALV grid with just the detail lines from the original display, which is all our users want. 

    Of course you have to build a fieldcat, etc., but it’s a lot easier than making a custom copy of RSAQEXCE/D in order to get the hyphens out of the fieldnames in %ldesc.

    Forewarned is forearmed !!!!!

    (0) 

Leave a Reply