2020 Sep 03 9:59 AM
Hi Experts,
I am pulling spool data from ALV using function module
RSPO_RETURN_ABAP_SPOOLJOB. However, the output of the FM is in plain text only and not divided into the columns of the internal table(that was used in the ALV). So it includes even the | | lines in the ALV output. I would want to use a certain column in the ALV table for further processing. Is there another FM that I can use to do this? Or a way to achieve this?
Thank you.
Regards,
Katherine Darunday
2020 Sep 03 10:42 AM
Could you use class cl_salv_bs_runtime_info to wrap the alv execution, you can then get the displayed internal table (and most ALV information) - many samples already available in forum
CALL METHOD cl_salv_bs_runtime_info=>set
EXPORTING
display = abap_false
metadata = abap_false
data = abap_true.
SUBMIT <report>
WITH ...
AND RETURN.
TRY.
CALL METHOD cl_salv_bs_runtime_info=>get_data_ref
IMPORTING
r_data = lr_data.
ASSIGN lr_data->* TO <inttab>.
CATCH cx_salv_bs_sc_runtime_info.
" do your duty
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
IF <inttab> IS NOT ASSIGNED.
" do your duty
ELSE.
" do your job
ENDIF.
NB: There is also an old report in the wiki : Convert Spool List to ALV Grid, did you find it?
2020 Sep 03 10:42 AM
Could you use class cl_salv_bs_runtime_info to wrap the alv execution, you can then get the displayed internal table (and most ALV information) - many samples already available in forum
CALL METHOD cl_salv_bs_runtime_info=>set
EXPORTING
display = abap_false
metadata = abap_false
data = abap_true.
SUBMIT <report>
WITH ...
AND RETURN.
TRY.
CALL METHOD cl_salv_bs_runtime_info=>get_data_ref
IMPORTING
r_data = lr_data.
ASSIGN lr_data->* TO <inttab>.
CATCH cx_salv_bs_sc_runtime_info.
" do your duty
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
IF <inttab> IS NOT ASSIGNED.
" do your duty
ELSE.
" do your job
ENDIF.
NB: There is also an old report in the wiki : Convert Spool List to ALV Grid, did you find it?
2020 Sep 03 12:16 PM
Hi Raymond,
The report where I am pulling the data from is a standard program RM06BB30. I am not submitting any program in background and only have the spool id to work with which is why I used the aforementioned FM. I need to pull the purchase requisition, and purchase orders from the ALV report.
But I'll try to check the link you have provided and see if I can use the logic for my requirement.
Thank you.
Regards,
Kath
2020 Sep 03 12:27 PM
No need to output a spool, you may retrieve the ALV contents directly into an internal table, as you can see in Raymond answer.