SAP UJQ_RUN_XML_QUERY Function Module for BPC: Run query on BW by MDX for XML format
UJQ_RUN_XML_QUERY is a standard ujq run xml query SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for BPC: Run query on BW by MDX for XML format processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for ujq run xml query FM, simply by entering the name UJQ_RUN_XML_QUERY into the relevant SAP transaction such as SE37 or SE38.
Function Group: UJQ_QUERY_ENGINE
Program Name: SAPLUJQ_QUERY_ENGINE
Main Program: SAPLUJQ_QUERY_ENGINE
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function UJQ_RUN_XML_QUERY pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'UJQ_RUN_XML_QUERY'"BPC: Run query on BW by MDX for XML format.
EXPORTING
I_QUERY_TYPE = "BPC: Character Field Length 10
I_CONTEXT = "BPC: Content in XML format
I_FILTER = "BPC: Filter in XML format
IMPORTING
E_RESULTS = "XML query result
ET_MESSAGE = "BPC: Messages
E_STATS_GUID = "BPC: Statistics Session
IMPORTING Parameters details for UJQ_RUN_XML_QUERY
I_QUERY_TYPE - BPC: Character Field Length 10
Data type: CHAR20Optional: No
Call by Reference: No ( called with pass by value option)
I_CONTEXT - BPC: Content in XML format
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_FILTER - BPC: Filter in XML format
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for UJQ_RUN_XML_QUERY
E_RESULTS - XML query result
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
ET_MESSAGE - BPC: Messages
Data type: UJ0_T_MESSAGEOptional: No
Call by Reference: No ( called with pass by value option)
E_STATS_GUID - BPC: Statistics Session
Data type: UJ_STAT_SESSIONOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for UJQ_RUN_XML_QUERY Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_e_results | TYPE STRING, " | |||
| lv_i_query_type | TYPE CHAR20, " | |||
| lv_i_context | TYPE STRING, " | |||
| lv_et_message | TYPE UJ0_T_MESSAGE, " | |||
| lv_i_filter | TYPE STRING, " | |||
| lv_e_stats_guid | TYPE UJ_STAT_SESSION. " |
|   CALL FUNCTION 'UJQ_RUN_XML_QUERY' "BPC: Run query on BW by MDX for XML format |
| EXPORTING | ||
| I_QUERY_TYPE | = lv_i_query_type | |
| I_CONTEXT | = lv_i_context | |
| I_FILTER | = lv_i_filter | |
| IMPORTING | ||
| E_RESULTS | = lv_e_results | |
| ET_MESSAGE | = lv_et_message | |
| E_STATS_GUID | = lv_e_stats_guid | |
| . " UJQ_RUN_XML_QUERY | ||
ABAP code using 7.40 inline data declarations to call FM UJQ_RUN_XML_QUERY
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.Search for further information about these or an SAP related objects