Useful SAP function modules and BAPI's for training and events management - SAP TEM
When working with training and events management you can get the course/event details directly from the HRP1001, HRP1000 etc tables or
you can use a number of function modules from function group RHVI. Below is a list and description of a some of these function modules!
Function Module / BAPI
RH_READ_OBJECT
Read infotype 1002 data.
CALL FUNCTION 'RH_READ_OBJECT' EXPORTING plvar = wa_hrv1002a-plvar otype = wa_hrv1002a-otype objid = wa_hrv1002a-objid begda = wa_hrv1002a-begda endda = wa_hrv1002a-endda IMPORTING obeg = wa_etype-etbeg oend = wa_etype-etend short = wa_etype-etsht stext = wa_etype-etstx EXCEPTIONS not_found = 1 OTHERS = 2.
BAPI_BUS_EVENT_LIST
Retrieve detials of actual scheduled occurance of course. including detials such as
location, location name, date, min capacity, optimum capacity, max capacity, available places, No. attendees booked, Num waiting etc. Also see
table HRP1024 for some details such as max capacity, min capacity etc!
CALL FUNCTION 'BAPI_BUS_EVENT_LIST' EXPORTING plvar = '01' objid = gd_objid begin_date = gd_begda "'20040101' end_date = gd_endda "'99991231' TABLES event_list = it_elist EXCEPTIONS NO_EVENTS = 1 NO_ACTIVE_PLVAR = 2 UNKNOWN_EXCEPTION = 3 OTHERS = 4.
BAPI_BUS_EVENTTYPE_INFO
Retrieve business event type(BET) data (Global description of course). Such as
description, suitablility, tutors, other relationship details etc
CALL FUNCTION 'BAPI_BUS_EVENTTYPE_INFO' EXPORTING plvar = '01' objid = gd_etyid begin_date = gd_begda "'20040101' end_date = gd_endda "'99991231' TABLES eventtype_desc = it_evttypedesc EXCEPTIONS root_not_found = 1 no_active_plvar = 2 unknown_exception = 3 OTHERS = 4.
BAPI_BUS_EVENT_INFO
Retrieve business event(BE) data (Actual occurance of course). Such as description,
suitablility, tutors, other relationship details etc. Data entered at this level should be
used instead of that found at BET level
CALL FUNCTION 'BAPI_BUS_EVENT_INFO' EXPORTING plvar = '01' objid = objid begin_date = gd_begda "'20040101' end_date = gd_endda "'99991231' language = 'E' TABLES event_desc = it_evtdesc event_resou = it_evtresou event_quali = it_evtquali EXCEPTIONS no_root_found = 1 no_active_plvar = 2 unknown_exception = 3 OTHERS = 4.
RH_READ_EVENT_SCHEDULE
Retrieve schedule information of course instance such as date(s) and time(s).
CALL FUNCTION 'RH_READ_EVENT_SCHEDULE' TABLES eventlist = it_eventlist schedule_tab = it_schedule EXCEPTIONS nothing_found = 1 OTHERS = 2.
Related Articles
SAP TEM course attendees
SAP TEM course attendees
Retrieve SAP business events(BE) within BEG and BET
Structure of a BEG, BET and BE
Basic SAP TEM table relationships