SAP for Higher Education and Research Discussions
Spark conversations about student engagement, research optimization, and administrative efficiency using SAP in higher education and research. Join in!
cancel
Showing results for 
Search instead for 
Did you mean: 

FM/RFC to get Modules Booked In a Cohort

Former Member
0 Kudos

Hi,

I wanted to know if there is any FM/RFC to get modules for a cohort(Context Objects in Cohort Builder Screen). Thanks in Advacne.

Regards,

Khaleed.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Since it is OO-based there is no direct FM/RFC available. You can get a list of the Context Objects per Cohort and filter them afterwards (pt_obit_list below) by SM.

General Class with Static Methods:

cl_hrpiq00cohorts_general

Example:

ps_cohort-plvar = cl_hrpiq00const=>c_plvar_active.

ps_cohort-otype = cl_hrpiq00const=>c_otype_co.

ps_cohort-objid = piqcoh00-coh_objid.

TRY.

CALL METHOD cl_hrpiq00cohorts_general=>if_hrpiq00cohorts_query~generate_tree_for_cohorts

EXPORTING

cohort = ps_cohort

keydate = piqcoh00-keydate

context = piqcoh00-coh_conxt

IMPORTING

ref_to_cohort = gr_reference.

CATCH cx_hrpiq00cohorts_static_check. "#EC NO_HANDLER

ENDTRY.

PERFORM check_for_error CHANGING lv_subrc.

ENDIF.

REFRESH gt_coh_conxt_list.

CALL METHOD cl_hrpiq00cohorts_general=>if_hrpiq00cohorts_query~get_context_objects

EXPORTING

im_reference = gr_reference

IMPORTING

ex_obit_list = pt_obit_list.

See report RHIQCOH00 for more information.

Good Luck!

Jeroen Boeracker

View solution in original post

2 REPLIES 2

Former Member
0 Kudos

Hi,

Since it is OO-based there is no direct FM/RFC available. You can get a list of the Context Objects per Cohort and filter them afterwards (pt_obit_list below) by SM.

General Class with Static Methods:

cl_hrpiq00cohorts_general

Example:

ps_cohort-plvar = cl_hrpiq00const=>c_plvar_active.

ps_cohort-otype = cl_hrpiq00const=>c_otype_co.

ps_cohort-objid = piqcoh00-coh_objid.

TRY.

CALL METHOD cl_hrpiq00cohorts_general=>if_hrpiq00cohorts_query~generate_tree_for_cohorts

EXPORTING

cohort = ps_cohort

keydate = piqcoh00-keydate

context = piqcoh00-coh_conxt

IMPORTING

ref_to_cohort = gr_reference.

CATCH cx_hrpiq00cohorts_static_check. "#EC NO_HANDLER

ENDTRY.

PERFORM check_for_error CHANGING lv_subrc.

ENDIF.

REFRESH gt_coh_conxt_list.

CALL METHOD cl_hrpiq00cohorts_general=>if_hrpiq00cohorts_query~get_context_objects

EXPORTING

im_reference = gr_reference

IMPORTING

ex_obit_list = pt_obit_list.

See report RHIQCOH00 for more information.

Good Luck!

Jeroen Boeracker

0 Kudos

Hi Jeroen,

Thanks a lot, it is working fine.

Regards,

Khaleed.

Edited by: Khaleed on Apr 25, 2011 10:57 AM