The result is print out this line in the screen:
'11 305 DBMAN ZUTI_USA'
My code is:
&----
*& Report ZREADDSO
*&
&----
*&
*&
&----
REPORT ZREADDSO.
TYPE-POOLS: rs, rsdrc.
types:
begin of TResult,
i_zgultima type /BIC/OIZGULTIMA,
i_zusageid type /BIC/OIZUSAGEID,
i_ztd type /BIC/OIZTRANDATE,
osm_count type /BI0/OISM_COUNT,
end of TResult.
data:
TheDSO type RSINFOPROV,
TH_SFC TYPE RSDRI_TH_SFC,
TH_SFK TYPE RSDRI_TH_SFK,
T_MSG type RS_T_MSG,
First_time_Call type RS_BOOL,
WA_SFC type RSDRI_S_SFC,
WA_SFK type RSDRI_S_SFK,
wa_T_data type TResult,
T_DATA type standard TABLE of TResult,
errorinfo type ref to cx_root,
g_s_end type rs_bool,
text type string.
The dso name
TheDSO = 'ZUTI_USA'.
The Char.s
clear wa_sfc.
wa_SFC-CHANM = 'ZGULTIMA'.
wa_SFC-chaalias = 'i_zgultima'.
wa_sfc-orderby = 0.
clear wa_sfc.
wa_SFC-CHANM = 'ZUSAGEID'.
wa_SFC-chaalias = 'i_zusageid'.
wa_sfc-orderby = 0.
clear wa_sfc.
wa_SFC-CHANM = 'ZTRANDATE'.
wa_SFC-chaalias = 'i_ztd'.
wa_sfc-orderby = 0.
insert wa_sfc into table th_sfc.
The key figures
clear wa_sfk.
wa_SFK-KYFNM = '0SM_COUNT'.
wa_sfk-kyfalias = 'osm_count'.
wa_sfk-aggr = 'SUM'.
insert wa_sfk into table th_sfk.
g_s_end = rs_c_false.
first_time_call = rs_c_true.
try.
while g_s_end = rs_c_false.
call function 'RSDRI_INFOPROV_READ'
exporting
I_INFOPROV = TheDSO
I_TH_SFC = TH_SFC
I_TH_SFK = TH_SFK
i_save_in_table = rs_c_false
i_save_in_file = rs_c_false
I_MAXROWS = 1000
I_Packagesize = 100
i_authority_check = rsdrc_c_authchk-read
i_reference_date = sy-datum
I_ROLLUP_ONLY = RS_C_FALSE
importing
E_T_Data = T_Data
e_end_of_data = g_s_end
changing
C_FIRST_CALL = First_time_call
EXCEPTIONS
illegal_input = 1
illegal_input_sfc = 2
illegal_input_sfk = 3
illegal_input_range = 4
illegal_input_tablesel = 5
no_authorization = 6
illegal_download = 8
illegal_tablename = 9
OTHERS = 11.
IF sy-subrc <> 0.
WRITE: / sy-subrc, sy-msgno, sy-msgid, sy-msgv1, sy-msgv2, sy-msgv3.
EXIT.
ELSE.
LOOP AT t_data INTO wa_t_data.
WRITE: / wa_t_data-i_zgultima,
wa_t_data-osm_count.
ENDLOOP.
endif.
endwhile.
catch cx_root into errorinfo.
text = errorinfo->get_text( ).
write: / , text.
endtry.
Message was edited by:
Jacky Zhang