2025 Feb 06 9:16 AM - edited 2025 Feb 07 9:55 AM
Hello there,
I am new to SAP and ABAP and need some advice here. I am trying to write a z program that receives information out of the ALV grid of a standard program and writes these into an excel file. I tried the following code:
cl_salv_bs_runtime_info=>set( EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
SUBMIT (p_report) USING SELECTION-SET p_var AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = DATA(ls_data) ).
ASSIGN ls_data->* TO <lt_data>.
CATCH cx_root INTO DATA(e_txt).
WRITE: / e_txt->get_text( ).
ENDTRY.
Everytime I run it I get an Exception of the type "cx_sy_struct_attributes" that isn't declared in RAISING. I've tried to find the error with the debugger but I could not find much. I only know that the error occurs in the following code:
cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = DATA(ls_data) ).
Can someone help me find the error or has a different idea on how I get the AVL data from a standard program (in my case RTPM_TRL_SHOW_FLOWS) into an internal table?
Thanks in advance 🙂
EDIT:
I've looked at the issue again in the Debugger but I am not quite sure what to do with it.
I've figured out that there is a suffix for component 9 even tho it is not allowed:
This is what lt_comp and lt_components look like:
The issue appears when the following method is called:
I am honestly very lost on what's going on and how to solve it.
Request clarification before answering.
The error indicates some Inconsistent Structure Table?
Did you already
Could you provide definition of fields such as LS_DATA (TYPE REF TO DATA?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your help @raymond_giuseppi !
I have tried to define my extracted internal table as TYPE TRLY_FLOW_ALV and LS_DATA as TYPE REF TO DATA. Sadly it did not make a difference. I have updated my post with screenshots of the results from the debugger.
I have not tried GET_DATA instead of GET_DATA_REF and I did not use R_DATA_DESCR yet. I will look into it and come back with updates.
EDIT: There are also no enhancements made to TRLS_FLOW_ALV and the ALV Consistency Check also shows nothing.
User | Count |
---|---|
63 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.