EasyQuery, What is it?
To put it simply, it is an automated process by which SAP system generates all necessary backend objects so that one can consume the data output from a normal query in BW, programatically from a (local or remote)/(SAP or Non-SAP system) by calling an RFC enabled autogenerated FM.
How to?
Just tick the EasyQuery check box in the properties of a normal query in query designer and execute the query and all backend FM and structures are autogenerated. All you need to do is to declare a variable by the type of autogenerated structure and pass it in to the autogenerated FM.
Transport issues
Here we reach the crux of this post. The standard method of transporting an EasyQuery is to simply collect the original query and transport it and then check the EasyQuery checkbox again in the target client and execute again. The issue here is there is no guarantee that the autogenerated objects will have the same names in the target client as they had in source client. This creates problems in code for consumption especially when its consumed from SAP systems. You will have a piece of code which addressed the autogenerated FM correctly in one client and after transport it will obviously error in new client if the autogenerated FM name is different.
Below fixes are possible.
1. One Option is to open each client and correct the code so that it matches the autogenerated objects. This not recommended at all as this will mean opening the production client too.
2. Second option is to use the FM : RSEQ_GET_EQRFC_NAME to fetch the autogenerated FM name for a particular EasyQuery name passed. You will still have to provide the custom structure as input to the autogenerated FM which can be accomplished by using a CASE..WHEN loop to check the nomenclature of the FM name returned below and declare the custom structure according to that. This works because both the autogenerated FM and structure use the same matching numbers as differentiators.
3. The third and seemingly both logical and clean method would be to take these autogenerated objects as a template and create custom Z objects and use them in the code for consumption. We can have a single custom FM for all easyqueries created and this custom FM will replicate the functionality inside the autogenerated FM minus some security checks (example: a date check which is there to make sure autogenerated FM matches the latest changes to the query). This custom FM can be made to accept the EasyQuery name, Custom structure(which will have to be created taking the autogenerated structure as sample for each EasyQuery created, seperately) and ASONDATE
Hope the information provided above is useful. Please suggest further as you see fit, on the subject.
Regards
Darshan Suku