SAP ABAP IMG Activity CM_XX_SELM04 (Integrate Selection Methods in User-Defined Programs)
Hierarchy
☛
IS-PS-CA (Software Component) IS-PUBLIC SECTOR CONTRACT ACCOUNTING
⤷
IS-HER-CM-AD (Application Component) Administration
⤷
PMIQ (Package) Campus Management

⤷

⤷

IMG Activity
ID | CM_XX_SELM04 | Integrate Selection Methods in User-Defined Programs |
Transaction Code | S_KK4_82000969 | IMG Activity: CM_XX_SELM04 |
Created on | 20020607 | |
Customizing Attributes | CM_XX_204_3_2 | Multiple Use: Non-Critical Non-Mandatory Activity IS-HER-CM-AD, ASAP 204 |
Customizing Activity |
Document
Document Class | SIMG | Hypertext: Object Class - Class to which a document belongs. |
Document Name | CM_XX_SELM04 |
The following contains a code example for integration of selection methods in user-defined programs. You can use the various parts of this example as a template for your own programs.
1. Declaration of the Selection Screen
*Parameters for selection method and selection variant PARAMETERS
pselmeth LIKE t7piqselmethods-selmeth NO-DISPLAY,
pselvari TYPE piqselvari NO-DISPLAY.
*Subscreen area required for selection method
SELECTION-SCREEN BEGIN OF TABBED BLOCK rep_subscr FOR 4 LINES.
SELECTION-SCREEN END OF BLOCK rep_subscr.
2. Database Declaration
TABLES: sscrfields.
DATA:
Reference variable of selection method
gr_selappif TYPE REF TO if_hrpiq00selmethod_appif,
* Reference variable of interface
g_selmethods_ref TYPE REF TO cl_hrpiq00selmethods,
* Internal table of selected objects
g_selobject_tab TYPE STANDARD TABLE OF hrobject,
g_selfailed_count TYPE i,
* Selection period
g_selperiod TYPE piq_period.
3. Definition of a Local Class
CLASS lcl_selappif DEFINITION.
PUBLIC SECTION.
* Implementaion of selection method interface
INTERFACES: if_hrpiq00selmethod_appif.
ENDCLASS.
4. Implementation of Interface Methods
CLASS lcl_selappif IMPLEMENTATION.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~get_param.
ex_selmeth = pselmeth.
ex_selvari = pselvari.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~set_param.
pselmeth = im_selmeth.
pselvari = im_selvari.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~get_okcode.
ex_okcode = sscrfields-ucomm.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~set_okcode.
sscrfields-ucomm = im_okcode.
sy-ucomm = im_okcode.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~get_application_info.
DATA: l_repid.
l_repid = sy-repid.
ex_repid = l_repid.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~set_subscreen_data.
rep_subscr = im_seltabinfo.
ENDMETHOD.
*---------------------------------------------------------------------*
METHOD if_hrpiq00selmethod_appif~get_plvar.
CALL FUNCTION 'HRIQ_GET_ACTIVE_WF_PLVAR'
EXPORTING
ask_plvar_dialog = ' '
IMPORTING
act_plvar = ex_plvar
EXCEPTIONS
no_active_plvar = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
ENDCLASS.
5. Initialization of Selection Methods at INITIALIZATION
(The selection method group is one of the values transferred to the INIT method.)
INITIALIZATION.
* Instance of selection method
CREATE OBJECT gr_selappif TYPE lcl_selappif.
* Instance of interface
CREATE OBJECT g_selmethods_ref.
* Initialization
CALL METHOD g_selmethods_ref->init
EXPORTING
im_applicationif_ref = gr_selappif
im_selscen = 'ZEM' "selection method group(custom.)
EXCEPTIONS
selscen_not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
6. PBO of the Selection Screen
AT SELECTION-SCREEN OUTPUT:
AT SELECTION-SCREEN OUTPUT.
CALL METHOD g_selmethods_ref->before_pbo.
7. PAI of the Selection Screen AT SELECTION-SCREEN:
AT SELECTION-SCREEN.
*date is set date
g_selperiod-begda = sy-datum.
g_selperiod-endda = sy-datum.
CALL METHOD g_selmethods_ref->after_pai
EXPORTING
im_period = g_selperiod.
8. Retrieval of Objects Based on Selection at START-OF-SELECTION:
START-OF-SELECTION.
CALL METHOD g_selmethods_ref->get_objects
EXPORTING
im_base_authority_check = 'X'
im_stru_authority_check = 'X'
im_fcode = 'DISP'
im_period = g_selperiod
IMPORTING
ex_object_tab = g_selobject_tab
ex_stru_auth_failed_count = g_selfailed_count
EXCEPTIONS
selmethscen_not_found = 1
otype_not_supported = 2
selmeth_not_found = 3
invalid_otype = 4
selscen_not_found = 5
selmeth_not_active = 6
selvari_not_found = 7
objects_not_found = 8
no_stru_authority = 9
no_base_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
The system can now determine further data for the objects it retrieved and stored in internal table G_SELOBJECT_TAB.
Business Attributes
ASAP Roadmap ID | 204 | Establish Functions and Processes |
Mandatory / Optional | 3 | Nonrequired activity |
Critical / Non-Critical | 2 | Non-critical |
Country-Dependency | A | Valid for all countries |
Maintenance Objects
Maintenance object type |
History
Last changed by/on | SAP | 20020607 |
SAP Release Created in | 471 |