Skip to Content
0
Jan 26, 2016 at 06:44 PM

Submit ALV report from function and pass the data to oData service

1167 Views

Hi Experts,

I have a requirement to show the result of a custom develop ALV report in an SAP Fiori app.

To execute the report I'm using the following code to extract the data from the ALV:

submit ZGEP_TMLISTAUSING SELECTION-SET 'ALAP' AND RETURN.
 try.
 cl_salv_bs_runtime_info=>get_data_ref( importing r_data = lr_pay_data ).
 assign lr_pay_data->* to <lt_pay_data>.
 catch cx_salv_bs_sc_runtime_info.
 message `Unable to retrieve ALV data` type 'E'.
 endtry.
 cl_salv_bs_runtime_info=>clear_all( ).

As a result I get the data in the <lt_pay_data> perfectly.

But when I call this function from the Data provider class of the oData service which should prepare the data from the Fiori App the lt_pay_data is unassigned, becouse the get_data_ref results an error as

SY-SUBRC = 4:

Unable to import data objects.

I tried to call this function from the gateway server with simple RFC, and it works this way as well.

So the only way it's not working is when the funcion module is called via the SAP Gateway Client, and the call is sent from the data provider class (which is implemented in the same ERP. )

My idea is that the oData call is an external session, but i guess the RFC call is external as well, so I don't get the couse of the problem.

Any tips how to solve this?

Any ideas are appreciated.

Thanks,

David