Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Define columns to be retrived within ref_to_ldata at RSAQ_QUERY_CALL

0 Kudos
980

Hi,

I created a Z program that calls a SAP Query with function module RSAQ_QUERY_CALL

In ref_to_ldata I get a reference to the table with all data from the SAP Query.

I created a SAP Query variant with a customized output layout that contains only needed columns in a specific order.

Now my expectation was when I call the SAP Query with my defined variant that contains a output layout ref_to_ldata would contain only the limited number of columns with their defined order. But I always get all columns in ref_to_ldata with the default order.

Do I need to use a different default output format in my SAP Query or do I have to pass another parameter in the CALL FUNCTION statement of RSAQ_QUERY_CALL?

SAP Query settings:

Code snippet:

CALL FUNCTION 'RSAQ_QUERY_CALL'
  EXPORTING  
    query  = lv_my_query  
    usergroup  = lv_usergroup  
    variant  = lv_query_variant  
    skip_selscreen  = 'X'  
    data_to_memory  = 'X'  
  IMPORTING  
    ref_to_ldata  = g_dataref  
  EXCEPTIONS  
    no_usergroup  = 1  
    no_query  = 2  
    query_locked  = 3  
    generation_cancelled  = 4  
    no_selection  = 5    
    no_variant  = 6  
    just_via_variant  = 7  
    no_submit_auth  = 8  
    no_data_selected  = 9  
    data_to_memory_not_possible = 10  
  OTHERS  = 11  
.

Any help is highly appreciated.


Kind regards

Florian

2 REPLIES 2

wouter_peeters
Participant
0 Kudos
666

Hi Florian, we are experiencing the same issue, have you found a solution or workaround?

We are thinking on dynamically creating a table based on the layout variant and move the fields.

Thanks for your reply,

Wouter

0 Kudos
666

Hi Wouter,

unfortunately we did not find a solution. 😞

Kind regards

Florian