Skip to Content

Unable to fetch data from standard report using Class cl_salv_bs_runtime_info

Hi Experts,

Currently i am working on a requirement to fetch output(ALV) of a standard report and place it on application server.

The standard report is using REUSE_ALV_GRID_DISPLAY to display the output.

I followed below approaches

1) SUBMIT XXXXXX AND RETURN EXPORTING LIST TO MEMORY and the FM's

'LIST_FROM_MEMORY' and 'LIST_TO_ASCI' .

The data is getting truncated while converting to ASCI when standard report output is run by selecting all columns.

2) Using Class CL_SALV_BS_RUNTIME_INFO .

1. I still see the output of the standard report after setting up run time info.
2. No data is retrieved in submit statement.
3. I set a break-point in the method SET_METADATA of CL_SALV_BS_RUNTIME_INFO but it is not getting triggered. 
cl_salv_bs_runtime_info=>set(
    EXPORTING display  = space
              metadata = space
              data     = 'X' ).
SUBMIT XXXXXX AND RETURN.
  TRY.
     cl_salv_bs_runtime_info=>get_data_ref(
        IMPORTING r_data = gt_pos_data ).
      ASSIGN gt_pos_data->* TO <gt_pos_data>.
    CATCH cx_salv_bs_sc_runtime_info.
       MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
  ENDTRY.


Appreciate if you could let me know if I am missing something here.

Regards,

Muhammed

Add comment
10|10000 characters needed characters exceeded

  • Hi Quynh Doan Manh

    I was trying with to export data using memory id 'ALV_EXTRACT_MODE'.

    I am able to import internal table it_fieldcatlog from memory id 'ALV_EXTRACT_FCAT'.

    When I'm trying to import it_outtab, the program is throwing up runtime error "

    CONNE_IMPORT_WRONG_STRUCTURE" because the internal table structures are different.

    IMPORT it_outtab to <gt_pos_data> FROM MEMORY ID 'ALV_EXTRACT_TABLE'.

    Is there any way to declare dynamic internal table with name it_outtab .

    Sandra Rossi appreciate your inputs.

    Regards,

    Muhammed

  • Im afraid that catalog and table columns not always the same and it true in this case. you may have to check the difference by yourself and hardcode it...(table output is saved in mt_outtab attribute of alv).

  • Hi Quynh Doan Manh

    Exactly the internal tables it_outtab it_fieldcatlog columns are not same and causing runtime errors.

    I will try to use exit EXIT_SAPLKAEP_009 to export/import <gt_pos_data> to memory.

    Regards,

    Muhammed

  • Follow
  • Get RSS Feed

0 Answers