Wednesday, 09 June 2021 14:58

Calling the Submit Report/ Program through the Odata Service

Written by sreeram gottapu
Rate this item
(0 votes)
Source https://blogs.sap.com/2021/06/10/calling-the-submit-report-program-through-the-odata-service/
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”

Hi All,

All of you know the Alv report and OData service individually. Coming to this scenario some of the members don’t aware how to use the Report through Submit in OData service.

So I am trying to explain how do we use Submit report in Netweaver gate way services.

Note: Please follow the following steps

Create the custom program:

Step1:  Go to t-code SE38

Step2 : Create one sample report with the required fields like below.

REPORT zsubmit_demo81.

** Data declarations
DATA:  lv_vbeln TYPE vbeln_va,
o_alv TYPE REF TO cl_salv_table.

** Select options
SELECT-OPTIONS: s_vbeln FOR lv_vbeln.

** Get data
SELECT vbeln, posnr, matnr
FROM vbap
UP TO 10 rows
INTO TABLE @DATA(lt_vbap)
WHERE vbeln IN @s_vbeln  .

** Assign internal table to method
cl_salv_table=>factory(
IMPORTING
r_salv_table = oval
CHANGING
t_table = lt_vbap ).

**   Display Data
o_alv->display( ).

Execute :

Output:

Using the Report in OData service :

Step3: Create the project with t-code ‘SEGW’.

Step4: Create the method and redefine it

Step5: Use the already created program SUBMIT as like below.

METHOD sales_detailset_get_entityset.

** Data declarations
DATA:  lt_seltab TYPE TABLE OF rsparams,
ls_seltab LIKE LINE OF lt_seltab,
list_tab TYPE TABLE OF abaplist,
ls_data TYPE REF TO data.
FIELD-SYMBOLS: <lt_data> TYPE table.

** Passing the values
ls_seltab-selname = ‘S_VBELN’.
ls_seltab-kind = ‘S’.
ls_seltab-sign = ‘I’.
ls_seltab-option = ‘EQ’.
ls_seltab-low = ‘4970’.

** Disable the display and metadata
cl_salv_bs_runtime_info=>set(
display = abap_false
metadata = abap_false
data = abap_true ).

** Passing the i/p values to internal table
APPEND ls_seltab TO lt_seltab.

** Using the report through Submit
SUBMIT zsubmit_demo81 WITH SELECTION-TABLE lt_seltab EXPORTING LIST TO MEMORY AND RETURN.

IF sy-subrc = 0.

**  Getting the internal table data
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = ls_data ).

ASSIGN ls_data->* TO <lt_data>.
MOVE-CORRESPONDING <lt_data> TO et_entityset.

ENDIF.

ENDMETHOD.

Step6: Go to the maintain services T-code ‘/n/iwfnd/maint_services‘ and execute it.

Step7: Find the project and execute it.

Note : Here we are displayed the same data as like got the data in submit report

I hope it will be helpfull to you

Thanks,

Sreeram G.

Continue reading here
Read 73 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.