SAP BI: Read Masterdata with compounded keys / RSAU_READ_MASTER_DATA

Hi SAP-BI-Folks,

this little template gives you the possibility to read on InfoObjects with compounded keys : I am normaly more a friend of my own Masterdata-Read-Routines – but i think it’s usefull to know:
released as usual under BSD-Licence:

TYPE-POOLS rsd.
DATA:
l_chavl TYPE rsd_chavl ,
t_dep_m TYPE rrsv_t_dep ,
s_dep_m TYPE rrsv_s_dep ,
l_chavl_m TYPE rschavl ,
wa_zmy_infoobject TYPE /bic/mzmy_infoobject.

CLEAR l_chavl.
l_chavl = result_fields-/bic/zmy_infoobject .

CLEAR t_dep_m[].
s_dep_m-chanm = 'ZCOMPOUND1' .
s_dep_m-chavl_int = result_fields-/bic/zcompound1 .
APPEND s_dep_m TO t_dep_m.
s_dep_m-chanm = 'ZCOMPOUND2' .
s_dep_m-chavl_int = result_fields-comp_code .
APPEND s_dep_m TO t_dep_m.
s_dep_m-chanm = 'ZMY_INFOOBJECT' .
s_dep_m-chavl_int = l_chavl .
APPEND s_dep_m TO t_dep_m.

CALL FUNCTION 'RRSV_CHA_VALUE_CONCATENATE'
EXPORTING
i_chanm = 'ZMY_INFOOBJECT'
i_chavl_int = l_chavl
IMPORTING
e_chavl_int = l_chavl_m
CHANGING
c_t_dep = t_dep_m
EXCEPTIONS
unknown_chanm = 1
invalid_format = 2
no_input_given = 3
OTHERS = 4.

REPLACE ALL OCCURRENCES OF '#' IN l_chavl_m WITH ` `.

CALL FUNCTION 'RSAU_READ_MASTER_DATA'
EXPORTING
i_iobjnm = 'ZMY_INFOOBJECT'
i_chavl = l_chavl_m
IMPORTING
e_structure = wa_zmy_infoobject
EXCEPTIONS
read_error = 1
no_such_attribute = 2
wrong_import_parameters = 3
chavl_not_found = 4.


Beitrag veröffentlicht

in

, ,

von