cancel
Showing results for 
Search instead for 
Did you mean: 

Error when trying to get ALV data from standard program

EWim
Explorer
0 Kudos
377

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:

EWim_0-1738916259579.png

This is what lt_comp and lt_components look like:

EWim_1-1738916301140.pngEWim_2-1738916318293.png

The issue appears when the following method is called:

EWim_3-1738916405190.png

I am honestly very lost on what's going on and how to solve it. 

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor
0 Kudos

The error indicates some Inconsistent Structure Table?

Did you already

  • Define your extracted internal table as TYPE TRLY_FLOW_ALV (or TABLE OF TRLS_FLOW_ALV)
  • Use R_DATA_DESCR for some dynamic coding with RTTI
  • Debug to look at actual received data type
  • Try to use GET_DATA and not GET_DATA_REF

Could you provide definition of fields such as LS_DATA (TYPE REF TO DATA?)

raymond_giuseppi
Active Contributor
0 Kudos
  • Are there any enhancements to the TRLS_FLOW_ALV structure or report logic in your system?
  • Call the report directly and view the ALV Consistency Check for 'exotic' fields in internal table and/or field catalog.
EWim
Explorer
0 Kudos

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.

EWim
Explorer
0 Kudos
I've now tried using R_DATA_DESCR and also tried using GET_DATA instead of GET_DATA_REF. Sadly I still get the same error.
EWim
Explorer
0 Kudos
@raymond_giuseppi I don't know how I missed that... Thank you so much for your help!
raymond_giuseppi
Active Contributor
0 Kudos
My systems had been updated too recently for me to see the anomaly. I had to remove my advanced search filters for notes

Answers (0)