SAP TEM course attendees

The ABAP code below is an extract that shows how to retrieve a list of attendees for an SAP TEM business event (course). This only works if you are looing around the Business events which are denoted by an 'E'.

TABLES: objec.
tables: pa0001, pa0002, hrp1000, hrp1034, hrp1001.
INFOTYPES: 1001 NAME i1001 MODE n.
INFOTYPES: 1001 NAME note1001 OCCURS 0.
INFOTYPES: 1001 NAME partic_1001 OCCURS 0.
INFOTYPES: 1026 NAME i1026 MODE n.
DATA: w_d_begda LIKE sy-datum,
      w_d_endda LIKE sy-datum,
      w_d_event like hrp1001-sobid.
*if you are using GET objec this you need to ensure you have set the logical
*database to PCH in the abap program. Menu path Goto->Attributes.
*GET objec.
*LOOP Around your Business Events ( object type 'E')
  SELECT SINGLE sobid begda endda FROM hrp1001 INTO (w_d_event, w_d_begda, w_d_endda) WHERE plvar EQ objec-plvar
                            AND otype EQ objec-otype
                            AND objid EQ objec-objid
                            AND relat EQ '020'
                            AND rsign EQ 'A'
                            AND sclas EQ 'D'.
  IF sy-subrc EQ 0.
    SELECT * FROM hrp1001 WHERE plvar EQ objec-plvar
                          AND otype EQ 'D'
                          AND objid EQ w_d_event
                          AND relat EQ '034'
                          AND rsign EQ 'A'
                          AND begda EQ w_d_begda
                          AND endda EQ w_d_endda.
    ENDSELECT.
  ENDIF.
*ENDLOOP.

Related Articles

Information about SAP's Training and Event Management ( TEM ) application
SAP TEM course attendees
Useful SAP function modules and BAPI's for training and events management - SAP TEM
Retrieve SAP business events(BE) within BEG and BET
Structure of a BEG, BET and BE
Basic SAP TEM table relationships