Code: Alles auswählen.
DATA: l_classes_in_workarea LIKE classes_in_workarea,
l_mtk_selection TYPE cpsc_mtk_sel_type,
l_tsk_selection TYPE cpsc_tsk_sel_type,
l_opr_selection TYPE cpsc_opr_sel_type,
l_suo_selection TYPE cpsc_suo_sel_type.
DATA: lt_opr_class_data TYPE TABLE OF opr_class_data,
lt_sub_opr_class_data TYPE TABLE OF opr_class_data,
l_opr LIKE opr_class_data,
lt_mtk_class_data TYPE TABLE OF mtk_class_data.
l_classes_in_workarea-mtk_inarea = 'X'.
l_classes_in_workarea-tsk_inarea = 'X'.
l_classes_in_workarea-seq_inarea = 'X'.
l_classes_in_workarea-opr_inarea = 'X'.
l_classes_in_workarea-suo_inarea = 'X'. "Untervorg#nge
"Select-Options abf#llen
l_mtk_selection-werks = s_werks[].
l_mtk_selection-matnr = s_matnr[].
l_tsk_selection-plnal = s_plnal[].
l_tsk_selection-plnnr = s_plnnr[].
l_tsk_selection-statu = s_statu[].
DATA: lt_plnty TYPE TABLE OF cpsc_plnty_type,
ls_plnty TYPE cpsc_plnty_type.
ls_plnty-low = p_plnty.
ls_plnty-sign = 'I'.
ls_plnty-option = 'EQ'.
APPEND ls_plnty TO lt_plnty.
l_tsk_selection-plnty = lt_plnty[].
l_opr_selection-vornr = s_vornr[].
l_opr_selection-arbpl = s_arbpl[].
l_opr_selection-steus = s_steus[].
l_opr_selection-ktsch = s_ktsch[].
CALL FUNCTION 'CP_CC_S_REFRESH_DATA'
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'CP_CC_S_LOAD_COMPLEX_BY_OPR'
EXPORTING
i_class = 'P'
i_classes_in_workarea = l_classes_in_workarea
i_work_area = ''
i_cpsc_mtk_sel = l_mtk_selection
i_cpsc_tsk_sel = l_tsk_selection
i_cpsc_opr_sel = l_opr_selection
EXCEPTIONS
workarea_not_found = 1
workarea_wrong_type = 2
class_in_workarea_inconsistent = 3
workarea_not_specified = 4
opr_not_found = 5
no_selection_criteria = 6
invalid_selection_period = 7
key_date_required_for_ecm = 8
OTHERS = 9.
CALL FUNCTION 'CP_CL_S_OPR_PROVIDE'
TABLES
e_opr_class_data = lt_opr_class_data
EXCEPTIONS
wrong_key = 1
OTHERS = 2.
CALL FUNCTION 'CP_CL_S_SUB_OPR_PROVIDE'
TABLES
c_opr_class_data = lt_sub_opr_class_data
EXCEPTIONS
wrong_key = 1
OTHERS = 2.
APPEND LINES OF lt_sub_opr_class_data TO lt_opr_class_data.