Skip to Content
author's profile photo Former Member
Former Member

SUBMIT ALV Grid Report to Z program

Dear Experts,

I want to use the ALV Grid output of the standard program RFRECPSFA520 in my Z program. I know that using the Method cl_salv_bs_runtime_info=>set, SUBMIT and Return and then cl_salv_bs_runtime_info=>get_data_ref gives you the desired result. But I am getting the exception CX_SY_STRUCT_COMP_NAME since 'Component Name '%_KEY' of the Component 1 Contains an Invalid Character'.


My Code:


TYPES: BEGIN OF abap_componentdescr,
name TYPE string,
type TYPE REF TO cl_abap_datadescr,
as_include TYPE abap_bool,
suffix TYPE string,
END OF abap_componentdescr.

DATA: lt_test TYPE STANDARD TABLE OF abap_componentdescr
WITH KEY name.

DATA: structdescr TYPE REF TO cl_abap_structdescr,
lo_ref TYPE REF TO data.

TRY.
structdescr ?= cl_abap_structdescr=>create(
p_components = lt_test
p_strict = cl_abap_structdescr=>false ).
CATCH cx_sy_struct_creation.
ENDTRY.

*-- Get the report lines as internal table
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING
r_data = lo_ref ).
ASSIGN lo_ref->* TO <lt_data>.
CATCH cx_salv_bs_sc_runtime_info.
ENDTRY.


I am not getting any value in lt_test and after that I am getting a dump from the method cl_salv_bs_runtime_info=>get_data_ref.


Please help!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 06, 2016 at 12:47 PM

    You should attach the short dump (as txt file).

    Does it occur at CL_SALV_BS_RUNTIME_INFO=>GET_DATA_REF or where?

    If RFRECPSFA520 generates an internal table with component named %_KEY, then it's possible that the standard method CREATE_DATA_FOR_COMPONENT of class CL_SALV_BS_DDIC has a little flaw in lines "if ls_comp-name ca '-'. l_strict = abap_false. endif." I guess it should be "if ls_comp-name ca '-%'." (and all other non-strict characters)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.