cancel
Showing results for 
Search instead for 
Did you mean: 

What's wrong with my code?(about RSDRI_INFOPROV_READ)

0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jacky,

I just found this thread because I had the same problem. Actually, for my problem I found the solution: the names of the target columns in your internal data have to be written in capital letters.

For example instead of

wa_SFC-chaalias = 'i_zgultima'.

you should try

wa_SFC-chaalias = 'I_ZGULTIMA'.

This helped in my case.

Please let us know if this solves the problem for you.

Florian

Former Member
0 Kudos

Hi,

the first thing is to add an

insert wa_sfc into table th_sfc 

after each characteristic you want to read.

with your code you'll just have TRANDATE.

but what is not working exactly, do you get an exception?

let us know

Olivier.

0 Kudos

Yes, you are right, I have add the insert statements.

but the error still there, the error occur during call RSDRI_INFOPROV_READ, exception code is 11

Former Member
0 Kudos

having exception OTHERS is quite tricky to solve....

try first simplifying it and get it work; then enchance it...

try the following



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.
    insert wa_sfc into table th_sfc.

    clear wa_sfc.
    wa_SFC-CHANM = 'ZUSAGEID'.
    wa_SFC-chaalias = 'i_zusageid'.
    wa_sfc-orderby = 0.
   insert wa_sfc into table th_sfc.

    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 = 'X'. "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 "why?
		I_Packagesize = 100
		i_authority_check = 'R' "rsdrc_c_authchk-read
*		i_reference_date = sy-datum "why?
*		I_ROLLUP_ONLY = RS_C_FALSE "why?
	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.
		BREAK-POINT.
*		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.

Former Member
0 Kudos

Hi,

Did you check whether this blog is useful:

/people/dinesh.lalchand/blog/2006/06/07/reading-infocube-data-in-updatetransfer-rules

Bye

Dinesh

0 Kudos

yes, i have read that article, and also have a look at the demo program in the system, but can find the reason