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

  • Muhammed M you may create an internal table from the field catalog it_fieldcatlog if it's of type lvc_t_fcat:

      FIELD-SYMBOLS <gt_pos_data> TYPE STANDARD TABLE.
      DATA lrt_pos_data TYPE REF TO data.
    
      CALL METHOD lcl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcatlog
        IMPORTING
          ep_table        = lrt_pos_data.
      ASSIGN lrt_pos_data->* TO <gt_pos_data>.
  • 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

  • Get RSS Feed

0 Answers