Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Submit a report using class cl_salv_bs_runtime_info

marcosch
Explorer
0 Likes
5,816

Hi experts

Im trying to submit a standart report with the class cl_salv_bs_runtime_info.

First I call the method set like this:

  cl_salv_bs_runtime_info=>set(

    EXPORTING display  = abap_false

              metadata = abap_false

              data     = abap_true ).

then I submit the report and then call the method data_ref like this:

  TRY.

      cl_salv_bs_runtime_info=>get_data_ref(

  IMPORTING r_data = lf_ref ).

      ASSIGN lf_ref->* TO <lt_data>.

    CATCH cx_salv_bs_sc_runtime_info.

      MESSAGE `Unable to retrieve ALV data` TYPE 'E'.

  ENDTRY.

The ALV output in the standard report is generated with

The output in ALV is created:


CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
       i_callback_program = repid
       i_structure_name   = 'Struc_name'
       is_layout          = layout
       it_fieldcat        = fieldcat
       i_default          = 'X'
       i_save             = 'X'
       is_variant         = variant
       it_events          = events
     TABLES
       t_outtab           = output_tab
     EXCEPTIONS
       OTHERS             = 1.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.


Now I have the data I need from output_tab in<lt_data> which is wonderful, but now my problem:

The standard report has header data which is created by the form top-of-page which i cant retrieve:

TOP-OF-PAGE.


   SKIP.
   WRITE:  / _output_header-name1,
           / _output_header-name2,
           / _output_header-strasse,
           / _output_header-ort,
           / _output_header-zusatz.
   SKIP TO LINE 10.

   _output_header-seite = sy-pagno.
   WRITE: / _output_header-unummer NO-GAP, _output_header-seite.
   SKIP.
   WRITE: / _output_header-kontaktp NO-GAP.
   SKIP 2.
  WRITE: / _output_header-telefon NO-GAP, _output_header-ugroesse NO-GAP
  , _output_header-barbzeit NO-GAP,
            p_verf.


Is there a possibility to catch this header data with the class cl_salv_bs_runtime_info?

Many many thanks to you all and regards

Marco

Hi experts

Im trying to submit a standart report with the class cl_salv_bs_runtime_info.

First I call the method set like this:

  cl_salv_bs_runtime_info=>set(

    EXPORTING display  = abap_false

              metadata = abap_false

              data     = abap_true ).

then I submit the report and then call the method data_ref like this:

  TRY.

      cl_salv_bs_runtime_info=>get_data_ref(

  IMPORTING r_data = lf_ref ).

      ASSIGN lf_ref->* TO <lt_data>.

    CATCH cx_salv_bs_sc_runtime_info.

      MESSAGE `Unable to retrieve ALV data` TYPE 'E'.

  ENDTRY.

The ALV output in the standard report is generated with

The output in ALV is created:


CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
       i_callback_program = repid
       i_structure_name   = 'Struc_name'
       is_layout          = layout
       it_fieldcat        = fieldcat
       i_default          = 'X'
       i_save             = 'X'
       is_variant         = variant
       it_events          = events
     TABLES
       t_outtab           = output_tab
     EXCEPTIONS
       OTHERS             = 1.
   IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.


Now I have the data I need from output_tab in<lt_data> which is wonderful, but now my problem:

The standard report has header data which is created by the form top-of-page which i cant retrieve:

TOP-OF-PAGE.


   SKIP.
   WRITE:  / _output_header-name1,
           / _output_header-name2,
           / _output_header-strasse,
           / _output_header-ort,
           / _output_header-zusatz.
   SKIP TO LINE 10.

   _output_header-seite = sy-pagno.
   WRITE: / _output_header-unummer NO-GAP, _output_header-seite.
   SKIP.
   WRITE: / _output_header-kontaktp NO-GAP.
   SKIP 2.
  WRITE: / _output_header-telefon NO-GAP, _output_header-ugroesse NO-GAP
  , _output_header-barbzeit NO-GAP,
            p_verf.


Is there a possibility to catch this header data with the class cl_salv_bs_runtime_info?

Many many thanks to you all and regards

Marco

5 REPLIES 5
Read only

former_member184497
Participant
0 Likes
2,082

Hi ,

Have you tried the method,

GET_DATA?

Read only

0 Likes
2,082

Hi

Yes, I already tried this method, same result.

Read only

marcosch
Explorer
0 Likes
2,082

Hi again

does nobody know a solution to this problem?

Read only

Former Member
0 Likes
2,082

Hi Marco,

I dont think you can gain access to the header information using this class.

Still you can have a look at the below link.

http://scn.sap.com/community/abap/blog/2011/07/07/gain-programmatic-access-to-data-of-sapgui-alv-rep...

Regards,

Santanu Mohapatra.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,082

As this class deactivate the display of the ALV there is little chance that the TOP_OF_PAGE event will be triggered, so the WRITE statements should not even be executed, and there is no method to recover some data not part of the ALV (internal table data and layout information only)

Regards,

Raymond