Skip to Content

Define columns to be retrived within ref_to_ldata at RSAQ_QUERY_CALL

Jan 30 at 01:58 PM


avatar image


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:

    query  = lv_my_query  
    usergroup  = lv_usergroup  
    variant  = lv_query_variant  
    skip_selscreen  = 'X'  
    data_to_memory  = 'X'  
    ref_to_ldata  = g_dataref  
    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


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers