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 statement for rseidoc2

Former Member
0 Likes
3,001

This is my submit statement

Submit rseidoc2 with docnum in edidc-docnum with credat in edidc-credat using selection-table it_selection exporting list to memory and return.

After the call fm list from memory.

When I try to execute its getting the ABAP dump as no data found.

Can anyone tell me how to fectch the output from rseidoc2 with submit statement.

11 REPLIES 11
Read only

mmcisme1
Active Contributor
2,628

This is copied from the help.... Did you do something similar to this? Remembering to put your ranges into a range table instead of appending them without the sign, option, low, high? You might want to check the other examples in help and see if they are useful. If none of that works, come back and show your entire code - before the submit.

REPORT report2.

DATA: text TYPE c LENGTH 10,
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
range_tab LIKE RANGE OF text,
range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = 'ABAP'.
APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'H'.
APPEND range_line TO range_tab.

range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'K'.
APPEND range_line TO range_tab.

Read only

Former Member
0 Likes
2,628

Hi Michelle,

TABLES: edidc.
DATA: email TYPE ad_smtpadr.
DATA: it_tab TYPE TABLE OF rsparams,
wa_tab TYPE rsparams.
DATA BEGIN OF it_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF it_list.
SELECT-OPTIONS mail_id FOR email.
SELECT-OPTIONS: s_credat FOR edidc-credat DEFAULT sy-datum TO sy-datum,
s_docnum FOR edidc-docnum.
START-OF-SELECTION.
wa_tab-selname = 'CREDAT'.
wa_tab-kind = 'S'.
wa_tab-sign = 'I'.
wa_tab-option = 'BT'.
wa_tab-low = s_credat-low.
wa_tab-high = s_credat-high.
APPEND wa_tab TO it_tab.
CLEAR wa_tab.

wa_tab-selname = 'DOCNUM'.
wa_tab-kind = 'S'.
wa_tab-sign = 'I'.
wa_tab-option = 'BT'.
wa_tab-low = s_docnum-low.
wa_tab-high = s_docnum-high.
APPEND wa_tab TO it_tab.
CLEAR wa_tab.

SUBMIT rseidoc2 WITH credat IN s_credat
WITH docnum IN s_docnum
WITH SELECTION-TABLE it_tab EXPORTING LIST TO MEMORY AND RETURN.

My requirement is sending an email which contains the idoc details.

Read only

0 Likes
2,628
srividya421 Why don't you read the table EDIDC instead of calling RSEIDOC2 ?
Read only

Former Member
0 Likes
2,628

Hello Sandra,

In rseidoc2 authority checks and lots of functionality involved in it.

With submit statement can't we call rseidoc2 ?? Can I get the reason for that.

Read only

0 Likes
2,628

srividya421 You may call RSEIDOC2 with SUBMIT but that's non-sense. Would you call SAPMV45A (VA03) to read sales orders? No, you read tables VBAK, VBAP, etc. Because of performance, because the program is for interactive dialog, its goal is not for being called from another program (it's not part of an API).

Ask the authorization guy to determine what authorization to check, and do the check in your program (for instance AUTHORITY-CHECK OBJECT 'S_TCODE' ID 'TCD' FIELD 'WE02')

Read only

Sandra_Rossi
Active Contributor
2,628

RSEIDOC2 is the program corresponding to transaction code WE02, which displays the control records of IDocs.

Why don't you read them directly from the table EDIDC?

SELECT * FROM EDIDC
    WHERE docnum IN s_docnum
      AND credat IN s_credat
    INTO TABLE @DATA(lines_of_edidc).
Read only

kartikrajag
Participant
2,628

Its not a bad idea to mention here, the context of your requirement.

On a high level, what WE02 does is, it fetches data from EDDIC, EDIDS & EDID4 for selection screen inputs, then organizes output to ALV tree by grouping Idoc type, messages,....etc; by SUBMIT rseidoc2; if you are trying to skip/avoid joining and fetching from above three tables; I'm not sure whether its worth of your effort.

If you are trying to extract data from EDID4-SDATA, below steps may accelerate your effort:

LOOP on EDID4 ASSIGNING FIELD-SYMBOL(<fs_edid4>).

  1. CREATE DATA lv_segmentdata TYPE (<fs_edid4>-segnam).
  2. ASSIGN lv_segmentdata->* TO FIELD-SYMBOL(<fs_segmentdata>).
  3. <fs_segmentdata> = <fs_edid4>-sdata. "copy idoc data to segment's structure

ENDLOOP.

Read only

RaymondGiuseppi
Active Contributor
2,628

RSEIDOC2 should generate an ALV, you could try to use cl_salv_bs_runtime_info to get the alv data back and prevent the display

But what was the original requirement, do you actually require the formatting of data (texts, icons) executed by the standard report?

Read only

0 Likes
2,628

Hi ,

The output of standard report has to send as an email.

Read only

0 Likes
2,628

In this case use

  • cl_salv_bs_runtime_info=>set " prevent ALV display and store data/metadata
  • submit report " execute ALV
  • cl_salv_bs_runtime_info=>get_data_ref " get data
  • cl_salv_bs_runtime_info=>get_metadata " get metadata
  • cl_salv_ex_util=>factory_result_data_table " prepare data
  • cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform " generate xml
  • cl_salv_bs_runtime_info=>clear_all " cleanup
  • cl_bcs
  • cl_document_bcs=>create_document
  • cl_document_bcs->add_attachment
Read only

2,628

Just tested successfully (on ABAP 7.52 system). Strange that such a transaction with tree control works, but well, it works. Anyway, I wouldn't use this solution in case the UI evolves, especially because it corresponds exactly to the table EDIDC (except icons to take from EDIDS I guess)...

DATA lr_itab TYPE REF TO data.
cl_salv_bs_runtime_info=>set(
  EXPORTING display  = abap_false
            metadata = abap_false
            data     = abap_true ).
DATA credat_range TYPE RANGE OF edidc-credat.
credat_range = VALUE #( sign = 'I' option = 'BT' ( low = '20200801' high = sy-datum ) ).
SUBMIT rseidoc2 WITH credat IN credat_range AND RETURN.
cl_salv_bs_runtime_info=>get_data_ref(
      IMPORTING r_data = lr_itab ).