on 2021 Jun 30 5:28 PM
Hello,
We have an ABAP report with complex business logic and we would like to get the data from the program into SAP BW.
I managed to create an extractor based on a ABAP function module that calls the program and using cl_salv_bs_runtime_info retrieves the data without having to do any changes to the source program, which is perfect.
Unfortunately, I didn't consider that BW will create a background job and this results in the following error:
Control Framework: Fatal error - GUI cannot be reached
Is there a way to get the ALV data in background anyway? Preferably, without having to change the called program?
I'm a BW developer and not very experienced with output to GUI and any help is greatly appreciated.
Below my code.
* prepare
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
* Call program
SUBMIT zmm_rapport_ma USING SELECTION-SET 'ZBW_MM28' AND RETURN.
* Get ALV data
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_data ).
ASSIGN lr_data->* TO <fs_data>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.
IF <fs_data>[] IS ASSIGNED.
lt_mm[] = <fs_data>[].
ENDIF.
cl_salv_bs_runtime_info=>clear_all( ).
Request clarification before answering.
Hi,
consider to use the class CL_SALV_TABLE.
If you use the parameter LIST_DISPLAY in the factory function, the output is printed to the spool in background mode.
Hopefully this will help you for your requirements?
Best Regards
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe it's a custom program. So, you have to instantiate the ALV only if it's running in foreground mode.
if sy-batch eq abap_false.
"Instanciate ALV.
Endif.
If you do so then it will not go into dump.
Now second point is, how to get the data from the submit program. You can do it using either export ITAB to memory or using a static attribute of class to export it, then you have to import it in the function module.
Thanks,
Gourab
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandra,
Thank you for testing it.
What do you mean with controls? The buttons on top of the ALV grid?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
21 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.