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

Type conflict for the field in function module.

Former Member
0 Likes
745

Hi Gurus,

I get the data into an internal table itab which has field that contains the infoobjects names. Later I have to pass this value to the function module which has type like g_s_sfc which is of type rsdri_th_sfc -- structure.

This itab-iobjnm = g_th_sfc

In the function module RSDRI_INFOPROV_READ., I can only pass g_th_sfc. But this is of type structure.

how do I assign the values of itab-iobjnm to g_th_sfc. I tried creating a field symbol and then assigning but still does'nt work.

Please advise, your help is greatful to me.

Thanks,

Prashant.

Hi Gurus,

I get the data into an internal table itab which has field that contains the infoobjects names. Later I have to pass this value to the function module which has type like g_s_sfc which is of type rsdri_th_sfc -- structure.

This itab-iobjnm = g_th_sfc

In the function module RSDRI_INFOPROV_READ., I can only pass g_th_sfc. But this is of type structure.

how do I assign the values of itab-iobjnm to g_th_sfc. I tried creating a field symbol and then assigning but still does'nt work.

Please advise, your help is greatful to me.

Thanks,

Prashant.

3 REPLIES 3
Read only

Former Member
0 Likes
707

Hi Prashant,

Can you show your code and also what the error is.

Regards,

Atish

Read only

0 Likes
707

***************************************************

DATA: BEGIN OF line occurs 0,

infocube TYPE RSDCUBEIOBJ-INFOCUBE,

iobjnm TYPE RSDCUBEIOBJ-IOBJNM,

drilevel TYPE /obt/iobj-drilevel,

alternative type /obt/iobj-alternative,

END OF line.

DATA : FLAG TYPE C.

DATA : FLAG_LEVEL_1 type c.

DATA itab LIKE SORTED TABLE OF line WITH UNIQUE KEY table_line.

*DATA itab LIKE LINE.

DATA itab1 LIKE LINE OCCURS 0 WITH HEADER line.

DATA line_wa like line.

DATA itab1_wa like line.

DATA lin TYPE i.

DATA:

g_s_data TYPE gt_s_data,

g_s_sfc TYPE rsdri_s_sfc,

g_th_sfc TYPE rsdri_th_sfc.

SELECT finfocube giobjnm gdrilevel galternative

INTO CORRESPONDING FIELDS OF TABLE line

FROM RSDCUBEIOBJ as F

INNER JOIN /OBT/IOBJ as G

on fiobjnm = giobjnm

where f~objvers = 'A'

and g~tlogo = 'CUBE'.

sort line by infocube drilevel ALTERNATIVE.

loop at line .

move-corresponding line to line_wa .

at new infocube.

CLEAR : FLAG, FLAG_LEVEL_1.

if line_wa-drilevel <> 1.

FLAG_LEVEL_1 = 'X'.

continue.

endif.

endat.

CHECK FLAG_LEVEL_1 IS INITIAL.

case line_wa-drilevel.

when 1.

move-corresponding line_wa to itab1_wa.

append itab1_wa to itab1.

when 2.

if line_wa-alternative = 'PRIMARY'.

move-corresponding line_wa to itab1_wa.

append itab1_wa to itab1.

FLAG = 'X'.

continue.

endif.

if line_wa-alternative = 'SECONDARY'.

IF FLAG <> 'X'.

move-corresponding line_wa to itab1_wa.

append itab1_wa to itab1.

continue.

endif.

ENDIF.

when others.

endcase.

endloop.

**************************************************************

Instead of hard coding here we have to pass the values of itab1-iobjnm to g_s_sfc-chanm

*

    • 0FISCYEAR

*CLEAR g_s_sfc.

    • --- name of characteristic

*g_s_sfc-chanm = '0FISCYEAR'.

    • --- name of corresponding column in G_T_DATA

*g_s_sfc-chaalias = 'FISCYEAR'.

    • --- no ORDER-BY

*g_s_sfc-orderby = 0.

    • --- include into list of characteristics

*INSERT g_s_sfc INTO TABLE g_th_sfc. ---> must be passed to the function module

*******************************************************

g_end_of_data = rs_c_false.

g_first_call = rs_c_true.

WHILE g_end_of_data = rs_c_false.

loop at itab1.

CALL FUNCTION 'RSDRI_INFOPROV_READ'

EXPORTING

i_infoprov = itab1-infocube

i_th_sfc = g_th_sfc --> type conflict error comes because here the

i_th_sfk = g_th_sfk values of itab1-iobjnm must be passed.

i_t_range = g_t_range

  • i_reference_date = sy-datum

  • i_t_requid = g_t_requid

  • i_save_in_table = rs_c_false

  • i_save_in_file = rs_c_false

i_packagesize = 50000

i_use_db_aggregation = rs_c_false

i_use_aggregates = rs_c_false

  • i_authority_check = rsdrc_c_authchk-read

IMPORTING

e_t_data = g_t_data

e_end_of_data = g_end_of_data

CHANGING

c_first_call = g_first_call

EXCEPTIONS

illegal_input = 1

illegal_input_sfc = 2

illegal_input_sfk = 3

illegal_input_range = 4

illegal_input_tablesel = 5

no_authorization = 6

ncum_not_supported = 7

illegal_download = 8

illegal_tablename = 9

OTHERS = 11.

IF sy-subrc <> 0.

BREAK-POINT. "#EC NOBREAK

EXIT.

ENDIF.

ENDLOOP.

  • for the sake of the example: print returned data

PERFORM print_result.

ENDWHILE.

*************************************************

I have given the comments where required please help.

Read only

0 Likes
707

data: g_th_sfk type RSDRI_TH_SFK.

CALL FUNCTION 'RSDRI_INFOPROV_READ'

EXPORTING

i_infoprov = itab1-infocube

i_th_sfc = g_th_sfc

i_th_sfk = g_th_sfk

i_t_range = g_t_range

.....

...