WWI - 3.2 SP22
EH&S - 2005 603
Hi, all.
We have a req't for a remote-enabled fm that will allow the ability to compare WWI reports. To do the compare, 2 reports (header) will be the import param (RCGDHIOT) and the doc data (RCGREPFILE) after comparison will be export param. I have leveraged the fm C1G2_REPORTS_COMPARE to be able to download the target doc data after comparing the 2 reports. In my Z fm (C1G2_REPORTS_COMPARE copy), I directly call the fm C12H_WWI_COMPARE_WWISERVER that calls the rfc WWI_COMPARE to do the report comparison in the wwi server. The source doc files raw data are supplied. However, I get subrc = 6 (result_not_found) and nothing in the error table. Does anyone have a clue as to the reason why? Connection to WWI server is ok. Will rfc trace in the wwi server help?
I'm hoping someone can shed light about this issue I'm having...
Thanks.
- Code: Select all
FUNCTION zi360_spec_rpt_compare.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" XT_REPHEAD STRUCTURE RCGDHIOT
*" ET_REPCMP STRUCTURE RCGREPFILE
*" ET_RETURN STRUCTURE BAPIRET2 OPTIONAL
*"----------------------------------------------------------------------
* Local data -----------------------------------------------------------
DATA : v_docdata_raw_1_tab TYPE esp9_orblk_tab_type WITH HEADER LINE.
DATA : v_docdata_raw_2_tab TYPE esp9_orblk_tab_type WITH HEADER LINE.
DATA : v_docinfo_1_tab TYPE espre_apidi_tab_type WITH HEADER LINE.
DATA : v_docinfo_2_tab TYPE espre_apidi_tab_type WITH HEADER LINE.
DATA : v_flg_compare_allowed TYPE esp1_boolean.
DATA : v_flg_wrong_application TYPE esp1_boolean.
DATA : v_marked_leaves LIKE sy-tabix.
DATA: lt_return TYPE TABLE OF bapiret2.
DATA: l_trg_doc_tab TYPE TABLE OF rcgrepfile.
* Function body --------------------------------------------------------
* initialize data
clfrsh: et_repcmp,
et_return.
v_flg_compare_allowed = true.
v_flg_wrong_application = false.
* collect report data for download
PERFORM l_prepare_reports_compare
TABLES
xt_rephead
v_docdata_raw_1_tab
v_docdata_raw_2_tab
v_docinfo_1_tab
v_docinfo_2_tab
CHANGING
v_flg_compare_allowed
v_flg_wrong_application
v_marked_leaves.
IF v_flg_compare_allowed EQ false.
* failed to get report data
* Fehlende Daten für Berichtsvergleich
* fill RETURN tab
CLEAR et_return.
MESSAGE s871(c$)
INTO et_return-message.
symsg2bapi et_return.
APPEND et_return.
EXIT.
ENDIF.
IF v_flg_wrong_application EQ true.
* one document has a wrong ws-application (not WWI)
* Falsche WWI-Applikation
* fill RETURN tab
CLEAR et_return.
MESSAGE s876(c$)
INTO et_return-message.
symsg2bapi et_return.
APPEND et_return.
EXIT.
ENDIF.
IF v_marked_leaves > 2.
* fill RETURN tab
CLEAR et_return.
MESSAGE s013(cm_report_infosys) WITH v_marked_leaves
INTO et_return-message.
symsg2bapi et_return.
APPEND et_return.
EXIT.
ENDIF.
* download data and perform report comparison
* read first entry
READ TABLE v_docinfo_1_tab.
READ TABLE v_docinfo_2_tab.
* CALL FUNCTION 'C12H_WWI_DISPLAY_COMPARE'...
CALL FUNCTION 'C12H_WWI_COMPARE_WWISERVER'
EXPORTING
i_source_doc1_size = v_docinfo_1_tab-filebytes1
i_source_doc2_size = v_docinfo_2_tab-filebytes1
TABLES
i_source_doc1 = v_docdata_raw_1_tab
i_source_doc2 = v_docdata_raw_2_tab
e_target_doc = l_trg_doc_tab
e_msg_tab = lt_return
EXCEPTIONS
wwianchor_not_found = 1
dest_not_found = 2
esnohord_not_found = 3
wwi_generation_failure = 4
no_wwi_server_available = 5
OTHERS = 6.
IF sy-subrc 0.
* fill RETURN tab
CLEAR et_return.
MESSAGE s139(c$) WITH
sy-repid sy-subrc 'WWI_DISPLAY_COMPARE_FAILED'
* Es ist ein interner Fehler aufgetreten: &1 &2 &3.
INTO et_return-message.
symsg2bapi et_return.
APPEND et_return.
ELSE.
APPEND LINES OF l_trg_doc_tab TO et_repcmp.
ENDIF.
APPEND LINES OF lt_return TO et_return.
ENDFUNCTION.

