cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RUN_RSDRI_QUERY - Memory :Low issue

Former Member
0 Kudos
661

TRY.
lo_model
= cl_uj_model=>get_model( i_appset_id ).
lo_model
->create_tx_data_ref(EXPORTING
i_appl_name 
= i_appl_id
i_type      
= 'T'
it_dim_name 
= lt_dim_name
if_tech_name
= space

IMPORTING
er_data     
= lo_dataref.

CATCH cx_uj_static_check.

ENDTRY.


*Assigning the structure to tableASSIGN lo_dataref->* TO <lt_tx_data>.

TRY.

lo_query = cl_ujo_query_factory=>get_query_adapter(
               i_appset_id
= i_appset_id
               i_appl_id  
= i_appl_id ).
** Run Query to populate ct_data based on dimensions , selection criteria **.

lo_query
->run_rsdri_query(
EXPORTING
it_dim_name      
lt_dim_name " BPC: Dimension List
it_range         
=   lt_sel     " BPC: Selection condition
if_check_security
= ABAP_FALSE   " BPC: Generic indicator
IMPORTING
et_data          
= <lt_tx_data>
et_message       
= lt_message    " BPC: Messages
).


I am getting memory dump. Can you please let me know how to handle this case. I have more than 3Million records to be fetched from the cube.


I filled the LT_SEL with respective values, when I give a single value account, I am able to fetch without any issues for the same code.


ISSUE: Only when I run for a huge selection.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Raja,

are you using XDIM in your LGF file?

you need to filter your data, only read what you need in your calc, fill the table for LT_SEL.

Andy

Former Member
0 Kudos

Hi Andy,

Yes I am using filters and am using XDIM in my LGF File.

Former Member
0 Kudos

Hi Raja,

Please provide you LGF file and your LT_SEL part of the code.

Andy

lucas_costa3
Active Contributor
0 Kudos

Try limiting the size of your query - one of the parameters of this method is I_PACKAGESIZE.

Then you'd need to run again till get the whole data.

Also check if it's possible to amplify your filter - LT_SEL.

Cheers,

Lucas

Former Member
0 Kudos

I had already tried I_PACKAGESIZE, but got a dump ASSERTION_FAILED.

former_member186338
Active Contributor
0 Kudos

Can you provide full code with I_PACKAGESIZE?

And what badi are you writing? Custom logic?

What script is used to launch the badi...

Vadim

Former Member
0 Kudos

Hi Vadim.

Please find my code below. I am writing the code inside the BADI IF_UJ_CUSTOM_LOGIC~EXECUTE.

I ran with selection criteria, I was able to execute RUN_RSDRI_QUERY with LT_SEL filled for <1 million records. It was successful.

When I ran the same selection criteria for > 1 million records. It had short dump (Memory Low).

So Inserted the package size - now i get the short dump 'ASSERTION_FAILED'

TRY.
lo_model
= cl_uj_model=>get_model( i_appset_id ).
lo_model
->create_tx_data_ref(EXPORTING
i_appl_name 
= i_appl_id
i_type      
= 'T'
it_dim_name 
= lt_dim_name
if_tech_name
= space

IMPORTING
er_data     
= lo_dataref.

CATCH cx_uj_static_check.

ENDTRY.


*Assigning the structure to tableASSIGN lo_dataref->* TO<lt_tx_data>.

TRY.

lo_query = cl_ujo_query_factory=>get_query_adapter(
               i_appset_id
= i_appset_id
               i_appl_id  
= i_appl_id ).
** Run Query to populate ct_data based on dimensions , selection criteria **.

lo_query
->run_rsdri_query(
EXPORTING
it_dim_name      
lt_dim_name " BPC: Dimension List
it_range         
=   lt_sel     " BPC: Selection condition

i_package size  = 100

if_check_security = ABAP_FALSE   " BPC: Generic indicator
IMPORTING
et_data          
= <lt_tx_data>
et_message       
= lt_message    " BPC: Messages
).


former_member186338
Active Contributor
0 Kudos

Please read:

*      CHANGING

*        c_first_call      =     " BPC: First Call Yes/No

Former Member
0 Kudos

Thanks Vadim, when I specify the package size as 500000 and c_first_call = 'X', I am able to execute the query but it picks only 500000 records, I need to pick more than 3 million records.

former_member186338
Active Contributor
0 Kudos

Code, please!

Former Member
0 Kudos

TRY.
lo_model
= cl_uj_model=>get_model( i_appset_id ).
lo_model
->create_tx_data_ref(EXPORTING
i_appl_name 
= i_appl_id
i_type      
= 'T'
it_dim_name 
= lt_dim_name
if_tech_name
= space

IMPORTING
er_data     
= lo_dataref.

CATCH cx_uj_static_check.

ENDTRY.


*Assigning the structure to tableASSIGN lo_dataref->*TO<lt_tx_data>.

TRY.

lo_query = cl_ujo_query_factory=>get_query_adapter(
               i_appset_id
= i_appset_id
               i_appl_id  
= i_appl_id ).
** Run Query to populate ct_data based on dimensions , selection criteria **.


        lv_first_call = abap_true.

*- Run Query to populate CT_DATA based on dimensions and selection criteria.

         obj_query->run_rsdri_query(

           EXPORTING

             it_dim_name       = lt_dim_name

             it_range          = lt_sel

             i_packagesize     = 500000

             if_check_security = abap_false

           IMPORTING

             et_data           = <t_tx_data>

             et_message        = et_message

           CHANGING

             c_first_call      = lv_first_call

          

).

former_member186338
Active Contributor
0 Kudos

Sorry, but you have to call it number of times! And you have to process records by each package... All 3 million will not fit in the memory!

lucas_costa3
Active Contributor
0 Kudos

Hi Raja,

Have you tried running this in parallel?

Too many records.

Former Member
0 Kudos

Nope.it too dint work 😞

Former Member
0 Kudos

In the above case, I have set my package size, since we dont know the full set of records during runtime. Lets assume, it picks the first 100 records, how would it know in the second record to pick the next set of records, we are not passing any other input to the method.

Correct me If I am wriong.

former_member186338
Active Contributor
0 Kudos

Is it so hard to investigate all parameters:

       IMPORTING

         et_data           = <lt_query_result>

*        e_end_of_data     =     " BPC: Last Data Package Yes/No

*        e_split_occurred  =     " Result may not be completely aggregated

         et_message        = lt_message    " BPC: Messages

*        e_stats_guid      =     " BPC: Statistics Session

*        e_cell_filted     =

former_member186338
Active Contributor
0 Kudos

By the way, can you explain what you want to do with the mentioned 3 million records?